OFFSET
0,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (5,-7,2).
FORMULA
Length of lists created by n substitutions, in Mathematica syntax:
k -> Range[ -1-Abs[k] + MoebiusMu[Abs[k]], k + 1 + MoebiusMu[Abs[k]], 2], starting with {-1}.
Equivalent to -10 -> {-10,-8}; -9 -> {-10,-8}; -8 -> {-9,-7}; -7 -> {-9,-7}; -5 -> {-7,-5}; -3 -> {-5,-3}; -1 -> {-1,1}; 1 -> {-1,1,3}; 3 -> {-5,-3,-1,1,3}.
G.f.: (1 - 3*x + 2*x^2 + 2*x^3)/(1 - 5*x + 7*x^2 - 2*x^3).
From G. C. Greubel, Oct 15 2022: (Start)
a(n) = 5*a(n-1) - 7*a(n-2) + 2*a(n-3), for n >= 4.
a(n) = 3*ChebyshevU(n, 3/2) - 5*ChebyshevU(n-1, 3/2) - 2^n - [n=0].
a(n) = Fibonacci(2*n+1) + 2*Fibonacci(2*n-1) - 2^n - [n=0]. (End)
EXAMPLE
Length of {-1}, {-1,1}, {-1,1,-1,1,3}, {-1,1,-1,1,3,-1,1,-1,1,3,-5,-3,-1,1,3} is 1, 2, 5, 15, respectively.
MAPLE
F := n -> combinat:-fibonacci(n):
a := n -> F(2*n+1) + 2*F(2*n-1) - 2^n - ifelse(n=0, 1, 0):
seq(a(n), n = 0..29); # Peter Luschny, Oct 16 2022
MATHEMATICA
Length/@Flatten/@NestList[ # /. k_Integer:>Range[ -1-Abs[k]+MoebiusMu[Abs[k]], k+1+MoebiusMu[Abs[k]], 2]&, {-1}, 8]
(* Second program *)
LinearRecurrence[{5, -7, 2}, {1, 2, 5, 15}, 40] (* G. C. Greubel, Oct 15 2022 *)
PROG
(Magma) [1] cat [Fibonacci(2*n+1) +2*Fibonacci(2*n-1) -2^n: n in [1..40]]; // G. C. Greubel, Oct 15 2022
(SageMath) [fibonacci(2*n+1) +2*fibonacci(2*n-1) -2^n -int(n==0) for n in range(41)] # G. C. Greubel, Oct 15 2022
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Wouter Meeussen, May 11 2003
EXTENSIONS
New name using a formula of G. C. Greubel by Peter Luschny, Oct 16 2022
STATUS
approved