login
a(n) = t(n)*a(n-1) + a(n-2) for n>1 where t(n) is the Prouhet-Thue-Morse sequence A106400 with a(0)=0 and a(1)=1.
1

%I #12 Oct 09 2021 04:23:14

%S 0,1,-1,0,-1,-1,-2,1,-3,-2,-5,3,-2,5,-7,-2,-5,-7,-12,5,-7,12,-19,-7,

%T -26,19,-45,-26,-19,-45,-64,19,-83,-64,-147,83,-64,147,-211,-64,-275,

%U 211,-486,-275,-211,-486,-697,211,-486,697,-1183,-486,-697,-1183,-1880,697

%N a(n) = t(n)*a(n-1) + a(n-2) for n>1 where t(n) is the Prouhet-Thue-Morse sequence A106400 with a(0)=0 and a(1)=1.

%H Michel Marcus, <a href="/A348112/b348112.txt">Table of n, a(n) for n = 0..1000</a>

%H Eryk Lipka and Maciej Ulas, <a href="https://arxiv.org/abs/2109.15243">A Fibonacci type sequence with Prouhet-Thue-Morse coefficients</a>, arXiv:2109.15243 [math.NT], 2021.

%t a[0] = 0; a[1] = 1; a[n_] := a[n] = (-1)^DigitCount[n, 2, 1]*a[n - 1] + a[n - 2]; Array[a, 50, 0] (* _Amiram Eldar_, Oct 01 2021 *)

%o (PARI) t(n) = (-1)^hammingweight(n); \\ A106400

%o lista(nn) = {my(va = vector(nn)); va[1] = 1; va[2] = -1; for (n=3, nn, va[n] = t(n)*va[n-1] + va[n-2];); concat(0, va);}

%Y Cf. A000045, A106400.

%K sign

%O 0,7

%A _Michel Marcus_, Oct 01 2021