login
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).
4
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, 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, 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
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
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
Cf. A364036 (do not include previous pair), A342585, A347062.
Sequence in context: A374443 A362890 A306251 * A308967 A241844 A233864
KEYWORD
nonn,look
AUTHOR
Scott R. Shannon, Jul 01 2023
STATUS
approved