OFFSET
0,6
COMMENTS
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.
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.
LINKS
Michael De Vlieger, Table of n, a(n) for n = 0..10000
Scott R. Shannon, Image of the first 20 million terms.
EXAMPLE
a(2) = 1 as there is one pair that sums to a(0) + a(1) = 0, namely a(0) + a(1).
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).
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).
MATHEMATICA
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 *)
PROG
(Python)
def A364027_gen(): # generator of terms
a, b, ndict = 0, 0, {0:1}
yield from (0, 0)
while True:
a, b = b, ndict[a+b]
yield b
ndict[a+b] = ndict.get(a+b, 0)+1 # Chai Wah Wu, Jul 02 2023
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Scott R. Shannon, Jul 01 2023
STATUS
approved