OFFSET
1,1
COMMENTS
Some numbers appear as a multiple terms in a(n). For example, a(n) = 946 for n = {17,27,64,66,73,75,97,113,114,117,128,139,143,152,153,155} for corresponding prime p = {59,103,311,317,367,379,509,617,619,643,719,797,823,881,883,907}. There are some twin terms such that a(n) = a(n+1). For example, a(11) = a(12) = 66, a(37) = a(38) = 186, a(113) = a(114) = 946, a(152) = a(153) = 946, a(227) = a(228) = 2626.
The indices of records are 1, 14, 354, 549, 1302, 2679, 3743, 3998, 4627, 6880, ... with record values of 161038, 526974, 1234806, 1893126, 1930546, 3347398, 3860962, 5073706, 6376126, 61161946, ... - Amiram Eldar, Sep 10 2019
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
Eric Weisstein's World of Mathematics, Fermat Pseudoprime.
MATHEMATICA
a[n_] := Module[{p = Prime[n]}, k = p+1; If[OddQ[k], k++]; While[GCD[p, k] != 1 || PowerMod[p, k, k] != p, k+=2]; k]; Array[a, 100] (* Amiram Eldar, Sep 10 2019 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alexander Adamchuk, May 26 2007
STATUS
approved