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-2 of 2 results.

A348966 Variation on the Inventory Sequence A342585: record the number of occurrences of the pair sum of all adjacent terms until 0 is recorded, then restart the count from 0. Start with a(0) = 0. See the Comments.

Original entry on oeis.org

0, 0, 1, 1, 1, 0, 1, 3, 2, 0, 1, 4, 3, 0, 1, 5, 3, 1, 2, 2, 1, 1, 1, 0, 1, 7, 5, 3, 3, 2, 2, 1, 3, 0, 1, 8, 5, 5, 5, 3, 2, 1, 4, 1, 2, 0, 1, 9, 6, 7, 5, 6, 2, 1, 5, 1, 3, 1, 2, 2, 0, 1, 10, 7, 9, 8, 6, 4, 1, 5, 1, 4, 2, 2, 2, 1, 1, 1, 2, 0, 1, 11, 10, 11, 10, 8, 7, 1, 6, 1, 4, 2, 3, 2, 1, 2, 1, 2
Offset: 0

Views

Author

Scott R. Shannon, Nov 05 2021

Keywords

Comments

This sequence is a variation of A342585. Here we record the number of previous occurrences of the pair sum of all adjacent terms until 0 is recorded, after which the pair sum count restarts at 0. For example the terms 0,0,1,1,1 contain one pair that sums to 0 (0,0), one pair that sums to 1 (0,1), and two pairs that sum to 2 (1,1 and 1,1). See the Examples below.
After 20 million terms the largest term is a(19997365) = 512758, which counts the occurrences of pairs that sum to 15, while there are 13766 terms between zeros. It is likely the most common sum increases to arbitrarily large values as n->infinity.

Examples

			a(1) = 0 as there have been no pairs so far in the sequence.
a(2) = 1 as there has been one pair that sums to 0: a(0) + a(1).
a(3) = 1 as there has been one pair that sums to 1: a(1) + a(2).
a(4) = 1 as there has been one pair that sums to 2: a(2) + a(3).
a(5) = 0 as there have been no pairs that sum to 3. The count now resets to 0.
a(6) = 1 as there has been one pair that sums to 0: a(0) + a(1).
a(7) = 3 as there have been three pairs that sum to 1: a(1) + a(2), a(4) + a(5), a(5) + a(6).
		

Crossrefs

Cf. A342585, A348967 (pair differences), A000045.

Programs

  • Python
    from collections import Counter
    def aupton(terms):
        num, alst, inventory = 0, [0, 0], Counter([0])
        for n in range(2, terms+1):
            c = inventory[num]
            num = 0 if c == 0 else num + 1
            alst.append(c)
            inventory.update([alst[-2] + alst[-1]])
        return alst
    print(aupton(97)) # Michael S. Branicky, Nov 05 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
Showing 1-2 of 2 results.