OFFSET
1,1
COMMENTS
There are prominent lines that have more terms, their coefficients are approximately: 0.519, 0.329, 0.689, 0.188, 0.615, ... (see the frequency link). They seem to be distorted prime harmonic lines: 1/2, 1/3, 2/3, 1/5, 3/5, ... from A016035.
It appears limsup a(n)/n is approximately 0.83.
LINKS
Rok Cestnik, Table of n, a(n) for n = 1..1000
Rok Cestnik, a(n)/n frequency for 3*10^5 terms.
Michael De Vlieger, Log log scatterplot of a(n), n = 1..2^16.
EXAMPLE
[2,*] 1 term shares a factor with 2, so a(2) = 1+1 = 2.
[2,2,*] 2 terms share a factor with 2, so a(3) = 1+2 = 3.
[2,2,3,*] 1 term shares a factor with 3, so a(4) = 1+1 = 2.
[2,2,3,2,*] 3 terms share a factor with 2, so a(5) = 1+3 = 4.
[2,2,3,2,4,*] 4 terms share a factor with 4, so a(6) = 1+4 = 5.
MATHEMATICA
nn = 120; c[_] := 0; s = {}; a[1] = j = 2; Do[c[j]++; If[c[j] == 1, AppendTo[s, j]]; k = 1 + Total@ Map[c[#] Boole[GCD[#, j] > 1] &, s]; Set[{a[n], j}, {k, k}], {n, 2, nn}]; Array[a, nn] (* Michael De Vlieger, Aug 16 2023 *)
PROG
(Python)
from sympy.ntheory import primefactors
a=[2]; p = [{2}];
for n in range(1, 1000):
a.append(sum(1 if p[-1].intersection(p[i]) else 0 for i in range(n))+1)
p.append(set(primefactors(a[-1])))
(Python)
from math import gcd, prod
from sympy import factorint
from itertools import islice
from collections import Counter
def agen(): # generator of terms
a=[2]; f=2; c=Counter([f])
while True:
yield a[-1]
a.append(1 + sum(c[fi] for fi in c if gcd(f, fi)>1))
f=prod(factorint(a[-1]).keys())
c[f] += 1
a=list(islice(agen(), 1000)) # Michael S. Branicky, Aug 16 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Rok Cestnik, Aug 15 2023
STATUS
approved