login
n followed by n^2.
25

%I #55 Sep 08 2022 08:44:28

%S 1,1,2,4,3,9,4,16,5,25,6,36,7,49,8,64,9,81,10,100,11,121,12,144,13,

%T 169,14,196,15,225,16,256,17,289,18,324,19,361,20,400,21,441,22,484,

%U 23,529,24,576,25,625,26,676,27,729,28,784,29,841,30,900,31,961,32,1024,33,1089,34,1156,35,1225,36,1296

%N n followed by n^2.

%C Eigensequence of a triangle with nonnegative integers interlaced with zeros (1, 0, 2, 0, 3, ...) as the right and left borders, with the rest zeros. - _Gary W. Adamson_, Aug 01 2016

%H Reinhard Zumkeller, <a href="/A000463/b000463.txt">Table of n, a(n) for n = 1..10000</a>

%H <a href="/index/Rec#order_06">Index entries for linear recurrences with constant coefficients</a>, signature (0,3,0,-3,0,1).

%F a(n) = ((((-1)^(n+1))+1)/4)(n+1) - ((((-1)^(n+1))-1)/8)n^2 - _Sam Alexander_

%F G.f.: (1+x-x^2+x^3)/((1-x)^3(1+x)^3).

%F a(n) = if(n mod 2, (n+1)/2, (n/2)^2). - _Gerald Hillier_, Sep 25 2008

%F a(n) = floor((n+1) / 2) ^ (2 - n mod 2). - _Reinhard Zumkeller_, Aug 15 2011

%F E.g.f.: (x + 2)*(sinh(x) + x*cosh(x))/4. - _Ilya Gutkovskiy_, Aug 02 2016

%e G.f. = x + x^2 + 2*x^3 + 4*x^4 + 3*x^5 + 9*x^6 + 4*x^7 + 16*x^8 + ...

%p seq(seq(n^k, k=1..2), n=1..36); # _Zerinvary Lajos_, Jun 29 2007

%t Array[{#, #^2} &, 36, 0] // Flatten

%t Riffle[Range[40], Range[40]^2] (* _Bruno Berselli_, Jul 15 2013 *)

%t a[ n_] := If[ OddQ @ n, (n + 1) / 2, n^2 / 4]; (* _Michael Somos_, May 28 2014 *)

%o (Magma) &cat[ [ n, n^2 ]: n in [1..36] ]; // _Klaus Brockhaus_, Apr 20 2009

%o (Haskell)

%o a000463 n = a000463_list !! (n-1)

%o a000463_list = concatMap (\x -> [x,x^2]) [1..]

%o -- _Reinhard Zumkeller_, Apr 13 2011

%o (PARI) {a(n) = if( n%2, (n + 1) / 2, n^2 / 4)}; /* _Michael Somos_, May 28 2014 */

%Y Cf. A188652 (first differences), A188653 (second differences), A159693 (partial sums), A000290 (squares).

%K nonn,easy,look

%O 1,3

%A _Dominick Cancilla_

%E Square of 14 corrected by _Sean A. Irvine_, Oct 25 2010