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 A364027 #17 Apr 04 2025 10:21:45 %S A364027 0,0,1,1,1,2,1,2,3,1,1,3,2,2,3,3,1,4,4,1,5,2,1,4,6,1,2,5,3,2,7,1,3,5, %T A364027 4,2,3,8,1,3,6,4,2,4,5,5,3,5,6,2,7,6,1,4,9,2,3,10,3,4,5,7,1,8,8,1,9,4, %U A364027 5,10,1,4,11,2,6,9,3,2,12,1,7,10,1,5,6,6,3,11,2,8,5,9,3,4,6,6,5 %N A364027 a(0) = 0, a(1) = 0; for n > 1, a(n) is the number of pairs of consecutive terms that sum to the same value as a(n-2) + a(n-1). %C A364027 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 A364027 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(3641208) = a(3641209) = a(3641210) = 1177. It is likely such triplets occur infinitely often although this is unknown. %H A364027 Michael De Vlieger, <a href="/A364027/b364027.txt">Table of n, a(n) for n = 0..10000</a> %H A364027 Scott R. Shannon, <a href="/A364027/a364027_1.png">Image of the first 20 million terms</a>. %F A364027 a(n) = A306251(n-2) for any n >= 3. - _Rémy Sigrist_, Apr 03 2025 %e A364027 a(2) = 1 as there is one pair that sums to a(0) + a(1) = 0, namely a(0) + a(1). %e A364027 a(4) = 1 as a(2) + a(3) = 1 + 1 = 2, and there has been one previous pair that also sums to 2, namely a(2) + a(3). %e A364027 a(5) = 2 as a(3) + a(4) = 1 + 1 = 2, and there has been two previous pairs that also sums to 2, namely a(2) + a(3) and a(3) + a(4). %t A364027 nn = 120; c[_] := 0; a[0] = a[1] = i = j = 0; Do[Set[k, 1 + c[i + j]++]; i = j; j = a[n] = k, {n, 2, nn}]; Array[a, nn + 1, 0] (* _Michael De Vlieger_, Jul 02 2023 *) %o A364027 (Python) %o A364027 def A364027_gen(): # generator of terms %o A364027 a, b, ndict = 0, 0, {0:1} %o A364027 yield from (0,0) %o A364027 while True: %o A364027 a, b = b, ndict[a+b] %o A364027 yield b %o A364027 ndict[a+b] = ndict.get(a+b,0)+1 # _Chai Wah Wu_, Jul 02 2023 %Y A364027 Cf. A306251, A364036 (do not include previous pair), A342585, A347062. %K A364027 nonn,look %O A364027 0,6 %A A364027 _Scott R. Shannon_, Jul 01 2023