# Fourier transformations are hard. Fouriest transformations are harder.
This Kata is based on the SMBC Comic on fourier transformations.
A fourier transformation on a number is one that converts the number to a base in which it has more `4`s ( `10` in base `6` is `14`, which has `1` four as opposed to none, hence, fourier in base `6` ).
A number's fouriest transformation converts it to the base in which it has the most `4`s.  
For example: `35353` is the fouriest in base `6`: `431401`.
This kata requires you to create a method `fouriest` that takes a number and makes it the fouriest, telling us in which base this happened, as follows:
```python
fouriest(number) -> "{number} is the fouriest ({fouriest_representation}) in base {base}"
```
## Important notes
* For this kata we don't care about digits greater than `9` ( only `0` to `9` ), so we will represent all digits greater than `9` as `'x'`: `10` in base `11` is `'x'`, `119` in base `20` is `'5x'`, `118` in base `20` is also `'5x'`
* When a number has several fouriest representations, we want the one with the LOWEST base
```if:haskell,javascript
* Numbers below `9` will not be tested
```
```if:javascript
* A `BigNumber` library has been provided; documentation is [here](https://mikemcl.github.io/bignumber.js/)
```
## Examples
```python
"30 is the fouriest (42) in base 7"
"15 is the fouriest (14) in base 11"
```
def trans_base(n,b):
    r=''
    while(n>0):
        d=n%b
        r+=str(d) if d<10 else 'x'
        n//=b
    return r[::-1]

def fouriest(i):
    m=[0,None,None]
    for b in range(2,300):
        s=trans_base(i,b)
        if len(s)<m[0]:
            break
        c=s.count('4')
        if c>m[0]:
            m=[c,s,b]
    return '{} is the fouriest ({}) in base {}'.format(i,m[1],m[2])
def trans_base(n,b):
    r=''
    while(n>0):
        d=n%b
        r+=str(d) if d<10 else 'x'
        n//=b
    return r[::-1]

def fouriest(i):
    m=[0,None,None]
    for b in range(2,300):
        s=trans_base(i,b)
        if len(s)<m[0]:
            break
        c=s.count('4')
        if c>m[0]:
            m=[c,s,b]
    return '{} is the fouriest ({}) in base {}'.format(i,m[1],m[2])