A108804 Self-convolution of A010060 (Thue-Morse sequence).
0, 0, 1, 2, 1, 2, 2, 0, 3, 4, 2, 2, 4, 2, 3, 8, 3, 4, 6, 2, 6, 6, 5, 8, 6, 4, 7, 10, 5, 10, 10, 0, 11, 12, 6, 10, 10, 6, 9, 16, 8, 8, 13, 10, 11, 14, 12, 8, 14, 12, 11, 18, 11, 14, 16, 8, 15, 20, 14, 10, 20, 10, 11, 32, 11, 12, 22, 10, 18, 22, 17, 16, 20, 16, 17, 26, 15, 22, 24, 8, 24, 24, 17
Offset: 0
Keywords
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 0..10000
Programs
-
Haskell
a108804 n = a108804_list !! n a108804_list = f [head a010060_list] $ tail a010060_list where f xs (z:zs) = (sum $ zipWith (*) xs (reverse xs)) : f (z : xs) zs -- Reinhard Zumkeller, Sep 14 2014
-
Mathematica
Table[Sum[ThueMorse[k]*ThueMorse[n-k], {k, 0, n}], {n, 0, 85}] (* G. C. Greubel, Apr 03 2019 *)
-
PARI
a(n)=sum(k=0,n,(subst(Pol(binary(k)),x,1)%2)*(subst(Pol(binary(n-k)),x,1)%2)) /* Ralf Stephan, Aug 23 2013 */
-
PARI
{a(n)=sum(k=0,n, (hammingweight(k)*hammingweight(n-k))%2)}; vector(85, n, n--; a(n)) \\ G. C. Greubel, Apr 03 2019
-
Sage
[sum(sloane.A010060(k)*sloane.A010060(n-k) for k in (0..n)) for n in (0..85)] # G. C. Greubel, Apr 03 2019
Formula
a(2n+1) = (1/2) * (A115384(n) - 2a(n)). - Ralf Stephan, Aug 23 2013
G.f.: (1/4)*(1/(1 - x) - Product_{k>=0} (1 - x^(2^k)))^2. - Ilya Gutkovskiy, Apr 03 2019