OFFSET
1,1
FORMULA
For all n >= 1, A335885(a(n)) <= 2.
MATHEMATICA
NestList[NestWhile[NextPrime, #, ! (PrimeQ[#2] && With[{p = NestWhile[BitShiftRight, #2 + 1, EvenQ] - 1}, BitAnd[p, p - 1] == 0 && With[{b = BitLength[p]}, BitAnd[b - 1, b - 2] == 0]]) &, 2] &, 2, 25] (* Jan Mangaldan, Jul 14 2020 *)
PROG
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Jul 09 2020
EXTENSIONS
More terms from Jinyuan Wang, Jul 11 2020
STATUS
approved