A348967 Variation on the Inventory Sequence A342585: record the number of occurrences of the pair difference of all adjacent terms until 0 is recorded, then restart the count from 0. Start with a(0) = 0. See the Comments.
0, 0, 1, 1, 0, 2, 2, 1, 0, 3, 4, 1, 2, 0, 3, 6, 2, 4, 1, 0, 3, 7, 3, 6, 3, 0, 3, 7, 3, 10, 5, 1, 0, 3, 8, 3, 11, 6, 4, 0, 3, 8, 4, 12, 8, 5, 0, 3, 8, 4, 14, 10, 7, 0, 3, 8, 4, 16, 12, 8, 0, 3, 8, 4, 17, 15, 9, 1, 2, 4, 0, 3, 9, 6, 19, 16, 9, 2, 4, 4, 0, 4, 9, 7, 20, 18, 10, 2, 4, 6, 0, 4, 9, 11
Offset: 0
Keywords
Examples
a(1) = 0 as there have been no pairs so far in the sequence. a(2) = 1 as there has been one pair with a difference of 0: |a(1) - a(0)|. a(3) = 1 as there has been one pair with a difference of 1: |a(2) - a(1)|. a(4) = 0 as there has been no pairs with a difference of 2. The count now resets to 0. a(5) = 2 as there has been two pairs with a difference of 0: |a(1) - a(0)|, |a(3) - a(2)|. a(6) = 2 as there has been two pairs with a difference of 1: |a(2) - a(1)|, |a(4) - a(3)|. a(7) = 1 as there has been one pair with a difference of 2: |a(5) - a(4)|.
Links
- Scott R. Shannon, Image of the first 100000 terms.
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([abs(alst[-2] - alst[-1])]) return alst print(aupton(93)) # Michael S. Branicky, Nov 05 2021
Comments