OFFSET
1,2
COMMENTS
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..10000
Rémy Sigrist, PARI program for A299442
Rémy Sigrist, Colored scatterplot of the first 100000 terms (where the color is function of A006530(a(n-1)))
EXAMPLE
MAPLE
N:= 1000: # to get terms before the first term > N
with(numtheory):
V:= Vector(N):
A[1]:= 1: A[2]:= 2: V[1]:= 1: V[2]:= 1:
found:= true:
for n from 2 while found do
found:= false;
k:= pi(max(factorset(A[n])));
for v from k to N by k do
if V[v] = 0 then
V[v]:= 1;
A[n+1]:= v;
found:= true;
break
fi
od
od:
seq(A[i], i=1..n-1); # Robert Israel, Feb 18 2018
MATHEMATICA
max = 100; Clear[a, V]; a[_] = 0; V[_] = 0; a[1] = 1; a[2] = 2; V[1] = 1; V[2] = 1; found = True; For[n = 2, found, n++, found = False; k = PrimePi[ FactorInteger[a[n]][[-1, 1]]]; For[v = k, v <= max, v += k, If[V[v] == 0, V[v] = 1; a[n+1] = v; found = True; Break[]]]]; DeleteCases[ Array[a, max], 0] (* Jean-François Alcover, Feb 23 2018, after Robert Israel *)
PROG
(PARI) See Links section.
CROSSREFS
KEYWORD
nonn
AUTHOR
Rémy Sigrist, Feb 10 2018
STATUS
approved