cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-8 of 8 results.

A008794 Squares repeated; a(n) = floor(n/2)^2.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Also number of non-attacking kings on (n-1) X (n-1) board (cf. A030978). - Koksal Karakus (karakusk(AT)hotmail.com), May 27 2002
Also the independence number and clique covering number of the (n-1) X (n-1) king graph. - Eric W. Weisstein, Jun 20 2017
Maximum number of 2 X 2 tiles that fit on an n X n board. - Jon Perry, Aug 10 2003
(n)-(1) + (n-1)-(2) + (n-3)-(3) + ... + (n-r)-(r) ... n terms. E.g., 5-1+4-2+3 = 9, 6-1+5-2+4-3 = 9, 7-1+6-2+5-3+4 = 16, 8-1+7-2+6-3+5-4 = 16. - Amarnath Murthy, Jul 24 2005
The smallest possible number of white cells in a solution to an n X n nurikabe grid. - Tanya Khovanova, Feb 24 2009
(1 + x + 4*x^2 + 4*x^3 + 9*x^4 + ...) = (1/(1-x))*(1 + 3*x^2 + 5*x^4 + 7*x^6 + ...). - Gary W. Adamson, Apr 07 2010
If the set {1,2,...,n} is divided in half (a part having size ceiling(n/2) and the rest), then a(n+1) is the largest possible difference between the totals of these parts. - Vladimir Shevelev, Oct 14 2017
a(n+1) is the sum of the smallest parts of the partitions of 2n into two odd parts. - Wesley Ivan Hurt, Dec 06 2017
a(n-1) is the largest number of single cells of an n X n grid that share no edge or vertex with each other or those of the grid perimeter. - Stefano Spezia, Jul 30 2021
The binomial transform is 0, 0, 1, 4, 14, 44, 128, 352, 928, 2368, 5888... (see A007466). - R. J. Mathar, Feb 25 2023

Crossrefs

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+2) = Sum_{k=0..n} A109613(k)*A059841(n-k). - Reinhard Zumkeller, Dec 05 2009
a(n) = A182579(n,n-2) for n > 1. - Reinhard Zumkeller, May 07 2012
3*a(n) = A032766(n)^2 - A032766(n^2). - Bruno Berselli, Oct 21 2016
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

A097063 Expansion of (1-2*x+3*x^2)/((1+x)*(1-x)^3).

Original entry on oeis.org

1, 0, 3, 4, 9, 12, 19, 24, 33, 40, 51, 60, 73, 84, 99, 112, 129, 144, 163, 180, 201, 220, 243, 264, 289, 312, 339, 364, 393, 420, 451, 480, 513, 544, 579, 612, 649, 684, 723, 760, 801, 840, 883, 924, 969, 1012, 1059, 1104, 1153, 1200, 1251, 1300, 1353, 1404
Offset: 0

Views

Author

Paul Barry, Jul 22 2004

Keywords

Comments

Partial sums of A097062. Pairwise sums are A002061. Binomial transform is essentially A007466.

Crossrefs

A diagonal of A326296.

Programs

Formula

G.f. : (1-2*x+3*x^2)/((1-x^2)(1-x)^2).
a(n) = 2*a(n-1) - 2*a(n-3) + a(n-4).
a(n) = Sum_{k=0..n} (k^2-k+1)*(-1)^(n-k).
a(2n) = A058331(n); a(2n+1) = A046092(n). - R. J. Mathar, Oct 27 2008
a(n) = binomial(n+1, 2) - ceiling((n+1)/2) + 2((n+1) mod 2). - Wesley Ivan Hurt, Mar 08 2014
a(n) = 2*floor(n/2) + ceiling((n-1)^2/2). - M. Ryan Julian Jr., Sep 10 2019
a(n) = A326296(n + 1, n) for n > 0. - Andrew Howroyd, Sep 23 2019

A141611 Triangle read by rows: T(n, k) = (n-k+1)*(k+1)*binomial(n, k).

Original entry on oeis.org

1, 2, 2, 3, 8, 3, 4, 18, 18, 4, 5, 32, 54, 32, 5, 6, 50, 120, 120, 50, 6, 7, 72, 225, 320, 225, 72, 7, 8, 98, 378, 700, 700, 378, 98, 8, 9, 128, 588, 1344, 1750, 1344, 588, 128, 9, 10, 162, 864, 2352, 3780, 3780, 2352, 864, 162, 10, 11, 200, 1215, 3840, 7350, 9072, 7350, 3840, 1215, 200, 11
Offset: 0

Views

Author

Roger L. Bagula and Gary W. Adamson, Aug 22 2008

Keywords

Comments

Read as a square array, this array factorizes as M*transpose(M), where M = ( k*binomial(n, k) )A003506(n,k).%20-%20_Peter%20Bala">{n,k>=1} = A003506(n,k). - _Peter Bala, Mar 06 2017

Examples

			Triangle begins as:
   1;
   2,   2;
   3,   8,    3;
   4,  18,   18,    4;
   5,  32,   54,   32,    5;
   6,  50,  120,  120,   50,    6;
   7,  72,  225,  320,  225,   72,    7;
   8,  98,  378,  700,  700,  378,   98,    8;
   9, 128,  588, 1344, 1750, 1344,  588,  128,    9;
  10, 162,  864, 2352, 3780, 3780, 2352,  864,  162,  10;
  11, 200, 1215, 3840, 7350, 9072, 7350, 3840, 1215, 200, 11;
  ...
From _Peter Bala_, Mar 06 2017: (Start)
Factorization as a square array
  /1         \ /1  2  3  4...\ /1  2   3   4...\
  |2  2      | |   2  6 12...| |2  8  12  32...|
  |3  6  3   |*|      3 12...|=|3 18  54 120...|
  |4 12 12 4 | |         4...| |4 32 120 320...|
  |...       | |             | |...            |
(End)
		

Crossrefs

Cf. A003506, A007466 (row sums), A037966, A085373.

Programs

  • Magma
    A141611:= func< n,k | (k+1)*(n-k+1)*Binomial(n,k) >;
    [A141611(n,k): k in [0..n], n in [0..14]]; // G. C. Greubel, Sep 22 2024
    
  • Mathematica
    T[n_, m_]:= (n-m+1)*(m+1)*Binomial[n,m];
    Table[T[n, m], {n,0,12}, {m,0,n}]//Flatten
  • PARI
    T(n,m)=(n - m + 1)*(m + 1)*binomial(n, m) \\ Charles R Greathouse IV, Feb 15 2017
    
  • SageMath
    def A141611(n,k): return (k+1)*(n-k+1)*binomial(n,k)
    flatten([[A141611(n,k) for k in range(n+1)] for n in range(15)]) # G. C. Greubel, Sep 22 2024

Formula

T(n, k) = (k+1)*(n-k+1)*binomial(n,k).
Sum_{k=0..n} T(n, k) = A007466(n+1) (row sums).
O.g.f.: (1 - (1 + t)*x + 2*t*x^2)/(1 - (1 + t)*x)^3 = 1 + (2 + 2*t)*x + (3 + 8*t + 3*t^2)*x^2 + (4 + 18*t + 18*t^2 + 4*t^3)*x^3 + .... - Peter Bala, Mar 06 2017
From G. C. Greubel, Sep 22 2024: (Start)
T(2*n, n) = A037966(n+1).
T(2*n-1, n) = 2*A085373(n-1), for n >= 1.
Sum_{k=0..n} (-1)^k*T(n, k) = A000007(n) - 2*[n=2]. (End)

Extensions

Offset corrected by G. C. Greubel, Sep 22 2024

A053545 Comparisons needed for Batcher's sorting algorithm applied to 2^n items.

Original entry on oeis.org

0, 1, 5, 19, 63, 191, 543, 1471, 3839, 9727, 24063, 58367, 139263, 327679, 761855, 1753087, 3997695, 9043967, 20316159, 45350911, 100663295, 222298111, 488636415, 1069547519, 2332033023, 5066719231, 10972299263, 23689428991, 51002736639, 109521666047, 234612588543, 501437431807
Offset: 0

Views

Author

N. J. A. Sloane, Mar 21 2000

Keywords

Comments

Appears to be number of edges in graph where nodes are binary vectors of length n, two nodes u, v being joined by an edge if there's a vector of length n-1 that can be reached from u by deleting a bit and from v by deleting a bit. An independent set in this graph is a code that will correct single deletions.
Binomial transform of A005893: (1, 4, 10, 20, 34, 52, 74, ...) = (1, 5, 19, 63, 191, ...). - Gary W. Adamson, Apr 28 2008
Let A be the Hessenberg matrix of order n defined by: A[1,j]=1, A[i,i]:=2,(i>1), A[i,i-1]=-1, and A[i,j]=0 otherwise. Then, for n>=2, a(n-1)= (-1)^n*coeff(charpoly(A,x),x^2). - Milan Janjic, Jan 26 2010

Crossrefs

The size of a maximal independent set in this graph (1, 1, 2, 2, 4, 6, 10, ...) agrees with A000016 for n <= 7 (and probably for n=8).

Programs

Formula

G.f.: x*(1-2x+2x^2)/((1-x)*(1-2x)^3).
a(n) = 2^(n-2)*(n^2-n+4)-1.
Partial sums of A007466. - J. M. Bergot, Jan 20 2013
a(n) = 7*a(n-1) - 18*a(n-2) + 20*a(n-3) - 8*a(n-4); a(0)=0, a(1)=1, a(2)=5, a(3)=19. - Harvey P. Dale, Apr 03 2013

A228643 Triangle read by rows: T(n,1) = n * (n - 1) + 1 and for k: 1 < k <= n: T(n,k) = T(n,k-1) + T(n-1,k-1).

Original entry on oeis.org

1, 3, 4, 7, 10, 14, 13, 20, 30, 44, 21, 34, 54, 84, 128, 31, 52, 86, 140, 224, 352, 43, 74, 126, 212, 352, 576, 928, 57, 100, 174, 300, 512, 864, 1440, 2368, 73, 130, 230, 404, 704, 1216, 2080, 3520, 5888, 91, 164, 294, 524, 928, 1632, 2848, 4928, 8448
Offset: 1

Views

Author

J. M. Bergot and Reinhard Zumkeller, Aug 29 2013

Keywords

Comments

T(n,1) = A002061(n); T(n,2) = A005893(n-1) for n > 1;
T(n,n) = A007466(n).

Examples

			.   1:    1
.   2:    3,  4
.   3:    7, 10, 14
.   4:   13, 20, 30, 44
.   5:   21, 34, 54, 84, 128
.   6:   31, 52, 86,140, 224, 352
.   7:   43, 74,126,212, 352, 576, 928
.   8:   57,100,174,300, 512, 864,1440,2368
.   9:   73,130,230,404, 704,1216,2080,3520, 5888
.  10:   91,164,294,524, 928,1632,2848,4928, 8448,14336
.  11:  111,202,366,660,1184,2112,3744,6592,11520,19968,34304
.  12:  133,244,446,812,1472,2656,4768,8512,15104,26624,46592,80896.
		

Programs

  • Haskell
    a228643 n k = a228643_tabl !! (n-1) !! (k-1)
    a228643_row n = a228643_tabl !! (n-1)
    a228643_tabl = map fst $ iterate
       (\(row, x) -> (scanl (+) (x * (x - 1) + 1) row, x + 1)) ([1], 2)

A340257 a(n) = 2^n * (1+n*(n+1)/2).

Original entry on oeis.org

1, 4, 16, 56, 176, 512, 1408, 3712, 9472, 23552, 57344, 137216, 323584, 753664, 1736704, 3964928, 8978432, 20185088, 45088768, 100139008, 221249536, 486539264, 1065353216, 2323644416, 5049942016, 10938744832, 23622320128, 50868518912, 109253230592, 234075717632
Offset: 0

Views

Author

Alois P. Heinz, Jan 02 2021

Keywords

Crossrefs

Programs

  • Maple
    a:= n-> 2^n*(1+n*(n+1)/2):
    seq(a(n), n=0..30);
  • Mathematica
    Table[2^n (1+(n(n+1))/2),{n,0,30}] (* or *) LinearRecurrence[{6,-12,8},{1,4,16},30] (* Harvey P. Dale, Jan 19 2023 *)

Formula

G.f.: (4*x^2-2*x+1)/(1-2*x)^3.
E.g.f.: exp(2*x)*(2*x^2+2*x+1).
a(n) = A000079(n) + A001815(n+1).
a(n) = A000079(n) * A000124(n).
a(n) = 2*a(n-1) + n*2^n = 2*a(n-1) + A036289(n), assuming a(-1) = 1/2.
a(n) = A340298(2^n).
a(n) = 2 * A087431(n) for n > 0.
a(n) = 4 * A007466(n) for n > 0.

A087431 a(n) = 0^n/2 + 2^n*(n^2+n+2)/4.

Original entry on oeis.org

1, 2, 8, 28, 88, 256, 704, 1856, 4736, 11776, 28672, 68608, 161792, 376832, 868352, 1982464, 4489216, 10092544, 22544384, 50069504, 110624768, 243269632, 532676608, 1161822208, 2524971008, 5469372416, 11811160064, 25434259456
Offset: 0

Views

Author

Paul Barry, Sep 02 2003

Keywords

Comments

Binomial transform of A080335 (with additional leading 1).

Programs

  • Mathematica
    LinearRecurrence[{6,-12,8},{1,2,8,28},30] (* Harvey P. Dale, Nov 26 2015 *)

Formula

a(n) = 2*A007466(n) for n >= 1.
G.f.: (1-4*x+8*x^2-4*x^3)/(1-2*x)^3. - Colin Barker, Mar 18 2012

A383623 a(n) = 4^n - (n^2 + 3*n + 4)*2^(n-2).

Original entry on oeis.org

0, 0, 2, 20, 128, 672, 3168, 14016, 59648, 247808, 1014272, 4113408, 16588800, 66674688, 267444224, 1071497216, 4289921024, 17168596992, 68694441984, 274822594560, 1099389992960, 4397780172800, 17591605133312, 70367481692160, 281472242024448
Offset: 0

Views

Author

Enrique Navarrete, May 03 2025

Keywords

Comments

a(n) is the number of strings of length n defined on {0,1,2,3} that contain at least two 2s or at least two 3s (or both).

Examples

			a(3)=20 since the strings are 220 (3 of this type), 221 (3 of this type), 223 (3 of this type), 330 (3 of this type), 331 (3 of this type), 332 (3 of this type), 222 and 333.
		

Crossrefs

Formula

E.g.f.: exp(4*x) - exp(2*x)*(1+x)^2.
a(n) = 4^n - A007466(n+1).
G.f.: 2*x^2/((1 - 2*x)^3*(1 - 4*x)). - Stefano Spezia, May 03 2025
Showing 1-8 of 8 results.