cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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).

Original entry on oeis.org

1, 12, 4, 14, 15, 6, 16, 18, 32, 8, 33, 9, 72, 34, 35, 36, 74, 38, 39, 75, 91, 76, 77, 92, 93, 78, 94, 192, 95, 96, 132, 98, 99, 111, 133, 112, 114, 194, 195, 212, 115, 213, 116, 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
Offset: 1

Views

Author

Eric Angelini and Carole Dubois, Dec 06 2020

Keywords

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.

Examples

			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
		

Crossrefs

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

Programs

  • 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