login
A234960
Sequence (or tree) T of primes generated by these rules: 2 is in T; if p is in T, then the greatest prime < 2*p is in T; if p is in T, then the least prime > 2*p is in T; duplicates are deleted as they occur.
3
2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 73, 79, 83, 89, 97, 103, 107, 113, 127, 131, 137, 139, 149, 157, 163, 167, 173, 179, 193, 197, 199, 211, 223, 227, 251, 257, 263, 271, 277, 281, 293, 307, 313, 317, 331, 337, 347, 353
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
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
Sequence in context: A176165 A196230 A233360 * A118850 A322443 A219697
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Jan 01 2014
STATUS
approved