OFFSET
0,2
COMMENTS
Are there values for all a(n)? Is the sequence monotonic?
EXAMPLE
1 is nonprime (potency 0) so a(0) = 1.
2 = 10 -> 100 = 4, potency 1, so a(1) = 2.
3 = 11 -> 101 = 5 -> 1001 = 9, potency 2 so a(2) = 3.
Potency 3 first appears for 29, so a(3) = 29; etc.
4088027 dilutes into 5858670956869, 10540679875665334793, 20632314388123853242044433, 41873360515671700575496732442657 and 86420918502629375433474712237244678209, all prime. But the next dilution, 179810732934100666625066494484898891551473793, is composite.
PROG
(PARI) isok(k, n) = for (i=1, n, my(b=binary(k), list=List()); for (j=1, #b-1, listput(list, b[j]); for (k=1, i, listput(list, 0); ); ); listput(list, b[#b]); my(x=fromdigits(Vec(list), 2), isp=ispseudoprime(x)); if ((i<n) && !isp, return(0)); if ((i==n) && isp, return(0)); ); return(1);
a(n) = if (n==0, 1, my(k=2); while (!isok(k, n), k=nextprime(k+1)); k); \\ Michel Marcus, Aug 12 2023
CROSSREFS
KEYWORD
base,nonn,nice,more
AUTHOR
Marc LeBrun, Oct 10 2001
EXTENSIONS
a(6) from Don Reble and Fred W. Helenius (fredh(AT)ix.netcom.com), Oct 11 2001
a(7) from Hans Havermann, Oct 13 2001
a(8) from Michael S. Branicky, Jun 30 2023
STATUS
approved