OFFSET
0,4
COMMENTS
Considering the terms modulo 100, the sequence becomes periodic with period 40 after the first 9 terms. The period is the same as in A345095, where it starts only after the first 32 terms. This property leads to a first-order recurrence and an explicit formula for a(n), see Formula section.
Differs from the Fibonacci sequence A000045 from a(8) = 4 on.
Starting with a(9) = 13, every other term a(2k-1) has at least two digits, so the next term a(2k) is equal to the sum of the last two digits of a(2k-1).
Similarly, the graph of this sequence has two components: even-indexed terms repeating the pattern [8, 7, 5, 10, 11, 13, 8, 16, 14, 9, ..., 9, 18] of length 20, and odd-indexed terms evolving around the straight line y(n) = 5n - 32.25, with first differences equal to the even-indexed terms.
LINKS
Eric Angelini, Fibonacci alternated, math-fun discussion list on xmission.com, Jul 04 2021
Index entries for linear recurrences with constant coefficients, signature (0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, -1).
FORMULA
a(n+1) = a(n) + a(n-1) if n is even or n < 6, = a(n)%10 + floor(a(n)/10)%10 if n is odd and n > 6, where % is the binary modulo (or remainder) operator.
a(n+40) = a(n) for even n > 9, a(n+40) = a(n) + 200 for odd n >= 9, hence:
a(n) = a((n-9)%40 + 9) + [floor((n-9)/40)*200 if n odd] for n >= 9, giving any term explicitly in terms of a(0..48).
a(n) = a(n-2) + a(n-40) - a(n-42) for n >= 51.
O.g.f.: x*(Sum_{k=0..49} c_k x^k)/(1 - x^2 - x^40 + x^42), where c = (1, 1, 1, 2, 3, 5, 8, -4, 4, 4, 8, -1, 7, -2, 5, 5, 10, 1, 11, 2, 13, -5, 8, 8, 16, -2, 14, -5, 9, 0, 9, 0, 9, 0, 9, 0, 9, 0, 9, 0, 8, -1, 8, -2, 6, -5, 1, 13, 14, -14).
EXAMPLE
Up to a(7) = 13, we have the Fibonacci sequence A000045. Then:
a(8) = 1 + 3 = 4 is the sum of the two preceding digits: those of a(7).
a(9) = 13 + 4 = 17 is the sum of the two preceding terms, a(7) + a(8).
a(10) = 1 + 7 = 8 is the sum of the two preceding digits: those of a(9).
a(11) = 17 + 8 = 25 is the sum of the two preceding terms, a(9) + a(10),
and so on.
MATHEMATICA
a[0]=0; a[1]=a[2]=1; a[n_]:=a[n]=If[OddQ@n, a[n-1]+a[n-2], Total[Flatten[IntegerDigits/@Array[a, n-1]][[-2;; ]]]]; Array[a, 100, 0] (* Giorgos Kalogeropoulos, Jun 08 2021 *)
PROG
(PARI) A345097_vec(N=99, a=List([0, 1]))={ for(n=2, N, listput(a, if(n%2 || a[n]<10, a[n-1]+a[n], sumdigits(a[n]%100)))); Vec(a)} \\ Compute the vector a(0..N)
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
M. F. Hasler and Eric Angelini, Jun 07 2021
EXTENSIONS
Definition amended by Georg Fischer, Aug 08 2023
STATUS
approved