login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A348016
Record the number of terms with no proper divisors, then the number with one proper divisor, then two, three, etc., until reaching a zero term. After each zero term, repeat the count as before.
2
0, 1, 0, 3, 1, 0, 5, 2, 0, 6, 3, 0, 7, 5, 0, 8, 6, 0, 9, 6, 1, 4, 0, 11, 7, 2, 4, 0, 12, 9, 4, 4, 0, 13, 10, 6, 6, 0, 14, 10, 6, 10, 0, 15, 10, 6, 14, 0, 16, 10, 6, 17, 1, 1, 0, 19, 12, 6, 18, 1, 3, 0, 21, 13, 6, 20, 1, 4, 0, 23, 15, 7, 21, 1, 4, 0, 25, 16, 9, 22, 2, 4, 0, 26, 17
OFFSET
0,4
COMMENTS
An inventory sequence counting the proper divisors of existing terms, where zero is taken to have no proper divisors (see A032741). After every occurrence of a zero term the incremental count of terms with 0,1,2,... proper divisors is repeated until another zero term is encountered.
LINKS
EXAMPLE
a(0) = 0 because at first there are no terms, therefore there are no terms with no proper divisors.
a(1) = 1 because now there is one term (a(0)) which has no proper divisors.
a(2) = 0 since there are no terms with one proper divisor.
a(3) = 3 since there are now three terms having just one proper divisor (0,1,0).
As an irregular triangle the sequence begins:
0, 1, 0;
3, 1, 0;
5, 2, 0;
6, 3, 0;
7, 5, 0;
8, 6, 0;
9, 6, 4, 1, 0;
11, 7, 2, 4, 0;
etc.
PROG
(PARI) first(n) = { t = 0; res = vector(n); l = List([1]); for(i = 2, n, for(i = #l + 1, t+1, listput(l, 0) ); res[i] = l[t + 1]; q = if(l[t + 1] == 0, 0, numdiv(l[t + 1]) - 1); for(i = #l + 1, q + 1, listput(l, 0) ); l[q + 1]++; if(res[i] == 0, t = 0 , t++ ) ); res } \\ David A. Corneth, Sep 25 2021
(Python)
from sympy import divisor_count
from collections import Counter
def f(n): return 0 if n == 0 else divisor_count(n) - 1
def aupton(nn):
num, alst, inventory = 0, [0], Counter([0])
for n in range(1, nn+1):
c = inventory[num]
num = 0 if c == 0 else num + 1
alst.append(c)
inventory.update([f(c)])
return alst
print(aupton(84)) # Michael S. Branicky, May 07 2023
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
EXTENSIONS
Data corrected and extended by David A. Corneth, Sep 25 2021
STATUS
approved