login
A367687
a(n) is the first prime p such that n*p+1 is the product of n primes counted with multiplicity.
1
2, 7, 17, 47, 79, 9479, 41, 5923, 199, 33461, 2141, 69173177, 11579, 7655281, 20753, 64869017, 233231, 2622816297743, 341477, 14508897313, 8138947, 24565981007, 27445337, 90698401133219401, 313566167, 2552728502809, 229909997, 23451738297083, 948780491, 20677177107714198558766009, 3390080033
OFFSET
1,1
LINKS
FORMULA
A001222(n*a(n)+1) = n.
EXAMPLE
a(3) = 17 because 17 is prime and 3 * 17 + 1 = 52 = 2^2 * 13 is the product of 3 primes, and no smaller prime works.
MAPLE
f:= proc(n)
uses priqueue;
local Q, t, q, i;
initialize(Q);
q:= 2;
while n mod q = 0 do q:= nextprime(q) od:
insert([-q^n, q, n], Q);
do
t:= extract(Q);
if -t[1]-1 mod n = 0 and isprime((-t[1]-1)/n) then return (-t[1]-1)/n fi;
q:= nextprime(t[2]);
while n mod q = 0 do q:= nextprime(q) od;
for i from 1 to t[3] do
insert([t[1]*(q/t[2])^i, q, i], Q);
od
od;
end proc:
map(f, [$1..40]);
CROSSREFS
Sequence in context: A108479 A178441 A014742 * A085411 A180665 A275209
KEYWORD
nonn,look
AUTHOR
Zak Seidov and Robert Israel, Nov 26 2023
STATUS
approved