OFFSET
1,2
COMMENTS
The g.f. is an example of a rational function with nonnegative integer coefficients that is not N-rational.
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
Ira M. Gessel, Rational Functions With Nonnegative Integer Coefficients, slides, 50th Séminaire Lotharingien de Combinatoire, 2003.
Index entries for linear recurrences with constant coefficients, signature (-1,5,125).
FORMULA
G.f.: x*(1+5*x)/(1+x-5*x^2-125*x^3).
a(n) = A250102(n)/16.
a(n) = (1/16)*( 2*5^n - (1+2*i)^(2*n) - (1-2*i)^(2*n) ) = (1/4)*( Im(1+2*i)^n )^2 = (1/4) * 5^n * sin(n*arctan(2))^2.
From G. C. Greubel, Jan 11 2024: (Start)
a(n) = (1/8)*5^n*(1 - ChebyshevU(n, -3/5) - (3/5)*ChebyshevU(n-1, -3/5)).
a(n) = (1/8)*( 5^n - (-1)^n*A066771(n) ).
E.g.f.: (1/8)*exp(-3*x)*(exp(8*x) - cos(4*x)). (End)
MATHEMATICA
LinearRecurrence[{-1, 5, 125}, {1, 4, 1}, 40] (* G. C. Greubel, Jan 11 2024 *)
PROG
(PARI) Vec((x+5*x^2)/(1+x-5*x^2-125*x^3) + O(x^30)) \\ Michel Marcus, Aug 28 2015
(Magma) I:=[1, 4, 1]; [n le 3 select I[n] else -Self(n-1) +5*Self(n-2) +125*Self(n-3): n in [1..41]]; // G. C. Greubel, Jan 11 2024
(SageMath)
@CachedFunction
def a(n): # a = A094423
if (n<4): return (0, 1, 4, 1)[n]
else: return -a(n-1) + 5*a(n-2) + 125*a(n-3)
[a(n) for n in range(1, 41)] # G. C. Greubel, Jan 11 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Ralf Stephan, May 04 2004
STATUS
approved