login
First differences of 9^n (A001019).
12

%I #36 Aug 23 2024 11:23:36

%S 1,8,72,648,5832,52488,472392,4251528,38263752,344373768,3099363912,

%T 27894275208,251048476872,2259436291848,20334926626632,

%U 183014339639688,1647129056757192,14824161510814728,133417453597332552,1200757082375992968,10806813741383936712,97261323672455430408,875351913052098873672

%N First differences of 9^n (A001019).

%C 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

%C a(n) is the number of compositions of n when there are 8 types of each natural number. - _Milan Janjic_, Aug 13 2010

%D A. H. Beiler, Recreations in the Theory of Numbers, Dover, N.Y., 1964, pp. 194-196.

%H G. C. Greubel, <a href="/A055275/b055275.txt">Table of n, a(n) for n = 0..1000</a>

%H Milan Janjic, <a href="http://www.pmfbl.org/janjic/">Enumerative Formulas for Some Functions on Finite Sets</a>

%H <a href="/index/Rec#order_01">Index entries for linear recurrences with constant coefficients</a>, signature (9).

%F G.f.: (1-x)/(1-9x).

%F a(n) = 8*9^(n-1); a(0)=1.

%F a(n) = 9a(n-1) + (-1)^n*C(1,1-n).

%F E.g.f.: (1 + 8*exp(9*x))/9. - _G. C. Greubel_, Mar 16 2020

%p 1, seq(8*9^(n-1), n=1..25); # _G. C. Greubel_, Mar 16 2020

%t 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 *)

%t Join[{1},NestList[9#&,8,30]] (* _Harvey P. Dale_, Aug 23 2024 *)

%o (PARI) a(n)=if(n,8*9^(n-1),1) \\ _Charles R Greathouse IV_, Oct 07 2015

%o (Magma) [1] cat [8*9^(n-1): n in [1..25]]; // _G. C. Greubel_, Mar 16 2020

%o (Sage) [1]+[8*9^(n-1) for n in (1..25)] # _G. C. Greubel_, Mar 16 2020

%Y Cf. A001019.

%K easy,nonn

%O 0,2

%A _Barry E. Williams_, May 28 2000