OFFSET
1,2
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..20000
Michael De Vlieger, Log-log scatterplot of a(n) for n=1..2^12.
Michael De Vlieger, Log-log scatterplot of a(n) for n=1..2^18.
MATHEMATICA
Map[FactorInteger[#][[1, 1]] &, Nest[Block[{k = 3}, While[Or[MemberQ[#, k], GCD[#[[-1]], k] == 1], k++]; Append[#, k]] &, {1, 2}, 84]]
(* or, faster *)
s = {1, 2}; u = 3; c[_] = 0; Set[j, 2]; Array[Set[c[#], #] &, 2]; Range[2]~Join~Reap[Do[If[PrimeQ[j], Set[u, NextPrime[u]]]; Set[k, u]; Which[And[PrimeQ[j], OddQ[j]], Set[k, 3 j], And[PrimeQ[j/2], OddQ[j/2]], Set[k, j/2], True, While[Nand[c[k] == 0, GCD[j, k] > 1], k++]]; Sow[FactorInteger[k][[1, 1]] ]; Set[c[k], i]; j = k, {i, 4, 10^4}]][[-1, -1]]
PROG
(Python)
from itertools import islice, count
from math import gcd
from sympy import primefactors
def A064413gen(): # generator of terms
yield 1
yield 2
l, s, b = 2, 3, set()
for _ in count(0):
i = s
while True:
if not i in b and gcd(i, l) > 1:
yield i
l = i
b.add(i)
while s in b:
b.remove(s)
s += 1
break
i += 1
def A348470(n): return 1 if n == 1 else min(primefactors(next(islice(A064413gen(), n-1, None)))) # Chai Wah Wu, Dec 07 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Michael De Vlieger, Dec 06 2021
STATUS
approved