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.

A303978 a(n) is the smallest prime p that does not divide n-1 such that (n^p-1)/(n-1) is composite, for n > 1.

Original entry on oeis.org

11, 5, 5, 5, 11, 7, 2, 3, 5, 3, 7, 11, 2, 5, 7, 13, 3, 5, 2, 7, 11, 3, 2, 5, 2, 5, 7, 3, 3, 11, 2, 5, 2, 3, 3, 5, 2, 3, 11, 7, 3, 11, 2, 3, 11, 3, 2, 5, 2, 3, 5, 3, 2, 5, 2, 5, 5, 5, 3, 11, 2, 3, 2, 3, 11, 5, 2, 5, 5, 11, 3, 11, 2, 5, 2, 7, 5, 7, 2, 3, 5, 3, 2, 11, 2, 3, 5, 5, 2
Offset: 2

Views

Author

Thomas Ordowski, May 03 2018

Keywords

Comments

Smallest prime p such that (n^p-1)/(n-1) is a pseudoprime to base n > 1.
If Schinzel's hypothesis H is true, then the sequence is unbounded.
b(n) = (n^a(n)-1)/(n-1) is a strong pseudoprime to base n > 1, but not necessarily the smallest, cf. A298756.
b(n): 2047, 121, 341, 781, 72559411, 137257, 9, 91, 11111, 133, ...
Indices n of records a(n) = 11, 13, 17, 19, 23, 29 are n = 2, 17, 4291, 32319, 128701, 2668576. - Robert Israel, May 04 2018

Examples

			The repunit (10^5-1)/9 = 11111 = 41*271 is composite, so a(10) = 5, because (10^2-1)/9 = 11 is prime and 3 divides 9.
		

Crossrefs

Cf. A298756.

Programs

  • Maple
    f:= proc(n) local p;
      p:= 2;
      while n-1 mod p = 0 or isprime((n^p-1)/(n-1)) do p:= nextprime(p) od:
      p
    end proc:
    map(p, [$2..100]); # Robert Israel, May 04 2018
  • Mathematica
    Array[Block[{p = 2}, While[Nand[CoprimeQ[# - 1, p], CompositeQ[(#^p - 1)/(# - 1)]], p = NextPrime@ p]; p] &, 89, 2] (* Michael De Vlieger, May 06 2018 *)
  • PARI
    a(n) = {forprime(p=2,,if (((n-1) % p) && !isprime((n^p-1)/(n-1)), return (p)););} \\ Michel Marcus, May 04 2018

Extensions

More terms from Michel Marcus, May 04 2018