# Reciprocal of n terminates with an infinite repetition of digit 1

N. J. A. Sloane njas at research.att.com
Mon Sep 24 12:43:26 CEST 2001

```Concerning this sequence:

%I A064560
%S A064560 9,576,36864,140625,2359296,150994944
%N A064560 Reciprocal of n terminates with an infinite repetition of digit 1. Multiples of 10 are omitted.
%D A064560 A. H. Beiler, Recreations in the Theory of Numbers, Dover, N.Y., 1964, pps. 73-82.
%H A064560 <a href="http://www.research.att.com/~njas/sequences/Sindx_1.html#1overn">Index entries for sequences related to decimal expansion of 1/n</a>
%F A064560 Aren't these just the numbers 9*2^(6i) and 9*5^(6i) ? - njas, Sep 21, 2001
%e A064560 E.g. 1/36864 = 0.0000271267361111111111...
%o A064560 (ARIBAS): a064560(1,200000000,1,36). Definition of a064560: function a064560(minarg,maxarg,d,len: integer); var n,r,decpos,sign: integer; s,sd: string; begin set_floatprec(round(len*3.3)); r := len div 3; sd := alloc(string,r,ftoa(d)[0]); n := minarg - 1; while n < maxarg do inc(n); if n mod 10 <> 0 then s := float_ecvt(1/n,len,decpos,sign); if s[len-r-1..len-2] = sd then write(n," "); end; end; end; end;
%Y A064560 Cf. A064561 up to A064567.
%K A064560 nonn,base,more,new
%O A064560 0,1
%A A064560 Patrick De Geest (pdg at worldofnumbers.com), Sep 20 2001.
%E A064560 One more term from Klaus Brockhaus (klaus-brockhaus at t-online.de), Sep 21 2001

Here is a proof that these are just the numbers 9*2^(6i) and 9*5^(6i):
We have
1/n =   (k+ (1/9))/ 10^m
so
n = 9*10^m/(9k+1)
so 9 divides n, say n=9x

and 10 does not divide x

Then x = 10^m/(9k+1), so 9k+1 = 2^r 5^s (say)
and m = max(r,s)

Also
9 | 2^r 5^s - 1    (*)
But  phi(9) = 6, 2^6 == 1 mod 9, 5^6 == 1 mod 9
so only solution to (*) is r == s mod 6

If r >= s, say r = s + 6i then n = 9*5^(6i)
Simly. if s >= r, n = 9*2^(6i)
QED

NJAS

```