cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A261773 Number of full reptend primes p < n in base n.

Original entry on oeis.org

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

Views

Author

Michael De Vlieger, Aug 31 2015

Keywords

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

Examples

			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.
		

References

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

Crossrefs

Cf. A001913.

Programs

  • 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 *)
  • PARI
    a(n) = sum(k=2, n-1, if (isprime(k) && (n%k), znorder(Mod(n, k))==(k-1))); \\ Michel Marcus, Sep 04 2015