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).
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, 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, 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
Offset: 0
Examples
a(2) = 0 as there are no previous pairs prior to a(1). 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). 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).
Links
- Michael De Vlieger, Table of n, a(n) for n = 0..10000
- Scott R. Shannon, Image of the first 20 million terms.
Programs
-
Mathematica
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 *)
-
Python
def A364036_gen(): # generator of terms a, b, ndict = 0, 0, {0:1} while True: a, b = b, ndict[a+b] yield b-1 ndict[a+b] = ndict.get(a+b,0)+1 # Chai Wah Wu, Jul 02 2023
Comments