login
A239293
Smallest composite c > n such that n^c == n (mod c).
2
4, 341, 6, 6, 10, 10, 14, 9, 12, 15, 15, 22, 21, 15, 21, 20, 34, 25, 38, 21, 28, 33, 33, 25, 28, 27, 39, 36, 35, 49, 49, 33, 44, 35, 45, 42, 45, 39, 57, 52, 82, 66, 77, 45, 55, 69, 65, 49, 56, 51, 65, 65, 65, 55, 63, 57, 65, 66, 87, 65, 91, 63, 93, 65, 70, 78, 85
OFFSET
1,1
COMMENTS
a(n) is the smallest weak pseudoprime to base n that is > n.
If n is even and n+1 is composite, then a(n) = n+1. [Corrected by Thomas Ordowski, Aug 03 2018]
Conjecture: a(n) = n+1 if and only if n+1 is an odd composite number. - Thomas Ordowski, Aug 03 2018
MAPLE
L:=NULL: for a to 100 do for n from a+1 while isprime(n) or not(a^n - a mod n =0) do od; L:=L, n od: L;
MATHEMATICA
Table[k = n; While[k++; PrimeQ[k] || PowerMod[n, k, k] != n]; k, {n, 100}] (* T. D. Noe, Mar 17 2014 *)
PROG
(Haskell)
import Math.NumberTheory.Moduli (powerMod)
a239293 n = head [c | c <- a002808_list, powerMod n c c == n]
-- Reinhard Zumkeller, Jul 11 2014
(PARI) a(n) = forcomposite(c=n+1, , if(Mod(n, c)^c==n, return(c))) \\ Felix Fröhlich, Aug 03 2018
CROSSREFS
Cf. A000790 (primary pretenders), A007535 (smallest pseudoprimes to base n).
Cf. A002808.
Sequence in context: A173367 A214161 A265868 * A295997 A090086 A007535
KEYWORD
nonn
AUTHOR
Robert FERREOL, Mar 14 2014
STATUS
approved