Four eight seven

1) Notation: the reciprocal of the prime p is 1/p.

When expressed in a given base 1/p produces either an exact result, or a repeating set of figures; in base ten we call these recurring decimals; for other bases some people use "basimals".

In base ten the decimal representation of 1/3 is 0·33333... with the figure 3 repeating; in base twelve the basimal for 1/5 is 0·2497 2497 ... with the 2497 group repeating.

One third has 1 repeating digit in base ten.
Here we use the notation f(p) for the number of digits in the repeating period, so f(3)=1 in base ten and f(5)=4 in base twelve. With this notation the minimum number of figures in the repeating period is 0 (no figures repeat) and the maximum is p-1.

2) Powers of primes.

The square of 1/p has p.f(p) digits; so if f(5) is 4 in base twelve, then f(5x5) is 5 x f(5) = 5 x 4 = 20 digits.
The cube of 1/5 will have 5 x f(5x5) or 5 x 20 = 100 digits.

In general f(p^n)= p^(n-1)f(p). (A)

But there are exceptions...

One third in base ten has 1 digit and so does its square, one-ninth, while our formula (A) above says it should have 3.

Similar exceptions can be found when using bases other than ten, and can be found to have an underlying rule; but there are some which do not have an obvious rule (i.e. we haven't found one yet...)

One-third belongs to a group of primes for which the square (or higher powers) are one unit above or below the base in which they are expressed.
In base ten f(3) and f(3x3) both equal 1; and 3 x 3 = 10-1
In base twenty-six f(5) and f(5x5) both equal 1; 5 x 5= 26-1.

These exceptions occur when b = p^n±1, the letter b standing for the base. More generally b = mp^n±1 where m is any integer.

Now we come to the interesting bit; there are some primes which do not fall into this category and do not appear to obey any special rule.

The only one I knew of in base ten was the expression for 1/487; in base ten f(487)=486 (the maximum possible); and f(487^2) is also 486. Question - why is this so? And - are there more exceptions among higher primes in base ten - or in some other base other than ten?

Here is a list of "487" type exceptions - i.e. those for which I have found no rule yet. So far I have kept to small primes and bases up to base 30. With a bit more time I shall extend the search into three-figure primes and beyond.

Primef(p)f(p^2)base f(p)=p-1?
48748610yes, full period
547yes, full period
1153no, ½ period
1159no, ½ period
292814yes, full period
5418yes, full period
7318no, ½ period
373618yes, full period
7619yes, full period
131219yes, full period
13322no, ¼ period
13623no, ½ period
11527no, ½ period
19928no, ½ period
232228yes, full period
7330no, ½ period

Base twelve has been checked as far as p=101; no exceptions so far.

There you have the "487 Problem" (for want of a better name. Comments - and solutions - welcome!

Results for f(p^2) = f(p)

pbase form
5Np^2 ± 7 (i.e. bases 7, 18, 24 ..)
7 Np^2 ± 18 and Np^2 ± 19
11 Np^2 ± 3, 9, 27, 40
13 Np^2 ± 19, 22, 23, 70, 80
17 Np^2 ± 38, 40, 65, 75, 110,131, 134
19 Np^2 ± 28,54,62,68,69,99,116,127

What about higher powers?

Is there a p for which f(p^n) = f(p) for any n?
If not, how far can we go?

What about the thirds in base ten?

and extending this ...

or how about base 82? (3^4+1)
f(3) = f(3^2) = f(3^3) = f(3^4) = 1

but this still doesn't tell me why 487 is an exception.

all comments welcome - and for reference see the page of results so far

Results

And a fascinating book for Number Theory work:
Recreations in the Theory of Number, Beiler (Dover Books 1966)