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.

This page as a plain text file.
%I A303978 #27 Jun 23 2018 14:49:24
%S A303978 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,
%T A303978 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,
%U A303978 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
%N 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.
%C A303978 Smallest prime p such that (n^p-1)/(n-1) is a pseudoprime to base n > 1.
%C A303978 If Schinzel's hypothesis H is true, then the sequence is unbounded.
%C A303978 b(n) = (n^a(n)-1)/(n-1) is a strong pseudoprime to base n > 1, but not necessarily the smallest, cf. A298756.
%C A303978 b(n): 2047, 121, 341, 781, 72559411, 137257, 9, 91, 11111, 133, ...
%C A303978 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
%e A303978 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.
%p A303978 f:= proc(n) local p;
%p A303978   p:= 2;
%p A303978   while n-1 mod p = 0 or isprime((n^p-1)/(n-1)) do p:= nextprime(p) od:
%p A303978   p
%p A303978 end proc:
%p A303978 map(p, [$2..100]); # _Robert Israel_, May 04 2018
%t A303978 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 *)
%o A303978 (PARI) a(n) = {forprime(p=2,,if (((n-1) % p) && !isprime((n^p-1)/(n-1)), return (p)););} \\ _Michel Marcus_, May 04 2018
%Y A303978 Cf. A298756.
%K A303978 nonn
%O A303978 2,1
%A A303978 _Thomas Ordowski_, May 03 2018
%E A303978 More terms from _Michel Marcus_, May 04 2018