OFFSET
1,2
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000
Eric Angelini, More digits, terms and primes, personal blog of the author.
EXAMPLE
Terms a(1) to a(15) are 0,2,4,1,3,5,7,9,6,8,13,16,14,25,20.
The successive absolute differences between two terms are the primes 2,2,3,2,2,2,2,3,2,5,3,2,11,5.
The successive absolute differences between two digits are the primes 2,2,3,2,2,2,2,3,2,7,2,2,5,5,3,2,3,3,2.
PROG
(Python) # uses A219248gen in A219248
from sympy import isprime
from itertools import count, islice
def c(an, k):
return isprime(abs(an-k)) and isprime(abs(an%10-int(str(k)[0])))
def agen(): # generator of terms
an, aset = 0, {0}
while True:
yield an
an = next(k for k in A219248gen(seed=str(an%10)) if k not in aset and c(an, k))
aset.add(an)
print(list(islice(agen(), 73))) # Michael S. Branicky, Sep 11 2024
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Eric Angelini and Jean-Marc Falcoz, Sep 11 2024
STATUS
approved