cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A348470 a(n) = lpf(EKG(n)) = A020639(A064413(n)).

This page as a plain text file.
%I A348470 #26 Dec 08 2021 16:05:05
%S A348470 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,
%T A348470 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,
%U A348470 2,37,3,3,2,2,2,2,41,3,3,2,7,2,2,43,3,2,5
%N A348470 a(n) = lpf(EKG(n)) = A020639(A064413(n)).
%C A348470 Prime p_n appears first at a(A064955(n)).
%C A348470 Records are A008578.
%H A348470 Antti Karttunen, <a href="/A348470/b348470.txt">Table of n, a(n) for n = 1..20000</a>
%H A348470 Michael De Vlieger, <a href="/A348470/a348470.png">Log-log scatterplot of a(n)</a> for n=1..2^12.
%H A348470 Michael De Vlieger, <a href="/A348470/a348470_1.png">Log-log scatterplot of a(n)</a> for n=1..2^18.
%H A348470 <a href="/index/Ed#EKG">Index entries for sequences related to EKG sequence</a>
%t A348470 Map[FactorInteger[#][[1, 1]] &, Nest[Block[{k = 3}, While[Or[MemberQ[#, k], GCD[#[[-1]], k] == 1], k++]; Append[#, k]] &, {1, 2}, 84]]
%t A348470 (* or, faster *)
%t A348470 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]]
%o A348470 (Python)
%o A348470 from itertools import islice, count
%o A348470 from math import gcd
%o A348470 from sympy import primefactors
%o A348470 def A064413gen(): # generator of terms
%o A348470     yield 1
%o A348470     yield 2
%o A348470     l, s, b = 2, 3, set()
%o A348470     for _ in count(0):
%o A348470         i = s
%o A348470         while True:
%o A348470             if not i in b and gcd(i,l) > 1:
%o A348470                 yield i
%o A348470                 l = i
%o A348470                 b.add(i)
%o A348470                 while s in b:
%o A348470                     b.remove(s)
%o A348470                     s += 1
%o A348470                 break
%o A348470             i += 1
%o A348470 def A348470(n): return 1 if n == 1 else min(primefactors(next(islice(A064413gen(),n-1,None)))) # _Chai Wah Wu_, Dec 07 2021
%Y A348470 Cf. A000040, A008578, A020639, A064413, A064955, A073734.
%K A348470 nonn
%O A348470 1,2
%A A348470 _Michael De Vlieger_, Dec 06 2021