login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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). 3

%I #14 Jul 02 2023 20:27:13

%S 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 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 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 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 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 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 Michael De Vlieger, <a href="/A364036/b364036.txt">Table of n, a(n) for n = 0..10000</a>

%H Scott R. Shannon, <a href="/A364036/a364036.png">Image of the first 20 million terms</a>.

%e a(2) = 0 as there are no previous pairs prior to a(1).

%e 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 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 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 (Python)

%o def A364036_gen(): # generator of terms

%o a, b, ndict = 0, 0, {0:1}

%o while True:

%o a, b = b, ndict[a+b]

%o yield b-1

%o ndict[a+b] = ndict.get(a+b,0)+1 # _Chai Wah Wu_, Jul 02 2023

%Y Cf. A364027 (include previous pair), A342585, A347062.

%K nonn,look

%O 0,7

%A _Scott R. Shannon_, Jul 02 2023

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 2 12:00 EDT 2024. Contains 375613 sequences. (Running on oeis4.)