login
Expansion of g.f.: (1+x)/(1-21*x).
50

%I #29 Sep 08 2022 08:45:49

%S 1,22,462,9702,203742,4278582,89850222,1886854662,39623947902,

%T 832102905942,17474161024782,366957381520422,7706105011928862,

%U 161828205250506102,3398392310260628142,71366238515473190982,1498691008824937010622,31472511185323677223062,660922734891797221684302

%N Expansion of g.f.: (1+x)/(1-21*x).

%H Kenny Lau, <a href="/A170741/b170741.txt">Table of n, a(n) for n = 0..756</a>

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

%F a(n) = Sum_{k=0..n} A097805(n,k)*(-1)^(n-k)*22^k. - _Philippe Deléham_, Dec 04 2009

%F a(0) = 1; for n>0, a(n) = 22*21^(n-1). - _Vincenzo Librandi_, Dec 05 2009

%F E.g.f.: (22*exp(21*x) - 1)/21. - _G. C. Greubel_, Sep 25 2019

%p k:=22; seq(`if`(n=0, 1, k*(k-1)^(n-1)), n = 0..25); # _G. C. Greubel_, Sep 25 2019

%t Join[{1}, 22*21^Range[0, 25]] (* _Vladimir Joseph Stephan Orlovsky_, Jul 13 2011 *)

%t Join[{1},NestList[21#&,22,20]] (* _Harvey P. Dale_, Jul 29 2018 *)

%o (Python) for i in range(31):print(i,22*21**(i-1) if i>0 else 1) # _Kenny Lau_, Aug 01 2017

%o (PARI) vector(26, n, k=22; if(n==1, 1, k*(k-1)^(n-2))) \\ _G. C. Greubel_, Sep 25 2019

%o (Magma) k:=22; [1] cat [k*(k-1)^(n-1): n in [1..25]]; // _G. C. Greubel_, Sep 25 2019

%o (Sage) k=22; [1]+[k*(k-1)^(n-1) for n in (1..25)] # _G. C. Greubel_, Sep 25 2019

%o (GAP) k:=22;; Concatenation([1], List([1..25], n-> k*(k-1)^(n-1) )); # _G. C. Greubel_, Sep 25 2019

%Y Cf. A003945.

%K nonn,easy

%O 0,2

%A _N. J. A. Sloane_, Dec 04 2009