login
Number of full reptend primes p < n in base n.
1

%I #30 May 04 2017 00:07:42

%S 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,

%T 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,

%U 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

%N Number of full reptend primes p < n in base n.

%C 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.

%C Full reptend primes are also called long period primes, long primes, or maximal period primes.

%C 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.

%C 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).

%C 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

%D G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers. 6th ed., Oxford Univ. Press, 2008, pp. 144-148.

%H Robert Israel, <a href="/A261773/b261773.txt">Table of n, a(n) for n = 2..10000</a>

%H OEIS Wiki, <a href="https://oeis.org/wiki/Full_reptend_primes">Full reptend primes</a>.

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/CyclicNumber.html">Cyclic Number</a>.

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/FullReptendPrime.html">Full Reptend Prime</a>.

%e a(10) = 1 since the only full reptend prime in base 10 less than 10 is 7.

%e a(17) = 5 since the full reptend primes {2, 3, 5, 7, 11} in base 17 are all less than 17.

%p f:= proc(n) nops(select(p -> isprime(p) and numtheory:-order(n,p) = p-1, [$2..n-1])) end proc:

%p map(f, [$2..100]); # _Robert Israel_, Aug 31 2015

%t Count[Prime@ Range@ PrimePi@ #, n_ /; MultiplicativeOrder[#, n] == n - 1] & /@ Range[2, 99] (* _Michael De Vlieger_, Aug 31 2015 *)

%o (PARI) a(n) = sum(k=2, n-1, if (isprime(k) && (n%k), znorder(Mod(n, k))==(k-1))); \\ _Michel Marcus_, Sep 04 2015

%Y Cf. A001913.

%K nonn,base

%O 2,4

%A _Michael De Vlieger_, Aug 31 2015