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 A364036 #14 Jul 02 2023 20:27:13 %S A364036 0,0,0,1,0,1,2,0,0,2,1,1,2,2,0,3,3,0,4,1,0,3,5,0,1,4,2,1,6,0,2,4,3,1, %T A364036 2,7,0,2,5,3,1,3,4,4,2,4,5,1,6,5,0,3,8,1,2,9,2,3,4,6,0,7,7,0,8,3,4,9, %U A364036 0,3,10,1,5,8,2,1,11,0,6,9,0,4,5,5,2,10,1,7,4,8,2,3,5,5,4,6,5,9 %N A364036 a(0) = 0, a(1) = 0; for n > 1, a(n) is the number of pairs of consecutive terms prior to a(n-1) that sum to the same value as a(n-2) + a(n-1). %C A364036 The same number cannot occur four times in a row as the second pair in a triplet of the same numbers increments the appearance count of the first pair by one, so the fourth number is always one more than the previous three numbers. %C A364036 The occurrences of three consecutive equal numbers is quite rare, only occurring thirteen times in the first 20 million terms. The last such triplet is a(3620001) = a(3620002) = a(3620003) = 1159. It is likely such triplets occur infinitely often although this is unknown. %H A364036 Michael De Vlieger, <a href="/A364036/b364036.txt">Table of n, a(n) for n = 0..10000</a> %H A364036 Scott R. Shannon, <a href="/A364036/a364036.png">Image of the first 20 million terms</a>. %e A364036 a(2) = 0 as there are no previous pairs prior to a(1). %e A364036 a(3) = 1 as a(1) + a(2) = 0 + 0 = 0, and there has been one previous pair that also sums to 0, namely a(0) + a(1). %e A364036 a(6) = 2 as a(4) + a(5) = 0 + 1 = 1, and there has been two previous pairs that also sums to 1, namely a(2) + a(3) and a(3) + a(4). %t A364036 nn = 120; c[_] := 0; a[0] = a[1] = i = j = 0; Do[Set[k, c[i + j]++]; i = j; j = a[n] = k, {n, 2, nn}]; Array[a, nn + 1, 0] (* _Michael De Vlieger_, Jul 02 2023 *) %o A364036 (Python) %o A364036 def A364036_gen(): # generator of terms %o A364036 a, b, ndict = 0, 0, {0:1} %o A364036 while True: %o A364036 a, b = b, ndict[a+b] %o A364036 yield b-1 %o A364036 ndict[a+b] = ndict.get(a+b,0)+1 # _Chai Wah Wu_, Jul 02 2023 %Y A364036 Cf. A364027 (include previous pair), A342585, A347062. %K A364036 nonn,look %O A364036 0,7 %A A364036 _Scott R. Shannon_, Jul 02 2023