login
A362031
a(1) = 1; for n > 1, a(n) is number of terms in the first n-1 terms of the sequence that have the same number of prime factors, counted with multiplicity, as a(n-1).
5
1, 1, 2, 1, 3, 2, 3, 4, 1, 4, 2, 5, 6, 3, 7, 8, 1, 5, 9, 4, 5, 10, 6, 7, 11, 12, 2, 13, 14, 8, 3, 15, 9, 10, 11, 16, 1, 6, 12, 4, 13, 17, 18, 5, 19, 20, 6, 14, 15, 16, 2, 21, 17, 22, 18, 7, 23, 24, 3, 25, 19, 26, 20, 8, 9, 21, 22, 23, 27, 10, 24, 4, 25, 26, 27, 11, 28, 12, 13, 29, 30, 14, 28
OFFSET
1,3
COMMENTS
After 1 million terms the most common numbers for the number of prime factors of the terms are 3, 2, 4, and 5. These correspond to the uppermost four lines of the attached image. It is unknown if these stay the most common or are passed by numbers with more prime factor as n gets arbitrarily large.
See A362033 for the indices where a(n) = 1.
LINKS
Michael De Vlieger, Log log scatterplot of a(n), n = 1..2^16, with a color function representing Omega(a(n-1)), where black = 0, red = 1, orange = 2, ..., magenta = 14.
EXAMPLE
a(6) = 2 as the number of prime factors of a(5) = A001222(a(5)) = A001222(3) = 1, and there are two previous terms, a(3) and a(5), that have one prime factor.
a(9) = 1 as the number of prime factors of a(8) = A001222(a(8)) = A001222(4) = 2, and there is only one term, a(8), that has two prime factors.
MATHEMATICA
nn = 120; c[_] = 0; j = a[1] = c[0] = 1; m = 0; Do[Set[k, c[m]]; (Set[{a[n], j, m}, {k, k, #}]; c[#]++) &[PrimeOmega[k]], {n, 2, nn}]; Array[a, nn] (* Michael De Vlieger, Apr 06 2023 *)
PROG
(Python)
from sympy import factorint
from itertools import islice
from collections import Counter
def A362031gen(): # generator of terms
an, c, d = 1, Counter(), dict()
while True:
yield an
pf = d[an] if an in d else sum(factorint(an).values())
c[pf] += 1
an = c[pf]
print(list(islice(A362031gen(), 83))) # Michael S. Branicky, Apr 06 2023
(Python)
from itertools import islice
from sympy import primeomega
def A362031_gen(): # generator of terms
a, b, c = {}, {}, 1
while True:
yield c
d = b[c] = b.get(c, primeomega(c))
c = a[d] = a.get(d, 0)+1
A362031_list = list(islice(A362031_gen(), 20)) # Chai Wah Wu, Apr 08 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Scott R. Shannon, Apr 06 2023
STATUS
approved