OFFSET
1,1
COMMENTS
There is a non-snooker description of this sequence: first erase all spaces between terms; then move every comma 1 position to the left; the new sequence is now made by nonprimes only (with duplicates, sometimes); the starting sequence (this one) is the lexicographically earliest with this property that has no duplicates and no nonprimes.
EXAMPLE
Striking 2 to the right pushes 2 against 11;
the last digit of 11 is then pushed against 3 (leaving 21 behind - a nonprime);
the last digit of 3 is then pushed against 23 (leaving 1 behind - a nonprime);
the last digit of 23 is then pushed against 29 (leaving 32 behind - a nonprime);
the last digit of 29 is then pushed against 5 (leaving 32 behind - a nonprime);
the last digit of 5 is then pushed against 13 (leaving 9 behind - a nonprime);
etc.
This is the lexicographically earliest sequence of distinct positive terms with this property.
PROG
(Python)
from sympy import isprime
def aupto(n):
alst, used, strakm1 = [0, 2], {2}, "2"
for k in range(2, n+1):
ball = (str(alst[k-1]))[-1]
ak = 1
ball_left = ball + (str(ak))[:-1]
while isprime(int(ball_left)) or ak in used or not isprime(ak):
ak += 2 # continue to only test odds
ball_left = ball + (str(ak))[:-1]
alst.append(ak)
used.add(ak)
return alst[1:] # use alst[n] for a(n) function
print(aupto(70)) # Michael S. Branicky, Dec 11 2020
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Eric Angelini and Carole Dubois, Dec 10 2020
STATUS
approved