Although not (yet?) tenured, I decided to implement this transform anyway: see fourier transform. To determine the **fouriest** transform uniquely, in case of a tie the greatest base wins (this is reasonable because greater values of the base correspond to more compact representations).

If no base can beat the decimal, the fourier transform does not exist. I limited consideration to bases up to 36, because they yield convenient representations using the alphabet 012..xyz.

Some examples:

number | fourier transform(s) | fouriest |
---|---|---|

42 | does not exist | does not exist |

2013 | 43b_{22}, 4bi_{21}, 5604_{7} |
43b_{22} |

13244 | 410434_{5} |
410434_{5} |

57885161 | (too many to list) | 5424402505_{6} |

The last line is merely the exponent of the latest and greatest Mersenne prime. If you want to transform the number itself, go four it…

The transform may have a practical application. For example, my office phone number 4431487 is a pretty undistinguished number. But it has a unique fourier (hence fouriest) transform 52444534_{7}, which is easier to remember. This will come in handy when dialpads become equipped with a number base switch.

I added the line “Input interpreted as …” to give some indication of how JavaScript handles integers out of its range. For example, entering 9999999999999999 you will find the the code actually transforms 10000000000000000. This one is handled correctly: the fouriest transform is 242244120325135240144_{6}. But in general, round-off errors may distort the results when the input is large. Do not rely on this code in the situations when the fourierness of a very large number is a matter of life and death.

Open problem: can a number of the form 444…4 have a fourier transform? It is conceivable, though unlikely, that its representation in a base smaller than 10 could have more 4s.

http://math.stackexchange.com/questions/312640/how-to-solve-for-the-fouriest-number

After being linked this by a friend, I coded up a quick application which did something very similar to your Javascript one (in fact, originally I just ported it to Java).

After some more changes and expansions from int to long to BigInteger, I also created a new checker – dedicated to the open problem.

If you’re interested in the result, I assume you can see the email address I’ve supplied (I couldn’t find any way to contact you other than by comment) — send me an email.