OFFSET

1,2

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 primes only (with duplicates, sometimes); the starting sequence (this one) is the lexicographically earliest with this property that has no duplicates and no primes.

LINKS

Carole Dubois, Table of n, a(n) for n = 1..5000

EXAMPLE

Striking 1 to the right pushes 1 against 12;

the last digit of 12 is then pushed against 4 (leaving 11 behind - a prime);

the last digit of 4 is then pushed against 14 (leaving 2 behind - a prime);

the last digit of 14 is then pushed against 15 (leaving 41 behind - a prime);

the last digit of 15 is then pushed against 6 (leaving 41 behind - a prime);

the last digit of 6 is then pushed against 16 (leaving 5 behind - a prime); 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 = [0, 1], {1}

for k in range(2, n+1):

ball = (str(alst[k-1]))[-1]

ak = 1

ball_left = ball + (str(ak))[:-1]

while not isprime(int(ball_left)) or ak in used or isprime(ak):

ak += 1 + (ak%10 == 9) # can't end in 0

ball_left = ball + (str(ak))[:-1]

alst.append(ak)

used.add(ak)

return alst[1:] # use alst[n] for a(n) function

print(aupto(64)) # Michael S. Branicky, Dec 07 2020

CROSSREFS

KEYWORD

base,nonn

AUTHOR

Eric Angelini and Carole Dubois, Dec 06 2020

STATUS

approved