login
Alternating sum of digits of the Fibonacci numbers, with a plus sign for the last digit.
1

%I #17 Jan 03 2024 19:15:23

%S 0,1,1,2,3,5,8,2,-1,1,0,1,1,2,3,5,8,2,-1,-10,0,12,1,2,3,5,-3,13,-1,1,

%T -11,1,12,2,3,5,-3,13,10,1,0,1,-10,13,3,-17,19,-9,10,1,0,1,12,13,3,-6,

%U 8,2,-1,-10,0,1,12,-9,3,5,-3,-9,-23,1,-22,34,-10,2

%N Alternating sum of digits of the Fibonacci numbers, with a plus sign for the last digit.

%C a(n) mod 11 = F(n) mod 11 = A105955(n). This is the mod 11 rule applied to F(n) = A000045.

%H Alois P. Heinz, <a href="/A362358/b362358.txt">Table of n, a(n) for n = 0..10000</a>

%F Let [f_s(n), f_{s(n)-1}, ..., f_0] be the list of digits of F(n) = A000040(n) with s(n) = A060384(n) - 1, then a(n) = Sum_{j=0..s(n)} (-1)^j*f_j.

%F a(n) = A055017(A000045(n)), for n >= 0.

%e F(17) = 1597, s(n) = 4 - 1 = 3, a(17) = 7 - 9 + 5 - 1 = 2.

%t a[n_]:=Sum[(-1)^(IntegerLength[Fibonacci[n]]-i) Part[IntegerDigits[Fibonacci[n]],i],{i,IntegerLength[Fibonacci[n]]}]; Array[a,66,0] (* _Stefano Spezia_, May 27 2023 *)

%o (PARI) a(n) = my(d=Vecrev(digits(fibonacci(n)))); sum(k=1, #d, (-1)^(k+1)*d[k]); \\ _Michel Marcus_, May 28 2023

%Y Cf. A000045, A004090, A007887, A055017, A060384, A105955.

%K sign,base,look,easy

%O 0,4

%A _Wolfdieter Lang_, May 26 2023