OFFSET
0,2
COMMENTS
For n>=1, a(n) is equal to the number of functions f:{1,2...,n}->{1,2,3,4,5,6,7,8,9} such that for a fixed x in {1,2,...,n} and a fixed y in {1,2,3,4,5,6,7,8,9} we have f(x)<>y. - Aleksandar M. Janjic and Milan Janjic, Mar 27 2007
a(n) is the number of compositions of n when there are 8 types of each natural number. - Milan Janjic, Aug 13 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 (9).
FORMULA
G.f.: (1-x)/(1-9x).
a(n) = 8*9^(n-1); a(0)=1.
a(n) = 9a(n-1) + (-1)^n*C(1,1-n).
E.g.f.: (1 + 8*exp(9*x))/9. - G. C. Greubel, Mar 16 2020
MAPLE
1, seq(8*9^(n-1), n=1..25); # G. C. Greubel, Mar 16 2020
MATHEMATICA
q = 9; Join[{a = 1}, Table[If[n == 0, a = q*a - 1, a = q*a], {n, 0, 25}]] (* Vladimir Joseph Stephan Orlovsky, Jul 11 2011 *)
Join[{1}, NestList[9#&, 8, 30]] (* Harvey P. Dale, Aug 23 2024 *)
PROG
(PARI) a(n)=if(n, 8*9^(n-1), 1) \\ Charles R Greathouse IV, Oct 07 2015
(Magma) [1] cat [8*9^(n-1): n in [1..25]]; // G. C. Greubel, Mar 16 2020
(Sage) [1]+[8*9^(n-1) for n in (1..25)] # G. C. Greubel, Mar 16 2020
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Barry E. Williams, May 28 2000
STATUS
approved