login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A327789
a(n) is the smallest Fermat pseudoprime to base 2 such that gpf(p-1) = prime(n) for all prime factors p of a(n).
1
4369, 1387, 341, 3277, 2047, 8321, 31621, 104653, 280601, 13747, 2081713, 88357, 8902741, 741751, 665333, 680627, 2008597, 1252697, 3235699, 1293337, 513629, 8095447, 83333, 2284453, 604117, 191981609, 1530787, 13747361, 3568661, 769757, 6973063, 275887, 12854437, 16705021
OFFSET
1,1
COMMENTS
Equivalently, a(n) is the smallest composite number k such that 2^(k-1) == 1 (mod k) and gpf(p-1) = prime(n) for all prime factors p of k.
LINKS
Eric Weisstein's World of Mathematics, Poulet Number
EXAMPLE
a(1) = 4369 = (2*2*2*2 + 1)(2*2*2*2*2*2*2*2 + 1).
a(2) = 1387 = (2*3*3 + 1)(2*2*2*3*3 + 1).
a(3) = 341 = (2*5 + 1)(2*3*5 + 1).
a(4) = 3277 = (2*2*7 + 1)(2*2*2*2*7 + 1).
a(5) = 2047 = (2*11 + 1)(2*2*2*11 + 1).
MATHEMATICA
pspQ[n_] := CompositeQ[n] && PowerMod[2, (n - 1), n] == 1; gpf[n_] := FactorInteger[n][[-1, 1]]; g[n_] := If[Length[(u = Union[gpf /@ (FactorInteger[n][[;; , 1]] - 1)])] == 1, u[[1]], 1]; m = 10; c = 0; k = 0; v = Table[0, {m}]; While[c < m, k++ If[! pspQ[k], Continue[]]; If[(p = g[k]) > 1, i = PrimePi[p]; If[i <= m && v[[i]] == 0, c++; v[[i]] = k]]]; v (* Amiram Eldar, Oct 08 2019 *)
PROG
(Perl) use ntheory ":all"; sub a { my $p = nth_prime(shift); for(my $k = 4; ; ++$k) { return $k if (is_pseudoprime($k, 2) and !is_prime($k) and vecall { (factor($_-1))[-1] == $p } factor($k)) } }
for my $n (1..25) { print "a($n) = ", a($n), "\n" }
CROSSREFS
Cf. A001567 (Fermat pseudoprimes to base 2), A006530 (gpf).
Sequence in context: A347603 A217345 A140937 * A043598 A043843 A043857
KEYWORD
nonn
AUTHOR
Daniel Suteu, Sep 25 2019
STATUS
approved