OFFSET
0,2
COMMENTS
First differences of A005054.
For n>=2, a(n) is equal to the number of functions f:{1,2,...,n}->{1,2,3,4,5} such that for fixed, different x_1, x_2 in {1,2,...,n} and fixed y_1, y_2 in {1,2,3,4,5} we have f(x_1)<>y_1 and f(x_2)<> y_2. - Milan Janjic, Apr 19 2007
a(n) is the number of generalized compositions of n when there are 4 *i-1 different types of i, (i=1,2,...). - Milan Janjic, Aug 26 2010
REFERENCES
A. H. Beiler, Recreations in the Theory of Numbers, Dover, N.Y., 1964, pp. 194-196.
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Milan Janjic, Enumerative Formulas for Some Functions on Finite Sets
Index entries for linear recurrences with constant coefficients, signature (5).
FORMULA
a(n) = 16*5^(n-2), a(0)=1, a(1)=3.
a(n) = 5*a(n-1) + (-1)^n*binomial(2,2-n).
G.f.: (1-x)^2/(1-5*x).
a(n) = Sum_{k=0..n} A201780(n,k)*3^k. - Philippe Deléham, Dec 05 2011
E.g.f.: (9 - 5*x + 16*exp(x))/25. - G. C. Greubel, Jan 21 2020
MAPLE
seq( `if`(n<2, 2*n+1, 16*5^(n-2)), n=0..30); # G. C. Greubel, Jan 21 2020
MATHEMATICA
Join[{1, 3}, 16 5^(Range[2, 30]-2)] (* Harvey P. Dale, Apr 03 2013 *)
PROG
(PARI) Vec((1-x)^2/(1-5*x) + O(x^30)) \\ Altug Alkan, Mar 13 2016
(Magma) [1, 3] cat [16*5^(n-2): n in [2..30]]; // G. C. Greubel, Jan 21 2020
(Magma) R<x>:=PowerSeriesRing(Rationals(), 25); Coefficients(R!( (1-x)^2/(1-5*x))); // Marius A. Burtea, Jan 21 2020
(Sage) [1, 3]+[16*5^(n-2) for n in (2..30)] # G. C. Greubel, Jan 21 2020
(GAP) Concatenation([1, 3], List([2..30], n-> 16*5^(n-2) )); # G. C. Greubel, Jan 21 2020
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Barry E. Williams, May 30 2000
STATUS
approved