OFFSET
1,1
COMMENTS
LINKS
EXAMPLE
4 is present, because by applying prime shift once to it, we get A003961(4) = 9 = 2*4 + 1.
5 is present, because by applying prime shift twice to it, we get 5 -> 7 -> 11 = 2*5 + 1.
MAPLE
filter:= proc(n) local F, F1, F2, G, G1, G2;
F:= sort(ifactors(n)[2], (a, b) -> a[1]<b[1]);
G:= sort(ifactors(2*n+1)[2], (a, b) -> a[1]<b[1]);
if nops(F) <> nops(G) then return false fi;
F2:= map(t -> t[2], F);
G2:= map(t -> t[2], G);
if F2 <> G2 then return false fi;
if nops(F) = 1 then return true fi;
F1:= map(t -> numtheory:-pi(t[1]), F);
G1:= map(t -> numtheory:-pi(t[1]), G);
nops(convert(G1-F1, set))=1;
end proc:
select(filter, [$2..10000]); # Robert Israel, Feb 18 2022
MATHEMATICA
f[p_, e_] := NextPrime[p]^e; s[1] = 1; s[n_] := Times @@ f @@@ FactorInteger[n]; q[n_] := NestWhileList[s, n, # < 2*n + 1 &][[-1]] == 2*n + 1; Select[Range[2, 2000], q] (* Amiram Eldar, Oct 30 2021 *)
PROG
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Oct 30 2021
STATUS
approved
