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.

Showing 1-6 of 6 results.

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.

Original entry on oeis.org

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

Views

Author

David James Sycamore, Sep 24 2021

Keywords

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.

Examples

			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.
		

Crossrefs

Programs

  • 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

Extensions

Data corrected and extended by David A. Corneth, Sep 25 2021

A352799 Inventory sequence of binary weights.

Original entry on oeis.org

0, 1, 1, 0, 2, 3, 1, 0, 3, 4, 2, 0, 4, 7, 2, 1, 0, 5, 9, 4, 1, 0, 6, 11, 5, 2, 0, 7, 12, 7, 4, 0, 8, 14, 7, 6, 0, 9, 14, 9, 7, 0, 10, 14, 11, 10, 0, 11, 14, 12, 12, 0, 12, 14, 15, 13, 1, 0, 13, 15, 15, 15, 4, 0, 14, 16, 15, 16, 5, 0, 15, 18, 17, 16, 6, 0, 16
Offset: 0

Views

Author

David James Sycamore, Apr 03 2022

Keywords

Comments

Record the number of terms with binary weight zero, then successively record those with weights 1,2,... (including in the count the weights of new terms as they are recorded), until reaching a weight w for which there are zero terms with that weight, whereupon record a zero term. Repeat.

Examples

			a(0) = 0 because at the start there are no terms, therefore zero terms with binary weight zero.
a(1) = 1 because the first term (0) has binary weight zero and there is just one such term.
a(2) = 1 since a(1) = 1 has weight 1, and there is only one term with this weight.
a(3) = 0 since there are no terms with weight 2. Reset the count to zero weight and repeat.
a(4) = 2 because now there are 2 terms (a(0), a(3)) which have weight 0. And so on.
As an irregular triangle the sequence begins:
  0;
  1,  1, 0;
  2,  3, 1, 0;
  3,  4, 2, 0;
  4,  7, 2, 1, 0;
  5,  9, 4, 1, 0;
  6, 11, 5, 2, 0;
		

Crossrefs

Programs

Extensions

a(45) and beyond from Michael S. Branicky, Apr 03 2022

A348218 Variation on the Inventory Sequence A342585: record the number of previous terms which are divisible by the iterating number, starting at 1, until 0 is recorded, then restart the iterating number from 1. See the Comments.

Original entry on oeis.org

1, 1, 0, 2, 1, 0, 4, 2, 0, 6, 4, 1, 2, 0, 10, 7, 1, 2, 1, 1, 1, 0, 17, 8, 1, 3, 1, 1, 1, 1, 0, 25, 9, 3, 3, 2, 1, 1, 1, 1, 1, 0, 35, 10, 5, 3, 5, 1, 2, 1, 1, 2, 0, 45, 13, 7, 3, 7, 1, 4, 1, 2, 2, 0, 55, 16, 8, 6, 8, 2, 4, 4, 2, 2, 1, 0, 66, 26, 10, 9, 9, 3, 4, 4, 4, 3, 2, 0, 77, 32, 14, 13, 9, 3
Offset: 0

Views

Author

Scott R. Shannon, Oct 07 2021

Keywords

Comments

This sequence is a variation of A342585. Instead of iteratively counting the occurrences of each number starting from zero and then repeating when zero is recorded, we start the iterating number at 1 and count the previous terms that are divisible by that number. This number increases for each division until zero previous terms is recorded, when the iterating number is reset to one and the divisor count repeats. The sequence starts with a(0) = 1.
After 10^7 terms the largest value is a(9990262) = 9988674, which is a count of the terms >= 1. The largest value the iterating divisor has reached is 13249.

Examples

			a(1) = 1 as the iterating dividing number starts at 1, and so far there has been one term, a(0), which is divisible by 1.
a(2) = 0 as the dividing number has increased to two, but there have been no terms in the sequence so far that are divisible by 2. The dividing number is now reset to 1.
a(3) = 2 as there have been two terms, a(0) and a(1), that are divisible by 1.
a(4) = 1 as there has been one term, a(3), that is divisible by 2.
a(5) = 0 as there have been no terms divisible by 3. The dividing number is now reset to 1.
		

Crossrefs

A348288 Variation on the Inventory Sequence A342585: the same rules as A342585 are used except that the terms count the occurrences of the iterating number, treated as a string, in the string concatenation of all previous terms. See the Comments.

Original entry on oeis.org

0, 1, 1, 0, 2, 2, 2, 0, 3, 2, 4, 1, 1, 0, 4, 4, 4, 1, 4, 0, 5, 5, 4, 1, 6, 2, 1, 0, 6, 7, 5, 1, 6, 3, 3, 1, 0, 7, 9, 5, 3, 6, 4, 4, 2, 0, 8, 9, 6, 4, 9, 4, 5, 2, 1, 3, 4, 2, 0, 9, 10, 8, 5, 11, 6, 6, 2, 2, 4, 5, 3, 0, 11, 15, 10, 6, 12, 8, 8, 2, 4, 4, 6, 5, 1, 1, 1, 1, 3, 0, 13, 23, 13, 10, 14
Offset: 0

Views

Author

Scott R. Shannon, Oct 10 2021

Keywords

Comments

This is a variation of A342585. The same rules apply except that each number, as it iterates from counting zeros to counting the next number until zero occurrences are found, is treated as a string. The number of occurrences of this string is counted in the concatenation of all previous terms which is also treated as a string. For example when the sequence is adding the number of occurrences of 10, this is treated as the string '10', and thus any occurrence of '10' in the concatenation of all previous terms is counted. This would therefore count the term 1 followed by 0 as an occurrence of '10'. The strings are allowed to overlap, e.g., the number '111' would increment the count of 1's three times, the count of 11's two times, and the count of 111's one time.
Counting the occurrences of each number treated as a string leads to many more terms being found before a zero term is recorded. For example the iteration spanning the 5 millionth term has a(4989084) = 0, a(4989085) = 1059723, then a(5019089) = 2, a(5019090) = 0. Therefore at this stage every number, treated as a string, from 0 to 30005 has occurred at least once in the concatenation of all previous terms.
Unlike A342585 the number of occurrences of the smaller values does not seem to change order as n gets larger. After 5 million terms the order of most frequent occurrences is 1,2,3,4,5,6,7,8,9,0,11,12,10,21,13,14,15,16. It is unlikely the single-digit order changes although, considering that 21 appears high on the count for 2-digit numbers, the order of these and other 2-digit values may change as n gets larger. See the linked image.

Examples

			a(56) = 4. This is the first term that differs from A342585 as in that sequence no 10's have occurred after 55 terms. However in this sequence '10' can be formed by '1' followed by '0', and in the concatenation of terms a(0) to a(55) that has occurred four times, starting as a(2), a(12), a(26), a(35).
		

Crossrefs

Programs

  • Python
    def count_overlaps(subs, s):
        c = i = 0
        while i != -1:
            i = s.find(subs, i)
            if i != -1: c += 1; i += 1
        return c
    def aupton(terms):
        alst, astr, numtocount = [0], "0", 0
        for n in range(2, terms+1):
            c = count_overlaps(str(numtocount), astr)
            numtocount = 0 if c == 0 else numtocount + 1
            alst.append(c)
            astr += str(c)
        return alst
    print(aupton(95)) # Michael S. Branicky, Oct 10 2021

A362372 Inventory of powers. Initialize the sequence with '1'. Then record the number of powers of 1 thus far, then do the same for powers of 2 (2, 4, 8, ...), powers of 3, etc. When the count is zero, do not record a zero; rather start the inventory again with the powers of 1.

Original entry on oeis.org

1, 1, 2, 1, 3, 1, 1, 5, 1, 1, 7, 1, 1, 9, 1, 2, 10, 2, 2, 10, 4, 2, 1, 1, 12, 6, 2, 1, 1, 1, 1, 16, 8, 2, 2, 1, 1, 1, 1, 1, 2, 21, 12, 2, 2, 1, 1, 1, 1, 1, 2, 26, 15, 2, 2, 1, 1, 1, 1, 1, 2, 31, 18, 2, 2, 1, 1, 1, 1, 1, 2, 36, 21, 2, 2, 1, 2, 1, 1, 1
Offset: 0

Views

Author

Damon Lay, Apr 17 2023

Keywords

Comments

A variant of the inventory sequence, A342585.
The graph exhibits sharp jumps followed by a rapid decline forming a periodic hockey stick pattern. Larger-scale, near-linear structures also appear.
Periodic patterns in the relative frequency of any given number also are present. For example, perform a rolling count of the number of times 2 appears in the previous 40 entries.
Open question: will all positive integers appear in the sequence?

Examples

			As an irregular triangle, the table begins:
   1;
   1;
   2, 1;
   3, 1, 1;
   5, 1, 1;
   7, 1, 1;
   9, 1, 2;
  10, 2, 2;
  10, 4, 2, 1, 1;
  12, 6, 2, 1, 1, 1, 1;
  16, 8, 2, 2, 1, 1, 1, 1, 1, 2;
  ...
Initialize the sequence with '1'.
Powers of 1 are counted in the first column, powers of 2 in the second, powers of 3 in the third, etc.
		

Crossrefs

Cf. A342585 and similar variants thereof: A345730, A347791, A348218, A352799, A353092.

Programs

  • Python
    from collections import Counter
    from sympy import divisors, perfect_power
    def powers_in(n):
        t = perfect_power(n) # False for n == 1
        return [n] if not t else [t[0]**d for d in divisors(t[1])]
    def aupton(nn):
        num, alst, inventory = 1, [1], Counter([1])
        while len(alst) <= nn:
            c = inventory[num]
            if c == 0: num = 1
            else: num += 1; alst.append(c); inventory.update(powers_in(c))
        return alst
    print(aupton(100)) # Michael S. Branicky, May 05 2023

A383967 Inventory sequence recording number of terms with 1,2,3,... decimal digits. Count until occurrence of a term = 0, whereupon reset the count; continue.

Original entry on oeis.org

0, 1, 0, 3, 0, 5, 0, 7, 0, 9, 0, 11, 1, 0, 13, 2, 0, 15, 3, 0, 17, 4, 0, 19, 5, 0, 21, 6, 0, 23, 7, 0, 25, 8, 0, 27, 9, 0, 29, 10, 0, 30, 12, 0, 31, 14, 0, 32, 16, 0, 33, 18, 0, 34, 20, 0, 35, 22, 0, 36, 24, 0, 37, 26, 0, 38, 28, 0, 39, 30, 0, 40, 32, 0, 41, 34
Offset: 1

Views

Author

David James Sycamore, May 16 2025

Keywords

Examples

			a(1) = 0 because at first there are no terms with just one decimal digit. Following a zero term the count is reset and now since there is one term (a(1) = 0) with just one digit, a(2) = 1. Since there are no terms with two digits a(3) = 0. The count resets again and a(4) = 3 because there are now three terms (0,1,0) which have only one digit. Since there are no terms with two digits a(5) = 0.
The sequence continues 0,1,0,3,0,5,0,7,0,9,0 and at this point we have 11 terms with one digit then one term (11) with two digits, so the next two terms are 11,1 followed by 0 since there is not yet a term with three digits; and so on.
		

Crossrefs

Programs

  • Mathematica
    nn = 120; q[] := 0; f[x] := If[x == 0, 1, IntegerLength[x]]; j = 0; c = 1; q[1]++; {j}~Join~Reap[Do[If[j == 0, c = 1]; j = Sow[q[c]]; c++; q[f[j]]++, nn - 1] ][[-1, 1]] (* Michael De Vlieger, Jun 01 2025 *)
Showing 1-6 of 6 results.