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.
%I A348967 #13 Nov 24 2021 01:25:11 %S A348967 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, %T A348967 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, %U A348967 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 %N 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. %C A348967 This sequence is a variation of A342585. Here we record the number of previous occurrences of the pair differences of all adjacent terms until 0 is recorded, after which the pair difference count restarts at 0. For example the terms 0,0,2,1,3 contain one pair with a difference of 0 (0,0), one pair with a difference of 1 (2,1), and two pairs with a difference of 2 (0,2 and 1,3). See the Examples below. %C A348967 After 20 million terms the largest term is a(19995157) = 2537781, which counts the occurrences of pairs with a difference of 1, while there are 5725 terms between zeros. It is likely the most common pair difference remains at 1 as n increases although this is unknown. %H A348967 Scott R. Shannon, <a href="/A348967/a348967.png">Image of the first 100000 terms</a>. %e A348967 a(1) = 0 as there have been no pairs so far in the sequence. %e A348967 a(2) = 1 as there has been one pair with a difference of 0: |a(1) - a(0)|. %e A348967 a(3) = 1 as there has been one pair with a difference of 1: |a(2) - a(1)|. %e A348967 a(4) = 0 as there has been no pairs with a difference of 2. The count now resets to 0. %e A348967 a(5) = 2 as there has been two pairs with a difference of 0: |a(1) - a(0)|, |a(3) - a(2)|. %e A348967 a(6) = 2 as there has been two pairs with a difference of 1: |a(2) - a(1)|, |a(4) - a(3)|. %e A348967 a(7) = 1 as there has been one pair with a difference of 2: |a(5) - a(4)|. %o A348967 (Python) %o A348967 from collections import Counter %o A348967 def aupton(terms): %o A348967 num, alst, inventory = 0, [0, 0], Counter([0]) %o A348967 for n in range(2, terms+1): %o A348967 c = inventory[num] %o A348967 num = 0 if c == 0 else num + 1 %o A348967 alst.append(c) %o A348967 inventory.update([abs(alst[-2] - alst[-1])]) %o A348967 return alst %o A348967 print(aupton(93)) # _Michael S. Branicky_, Nov 05 2021 %Y A348967 Cf. A342585, A348966 (pair sums). %K A348967 nonn %O A348967 0,6 %A A348967 _Scott R. Shannon_, Nov 05 2021