OFFSET
1,1
COMMENTS
The rules generate successive generations g(n) as follows: g(1) = (2), which begets 3 and 5, so that g(2) = (3,5); then g(3) = (7,11); g(4) = (13,17,19,23); etc. The number of primes in g(n) is given by A234961, and primes not generated, beginning with 71, are given by A234962. Conjecture: the limiting relative density of generated primes is 0.
LINKS
Clark Kimberling, Table of n, a(n) for n = 1..4000
EXAMPLE
Starting with 2, the greatest prime less than 2*2 is 3, and the least prime greater than 2*2 is 5.
MATHEMATICA
t = NestList[DeleteDuplicates[Flatten[Map[{#, NextPrime[2 #, -1], NextPrime[2 #, 1]} &, #]]] &, {2}, 9]; g = Join[{{2}}, Map[Complement[t[[# + 1]], t[[#]]] &, Range[Length[t] - 1]]]
Flatten[g] (* A234960 *) (* Peter J. C. Moses, Dec 30 2013 *)
PROG
(Python)
from sympy import prevprime, nextprime
def aupto(limit):
reach, expand = {2}, [2]
while True:
newreach = set()
while len(expand) > 0:
p = expand.pop()
for q in prevprime(2*p), nextprime(2*p):
if q not in reach:
newreach.add(q)
reach |= newreach
expand = list(newreach)
if prevprime(2*min(expand)) > limit:
return sorted(r for r in reach if r <= limit)
print(aupto(353)) # Michael S. Branicky, Jul 24 2022
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Jan 01 2014
STATUS
approved