login
a(n) = n^2 if n is odd, n^2*2^(n-2) if n is even.
1

%I #33 Sep 08 2022 08:45:48

%S 0,1,4,9,64,25,576,49,4096,81,25600,121,147456,169,802816,225,4194304,

%T 289,21233664,361,104857600,441,507510784,529,2415919104,625,

%U 11341398016,729,52613349376,841,241591910400,961,1099511627776,1089,4964982194176,1225

%N a(n) = n^2 if n is odd, n^2*2^(n-2) if n is even.

%C This is the main diagonal of the following array defined by T(n,2k+1) = A168077(k) for odd column indices and T(n,2k) = A168077(2k)*2^n for even column indices:

%C 0, 1, 1, 9, 4, 25, ... A168077

%C 0, 1, 2, 9, 8, 25, ... A129194

%C 0, 1, 4, 9, 16,25, ... A000290

%C 0, 1, 8, 9, 32,25, ...

%C 0, 1, 16,9, 64,25, ... A154615

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

%H <a href="/index/Rec#order_12">Index entries for linear recurrences with constant coefficients</a>, signature (0, 15, 0, -87, 0, 245, 0, -348, 0, 240, 0, -64).

%F a(2n) = A128782(n). a(2n+1) = A016754(n).

%F a(n) = +15*a(n-2) -87*a(n-4) +245*a(n-6) -348*a(n-8) +240*a(n-10) - 64*a(n-12).

%F G.f.: x*(1 + 4*x - 6*x^2 + 4*x^3 - 23*x^4 - 36*x^5 + 212*x^6 + 44*x^7 - 336*x^8 - 16*x^9 - 64*x^10) / ( (1-x)^3*(2*x+1)^3*(1-2*x)^3*(1+x)^3 ). - _R. J. Mathar_, Sep 20 2011

%F a(n) = (n^2)*2^((n-2)*(1+(-1)^n)/2). - _Luce ETIENNE_, Feb 03 2015

%p A168251 := proc(n)

%p if type(n,'even') then

%p n^2*2^n/4 ;

%p else

%p n^2 ;

%p end if;

%p end proc: # _R. J. Mathar_, Sep 20 2011

%t Table[(n^2)*2^((n - 2)*(1 + (-1)^n)/2), {n, 0, 50}] (* _G. C. Greubel_, Jul 16 2016 *)

%t Table[If[OddQ[n],n^2,n^2 2^(n-2)],{n,0,50}] (* or *) LinearRecurrence[{0,15,0,-87,0,245,0,-348,0,240,0,-64},{0,1,4,9,64,25,576,49,4096,81,25600,121},41] (* _Harvey P. Dale_, May 14 2022 *)

%o (Magma) [(n^2)*2^((n-2)*(1+(-1)^n) div 2): n in [0..40]]; // _Vincenzo Librandi_, Jul 17 2016

%K nonn,easy

%O 0,3

%A _Paul Curtz_, Nov 21 2009