A348470 a(n) = lpf(EKG(n)) = A020639(A064413(n)).
1, 2, 2, 2, 3, 3, 2, 2, 2, 5, 3, 2, 2, 7, 3, 2, 2, 2, 2, 11, 3, 3, 2, 5, 5, 2, 2, 13, 3, 2, 2, 2, 17, 3, 2, 2, 19, 3, 3, 2, 2, 2, 23, 3, 2, 2, 2, 2, 2, 7, 3, 2, 5, 5, 2, 2, 29, 3, 2, 2, 31, 3, 2, 2, 2, 2, 37, 3, 3, 2, 2, 2, 2, 41, 3, 3, 2, 7, 2, 2, 43, 3, 2, 5
Offset: 1
Keywords
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.
- Index entries for sequences related to EKG sequence
Programs
-
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]]
-
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
Comments