A008794 Squares repeated; a(n) = floor(n/2)^2.
0, 0, 1, 1, 4, 4, 9, 9, 16, 16, 25, 25, 36, 36, 49, 49, 64, 64, 81, 81, 100, 100, 121, 121, 144, 144, 169, 169, 196, 196, 225, 225, 256, 256, 289, 289, 324, 324, 361, 361, 400, 400, 441, 441, 484, 484, 529, 529, 576, 576
Offset: 0
Links
- Vincenzo Librandi, Table of n, a(n) for n = 0..10000
- Stefano Spezia, Illustration of initial terms
- Eric Weisstein's World of Mathematics, Clique Covering Number.
- Eric Weisstein's World of Mathematics, King Graph.
- Eric Weisstein's World of Mathematics, Kings Problem.
- Index entries for sequences related to partitions
- Index entries for linear recurrences with constant coefficients, signature (1,2,-2,-1,1).
Programs
-
GAP
Flat(List([0..24],n->[n^2,n^2])); # Muniru A Asiru, Oct 09 2018
-
Magma
[(2*n-1)*(-1)^n/8+(2*n^2-2*n +1)/8: n in [0..60]]; // Vincenzo Librandi, Aug 21 2011
-
Maple
A008794:=n->floor(n/2)^2: seq(A008794(n), n=0..50); # Wesley Ivan Hurt, Dec 08 2017
-
Mathematica
With[{sq = Range[0, 30]^2}, Riffle[sq, sq]] (* Harvey P. Dale, Nov 20 2015 *) Table[Floor[n/2]^2, {n, 0, 49}] (* Michael De Vlieger, Oct 21 2016 *) Table[(2 n - 1) (-1)^n/8 + (2 n^2 - 2 n + 1)/8, {n, 0, 49}] (* Michael De Vlieger, Oct 21 2016 *) CoefficientList[Series[x^2*(1 + x^2)/((1 - x) (1 - x^2)^2), {x, 0, 49}], x] (* Michael De Vlieger, Oct 21 2016 *) CoefficientList[Series[((x^2-x)Cosh[x]+(1+x+x^2)Sinh[x])/4,{x,0,50}],x]*Table[k!,{k,0,50}] (* Stefano Spezia, Oct 07 2018 *)
-
PARI
a(n)=(n\2)^2 \\ Charles R Greathouse IV, Sep 24 2015
-
PARI
first(n) = Vec(x^2*(1 + x^2)/((1 - x)*(1 - x^2)^2) + O(x^n), -n) \\ Iain Fox, Dec 08 2017
-
Python
def A008794(n): return (n//2)**2 # Chai Wah Wu, Jun 07 2022
-
Sage
[((-1)^n*(2*n-1) +(2*n^2-2*n +1))/8 for n in (0..50)] # G. C. Greubel, Sep 11 2019
Formula
G.f.: x^2*(1 + x^2)/((1 - x)*(1 - x^2)^2).
a(n) = floor(n/2)^2.
From Paul Barry, May 31 2003: (Start)
a(n) = (2*n - 1)*(-1)^n/8 + (2*n^2 - 2*n + 1)/8.
a(n+1) = Sum_{k=0..n} k*(1-(-1)^k)/2. (End)
a(n) = A182579(n,n-2) for n > 1. - Reinhard Zumkeller, May 07 2012
a(n) = Sum_{i=1..n-1; i odd} i. - Olivier Pirson, Nov 06 2017
a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5), n > 4. - Iain Fox, Dec 08 2017
E.g.f.: ((x^2 - x)*cosh(x) + (1 + x + x^2)*sinh(x))/4. - Stefano Spezia, Oct 07 2018
Comments