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 A348966 #23 Nov 24 2021 01:02:09 %S A348966 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, %T A348966 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, %U A348966 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 %N 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. %C A348966 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. %C A348966 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. %H A348966 Scott R. Shannon, <a href="/A348966/a348966.png">Image of the first 1 million terms</a>. %e A348966 a(1) = 0 as there have been no pairs so far in the sequence. %e A348966 a(2) = 1 as there has been one pair that sums to 0: a(0) + a(1). %e A348966 a(3) = 1 as there has been one pair that sums to 1: a(1) + a(2). %e A348966 a(4) = 1 as there has been one pair that sums to 2: a(2) + a(3). %e A348966 a(5) = 0 as there have been no pairs that sum to 3. The count now resets to 0. %e A348966 a(6) = 1 as there has been one pair that sums to 0: a(0) + a(1). %e A348966 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). %o A348966 (Python) %o A348966 from collections import Counter %o A348966 def aupton(terms): %o A348966 num, alst, inventory = 0, [0, 0], Counter([0]) %o A348966 for n in range(2, terms+1): %o A348966 c = inventory[num] %o A348966 num = 0 if c == 0 else num + 1 %o A348966 alst.append(c) %o A348966 inventory.update([alst[-2] + alst[-1]]) %o A348966 return alst %o A348966 print(aupton(97)) # _Michael S. Branicky_, Nov 05 2021 %Y A348966 Cf. A342585, A348967 (pair differences), A000045. %K A348966 nonn,look %O A348966 0,8 %A A348966 _Scott R. Shannon_, Nov 05 2021