login
A340799
a(n) is the smallest prime p such that p + 1 has 2n divisors.
4
2, 5, 11, 23, 47, 59, 191, 167, 179, 239, 5119, 359, 20479, 2111, 719, 839, 1114111, 1259, 786431, 3023, 2879, 15359, 348127231, 3359, 22031, 266239, 6299, 6719, 22280142847, 5039, 559419490303, 7559, 156671, 7798783, 25919, 10079, 1168231104511, 5505023
OFFSET
1,1
COMMENTS
The only prime p such that p+1 has an odd number of divisors is 3, because every number with an odd number of divisors is a square. - Robert Israel, Jan 12 2025
LINKS
FORMULA
A000005(a(n) + 1) = 2n.
EXAMPLE
a(4) = 23 because 23 is the smallest prime p such that p + 1 has 2*4 divisors; tau(24) = 8.
MAPLE
g:= proc(n, k) # lists of integers > k whose product is n
option remember;
local F, m;
if n = 1 then return [[]]
elif k >= n then return []
fi;
F:= select(`>`, numtheory:-divisors(n), k);
[seq(op(map(t -> [m, op(t)], procname(n/m, m-1))), m=F)]
end proc:
children:= proc(t) local m, nt, S, i, qs, t3s, t1s;
nt:= nops(t[3]);
S:= select(i -> t[3][i] <> 2, [$1..nt]);
if S = [] then m:= nt else m:= min(S) fi;
qs:= [seq(nextprime(t[3][i]), i=1..m)];
t3s:= [seq(subsop(i = qs[i], t[3]), i = 1..m)];
t1s:= [seq(t[1]*(qs[i]/t[3][i])^t[2][i], i=1..m)];
[seq([t1s[i], t[2], t3s[i]], i=1..m)]
end proc:
f:= proc(d) local pq, s, t, i; uses priqueue;
initialize(pq);
for t in g(2*d, 1) do insert([-mul(2^(t[i]-1), i=1..nops(t)), t -~ 1, [2$nops(t)]], pq) od;
do
t:= extract(pq);
if nops(convert(t[3], set)) = nops(t[3]) and isprime(-t[1]-1) then return -t[1]-1 fi;
for s in children(t) do insert(s, pq) od
od:
end proc:
map(f, [$1..40]); # Robert Israel, Jan 12 2025
PROG
(Magma) Ax:=func<n|exists(r){m:m in[1..10^7] | IsPrime(m) and #Divisors(m + 1) eq n*#Divisors(m)}select r else 0>; [Ax(n): n in[1..20]];
CROSSREFS
Cf. A000005 (tau), A003680, A080371.
Sequence in context: A347309 A174162 A379652 * A186253 A226462 A376193
KEYWORD
nonn,look
AUTHOR
Jaroslav Krizek, Jan 21 2021
STATUS
approved