OFFSET
1,3
COMMENTS
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000
EXAMPLE
terms 0, 1, 2, 40, 162, 8, 32
binary {0}, {1}, {1,0}, {1,0,1,0,0,0}, {1,0,1,0,0,0,1,0}, {1,0,0,0}, {1,0,0,0,0,0}
A010051 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0
MATHEMATICA
n=49; lst={0}; p=2; c=Boole[PrimeQ@Range[n^2]]; Do[k=1; While[MemberQ[lst, ne=FromDigits[c[[p;; (pn=NextPrime[p, k])-1]], 2]], k++]; AppendTo[lst, ne]; p=pn, {i, n}]; lst
PROG
(Python)
from sympy import nextprime
from itertools import islice
def agen(): # generator of terms
yield 0
p, nextp, aset = 2, 3, {0}
while True:
an = 0
while an in aset:
an = (an<<(nextp-p)) + (1<<(nextp-p-1))
p, nextp = nextp, nextprime(nextp)
yield an
aset.add(an)
print(list(islice(agen(), 50))) # Michael S. Branicky, Feb 08 2024
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Giorgos Kalogeropoulos, Feb 08 2024
STATUS
approved