OFFSET

1,2

LINKS

N. J. A. Sloane, Table of n, a(n) for n = 1..5002 [Computed using Ray Chandler's Mma program]

MATHEMATICA

f[s_] := Block[{k = 1}, While[MemberQ[s, k] || ! PrimeQ[GCD[Last[s], k]], k++ ]; Append[s, k] ]; Nest[f, {1, 2}, 75] (* Ray Chandler, Aug 30 2006 *)

PROG

(Python)

from math import gcd

from sympy import isprime

from itertools import islice

def agen(): # generator of terms

aset, an, mink = {1, 2}, 2, 3

yield from sorted(aset)

while True:

k = mink

while k in aset or not isprime(gcd(an, k)): k += 1

an = k; aset.add(an); yield an

while mink in aset: mink += 1

print(list(islice(agen(), 72))) # Michael S. Branicky, Oct 13 2022

CROSSREFS

KEYWORD

nonn

AUTHOR

Leroy Quet, Aug 29 2006

EXTENSIONS

Extended by Ray Chandler and Klaus Brockhaus, Aug 30 2006

STATUS

approved