A007738 Period of repeating digits of 1/n in base 7.
1, 1, 1, 2, 4, 1, 1, 2, 3, 4, 10, 2, 12, 1, 4, 2, 16, 3, 3, 4, 1, 10, 22, 2, 4, 12, 9, 2, 7, 4, 15, 4, 10, 16, 4, 6, 9, 3, 12, 4, 40, 1, 6, 10, 12, 22, 23, 2, 1, 4, 16, 12, 26, 9, 20, 2, 3, 7, 29, 4, 60, 15, 3, 8, 12, 10, 66, 16, 22, 4, 70, 6, 24, 9, 4, 6, 10, 12, 78, 4, 27, 40, 41, 2, 16, 6, 7, 10
Offset: 1
Links
Programs
-
Mathematica
f[n_] := MultiplicativeOrder[7, n/(7^IntegerExponent[n, 7])]; Array[f, 80] (* Robert G. Wilson v, Jun 10 2011 *)
-
PARI
a(n)=znorder(Mod(7,n/7^valuation(n,7))) \\ Charles R Greathouse IV, Jun 10 2011