login
A073537
Rearrangement of cubes such that the sum of two consecutive terms + 1 is a prime.
1
1, 27, 729, 2197, 1331, 6859, 24389, 343, 3375, 9261, 59319, 35937, 15625, 12167, 29791, 125, 4913, 79507, 19683, 389017, 91125, 166375, 132651, 117649, 185193, 2460375, 50653, 42875, 300763, 250047, 753571, 148877, 205379, 68921, 226981
OFFSET
1,2
LINKS
PROG
(Python)
from sympy import isprime
from itertools import count, islice
def agen(): # generator of terms
rset, an, r, m = set(), 1, 1, 3
while True:
yield an
rset.add(r)
r = next(k for k in count(m, 2) if k not in rset and isprime(k**3 + an + 1))
an = r**3
while m in rset: m += 2
print(list(islice(agen(), 35))) # Michael S. Branicky, Dec 03 2024
CROSSREFS
Cf. A000578.
Sequence in context: A171332 A097781 A223656 * A016947 A223790 A223976
KEYWORD
nonn
AUTHOR
Jason Earls, Aug 27 2002
STATUS
approved