Kolakoski Sequence
Public  11/29/17  12xp  Math  100.0% 
Let $K(a, b)$ be the infinite sequence such that:
 The first element is $a$,
 It consists of $a$ and $b$, and
 Its run length sequence is equal to $K(a, b)$.
Here, for example, we assume that the run length sequence of $[1, 1, 1, 2, 3, 4, 4, 5]$ is $[3, 1, 1, 2, 1]$.
We can verify that
 $K(2, 3) = [2, 2, 3, 3, 2, 2, 2, 3, 3, 3, 2, \ldots]$, and
 $K(2, 4) = [2, 2, 4, 4, 2, 2, 2, 2, 4, 4, 4, 4, 2, \ldots]$.
Let $C_{a,b}(N)$ be the number of $a$ in the first $N$ elements of $K(a, b)$.
For example, $C_{2, 4}(4) = 2$ and $C_{2, 4}(5)$ = 3.
Let $S(M, N) := \sum_{a=2}^{M1} \sum_{b=a+1}^{M} C_{a, b}(N)$.
You are given $S(5, 100) = 300$ and $S(10, 10^6) = 17856847$.
Find $S(100, 10^{15})$.
New Members
 WildChild 4d:9h
 andresporras 5d:14h
 maggch 1w:1d
 RoniZeng 1w:1d
 stiwar 1w:3d
Fresh Problems

Generalized ellipse 1 3d:18h
solved by 6 
Machin Like Formulae 1w:6d
solved by 2 
Kolakoski Sequence 2w:1d
solved by 1 
A big sum 2 2w:3d
solved by 6 
Broken DNA 2w:6d
solved by 8