login
A261773
Number of full reptend primes p < n in base n.
1
0, 1, 0, 2, 0, 2, 2, 1, 1, 2, 2, 3, 1, 2, 0, 5, 2, 4, 3, 2, 3, 4, 4, 1, 2, 3, 5, 5, 2, 4, 5, 6, 3, 3, 0, 6, 4, 5, 6, 6, 4, 5, 5, 4, 4, 6, 7, 1, 5, 4, 8, 7, 5, 6, 7, 7, 6, 6, 5, 10, 6, 9, 0, 8, 4, 10, 6, 8, 4, 9, 9, 11, 7, 6, 7, 7, 8, 11, 8, 1, 7, 7, 8, 9, 8, 9, 8, 12, 7, 9, 10, 8, 5, 8, 9, 10, 11, 9
OFFSET
2,4
COMMENTS
Gives the number of primes p < n, such that the decimal expansion of 1/p has period p-1, which is the greatest period possible for any integer.
Full reptend primes are also called long period primes, long primes, or maximal period primes.
Even square n have a(n) = 0, odd square n have a(n) = 1, since 2 is a full reptend prime for all odd n.
Odd n have a(n) >= 1, since 2 is a full reptend prime in all odd n whose period is 1, i.e., the maximal period (p - 1).
Are 2 and 6 the only numbers other than even squares for which a(n) = 0? Are 3, 10 and 14 the only numbers other than odd squares for which a(n) = 1? - Robert Israel, Aug 31 2015
REFERENCES
G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers. 6th ed., Oxford Univ. Press, 2008, pp. 144-148.
LINKS
Eric Weisstein's World of Mathematics, Cyclic Number.
Eric Weisstein's World of Mathematics, Full Reptend Prime.
EXAMPLE
a(10) = 1 since the only full reptend prime in base 10 less than 10 is 7.
a(17) = 5 since the full reptend primes {2, 3, 5, 7, 11} in base 17 are all less than 17.
MAPLE
f:= proc(n) nops(select(p -> isprime(p) and numtheory:-order(n, p) = p-1, [$2..n-1])) end proc:
map(f, [$2..100]); # Robert Israel, Aug 31 2015
MATHEMATICA
Count[Prime@ Range@ PrimePi@ #, n_ /; MultiplicativeOrder[#, n] == n - 1] & /@ Range[2, 99] (* Michael De Vlieger, Aug 31 2015 *)
PROG
(PARI) a(n) = sum(k=2, n-1, if (isprime(k) && (n%k), znorder(Mod(n, k))==(k-1))); \\ Michel Marcus, Sep 04 2015
CROSSREFS
Cf. A001913.
Sequence in context: A163542 A061895 A129678 * A339733 A226207 A226324
KEYWORD
nonn,base
AUTHOR
Michael De Vlieger, Aug 31 2015
STATUS
approved