OFFSET
1,3
COMMENTS
1 is the only number to appear twice, since it has just one divisor.
Consequently 2 is the only prime whose first occurrence is a multiple of prior terms (2*1), all other occurrences of 2 being subsequent to a novel prime (including itself).
All composite numbers appear as multiples of prior terms, and also as the number of divisors of novel terms, whereas all odd prime terms are the result of novel (square) terms whose number of divisors is prime (A009087).
Conjectures: (i) Every integer > 1 appears infinitely many times. (ii) The first occurrences of primes appear in natural order, starting with 2 as described above, and continuing with odd primes a(n) = p, following a(n-1) = 2^(p-1).
LINKS
Michel Marcus, Table of n, a(n) for n = 1..10000
Michael De Vlieger, Annotated log-log scatterplot of a(n), n = 1..2^16, showing records in red and highlighting terms with predecessors that have appeared for the first time in green.
EXAMPLE
a(1)=1 a novel term, so a(2)=d(1)=1, then a(3)=2+1=2.
a(15)=24, a novel term, therefore a(16)=d(24)=8, and since this is the second occurrence of 8 (a(10=8), a(17)=2*8=16. Since 16 is a novel term with 5 divisors, a(18)=5, and so on.
MATHEMATICA
nn = 120; c[_] = 0; a[1] = c[1] = 1; Do[If[c[#] == 1, Set[k, DivisorSigma[0, #]]; c[k]++, Set[k, c[#]*#]; c[k]++] &@ a[n - 1]; a[n] = k, {n, 2, nn}]; Array[a, nn] (* Michael De Vlieger, Jul 05 2022 *)
PROG
(PARI) lista(nn) = my(va = vector(nn)); va[1] = 1; for (n=2, nn, my(nb = #select(x->(x==va[n-1]), va)); if (nb == 1, va[n] = numdiv(va[n-1]), va[n] = nb*va[n-1]); ); va; \\ Michel Marcus, Jul 05 2022
(Python)
from sympy import divisor_count
from collections import Counter
from itertools import count, islice
def agen():
an, c = 1, Counter()
for n in count(2):
yield an; c[an] += 1
an = divisor_count(an) if c[an] == 1 else c[an]*an
print(list(islice(agen(), 75))) # Michael S. Branicky, Jul 06 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
David James Sycamore, Jul 03 2022
EXTENSIONS
More terms from Michel Marcus, Jul 05 2022
STATUS
approved