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”).
%I #11 Oct 10 2019 04:24:00
%S 4369,1387,341,3277,2047,8321,31621,104653,280601,13747,2081713,88357,
%T 8902741,741751,665333,680627,2008597,1252697,3235699,1293337,513629,
%U 8095447,83333,2284453,604117,191981609,1530787,13747361,3568661,769757,6973063,275887,12854437,16705021
%N 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).
%C 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.
%H Daniel Suteu, <a href="/A327789/b327789.txt">Table of n, a(n) for n = 1..10000</a>
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/PouletNumber.html">Poulet Number</a>
%e a(1) = 4369 = (2*2*2*2 + 1)(2*2*2*2*2*2*2*2 + 1).
%e a(2) = 1387 = (2*3*3 + 1)(2*2*2*3*3 + 1).
%e a(3) = 341 = (2*5 + 1)(2*3*5 + 1).
%e a(4) = 3277 = (2*2*7 + 1)(2*2*2*2*7 + 1).
%e a(5) = 2047 = (2*11 + 1)(2*2*2*11 + 1).
%t 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 *)
%o (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)) } }
%o for my $n (1..25) { print "a($n) = ", a($n), "\n" }
%Y Cf. A001567 (Fermat pseudoprimes to base 2), A006530 (gpf).
%K nonn
%O 1,1
%A _Daniel Suteu_, Sep 25 2019