#numbers in base n

34 messages · Page 1 of 1 (latest)

west sand
#

A number like 1/3 written as a decimal is 0.333.... in base 10 and 0.1 in base 3
So I was thinking, given some number, how can I find which base gives me the least decimal places and which the most decimal places in a decimal representation? Is there some pattern to know which number system will give me how many decimal places in the representation ?

#

for example if I have the number 12/17 which number system will give me the least and which the most decimals? and which number system will give me how many, is there a pattern?

glossy spade
#

And then "the least" would be base-17, possibly any base that's a multiple of 17.

west sand
#

and are there in between values

#

can i find a function phi (n)

#

where for a number system n there is phi(n) decimals

glossy spade
#

...I mean, wouldn't you need a two-input function?

west sand
#

so I mean is there a way to generalize the question

west sand
#

phi (x, n) entering the number and the number system

#

i guess

glossy spade
#

I think a rational number a/b is a repeating decimal in base n if and only if b has prime factors n doesn't.

west sand
#

hmmm alright

#

that makes sense

#

but thats still not all

#

i still am wondering whether a function can be found

#

which covers all cases

glossy spade
#

...is that not all cases?

west sand
#

I mean I would like to know if there is a pattern like if I have 12/17 base 7 how many decimals will i have

#

so I mean a function phi (x,n) as I said

glossy spade
#

Infinitely many

#

Because 17 has a prime factor, 17, which it doesn't share with 7.

#

12/17 is an infinite repeating decimal in all bases b where b isn't a multiple of 17.

west sand
glossy spade
#

,w 12/17

cinder jungleBOT
glossy spade
#

Yeah it is.

west sand
#

I should have used wolfram alpha 🥴

#

my calculator messed with me

#

alright but what about 12/ 17 with base 17 * c

#

say 12/17 base 34