login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A339467 The Ronnie O'Sullivan's "infinite plant" sequence: nonprime numbers become prime numbers by striking the cue ball 1 with a cue stick to the right (see the Comments section). 2

%I #27 Dec 14 2020 05:16:08

%S 1,12,4,14,15,6,16,18,32,8,33,9,72,34,35,36,74,38,39,75,91,76,77,92,

%T 93,78,94,192,95,96,132,98,99,111,133,112,114,194,195,212,115,213,116,

%U 134,196,135,214,198,117,272,118,119,291,136,138,215,216,171,273,172,231,274,217,275,218,219,292,232,234,312,235

%N The Ronnie O'Sullivan's "infinite plant" sequence: nonprime numbers become prime numbers by striking the cue ball 1 with a cue stick to the right (see the Comments section).

%C 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.

%H Carole Dubois, <a href="/A339467/b339467.txt">Table of n, a(n) for n = 1..5000</a>

%e Striking 1 to the right pushes 1 against 12;

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

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

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

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

%e the last digit of 6 is then pushed against 16 (leaving 5 behind - a prime); etc.

%e This is the lexicographically earliest sequence of distinct positive terms with this property

%o (Python)

%o from sympy import isprime

%o def aupto(n):

%o alst, used = [0, 1], {1}

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

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

%o ak = 1

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

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

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

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

%o alst.append(ak)

%o used.add(ak)

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

%o print(aupto(64)) # _Michael S. Branicky_, Dec 07 2020

%Y Cf. A339616 (the Judd Trump sequence), A335972, A335973.

%K base,nonn

%O 1,2

%A _Eric Angelini_ and _Carole Dubois_, Dec 06 2020

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 05:37 EDT 2024. Contains 371906 sequences. (Running on oeis4.)