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-3 of 3 results.

A176222 a(n) = (n^2 - 3*n + 1 + (-1)^n)/2.

Original entry on oeis.org

0, 3, 5, 10, 14, 21, 27, 36, 44, 55, 65, 78, 90, 105, 119, 136, 152, 171, 189, 210, 230, 253, 275, 300, 324, 351, 377, 406, 434, 465, 495, 528, 560, 595, 629, 666, 702, 741, 779, 820, 860, 903, 945, 990, 1034, 1081, 1127, 1176, 1224, 1275, 1325, 1378, 1430
Offset: 3

Views

Author

Vladimir Shevelev, Apr 12 2010

Keywords

Comments

Let I = I_n be the n X n identity matrix and P = P_n be the incidence matrix of the cycle (1,2,3,...,n).
Let T = P^(-1)+I+P.
11000...01
11100....0
01110.....
00111.....
..........
00.....111
10.....011
Then a(n) is the number of (0,1) n X n matrices A <= T (i.e., an element of A can be 1 only if T has a 1 at this place) having exactly two 1's in every row and column with per(A) = 4.
a(n) is the maximum number m such that m white kings and m black kings can coexist on an n+1 X n+1 chessboard without attacking each other. - Aaron Khan, Jul 05 2022

Examples

			For n=5 the reference matrix is:
  11001
  11100
  01110
  00111
  10011
There are 2^(3*n) = 32768 0-1 matrices obtained from removing one or more 1's in it.
There are 305 such matrices with permanent 4 and there are 13 such matrices with exactly two 1's in every column and every row.
There are 5 matrices having both properties. One of them is:
  10001
  01100
  01100
  00011
  10010
From _Aaron Khan_, Jul 05 2022: (Start)
Examples of the sequence when used for kings on a chessboard:
.
A solution illustrating a(2)=3:
  +-------+
  | B B B |
  | . . . |
  | W W W |
  +-------+
.
A solution illustrating a(3)=5:
  +---------+
  | B B B B |
  | B . . . |
  | . . . W |
  | W W W W |
  +---------+
(End)
		

References

  • V. S. Shevelyov (Shevelev), Extension of the Moser class of four-line Latin rectangles, DAN Ukrainy, 3 (1992), 15-19.

Crossrefs

Cf. A000211, A052928, A128209, A250000 (queens on a chessboard), A002620 (rooks on a chessboard), A355509 (knights on a chessboard).

Programs

  • Magma
    [(n^2-3*n+1+(-1)^n)/2: n in [3..100]]; // Vincenzo Librandi, Mar 24 2011
    
  • Maple
    A176222:=n->(n^2-3*n+1+(-1)^n)/2: seq(A176222(n), n=3..100); # Wesley Ivan Hurt, May 25 2015
  • Mathematica
    Table[(n^2 - 3*n + 1 + (-1)^n)/2, {n, 3, 100}] (* or *) CoefficientList[Series[x (x - 3)/((1 + x)*(x - 1)^3), {x, 0, 30}], x] (* Wesley Ivan Hurt, May 25 2015 *)
    LinearRecurrence[{2,0,-2,1},{0,3,5,10},90] (* Harvey P. Dale, Jan 14 2024 *)
  • PARI
    a(n)=(n^2-3*n+1+(-1)^n)/2 \\ Charles R Greathouse IV, Oct 16 2015
    
  • Sage
    [n*(n-3)/2 + ((n+1)%2) for n in (3..60)] # G. C. Greubel, Mar 22 2022

Formula

a(n) = (n - t(n))*(n - 3 + t(n))/2, where t(n) = 1-(n mod 2).
G.f.: x^4*(3-x)/( (1+x)*(1-x)^3 ). - R. J. Mathar, Mar 06 2011
From Bruno Berselli, Sep 13 2011: (Start)
a(n) + a(n+1) = A005563(n-2).
a(-n) = A084265(n). (End)
a(n) = 1 -2*n +floor(n/2) +floor(n^2/2). - Wesley Ivan Hurt, Jun 14 2013
From Wesley Ivan Hurt, May 25 2015: (Start)
a(n) = 2*a(n-1) - 2*a(n-3) + a(n-4), n>4.
a(n) = Sum_{i=(-1)^n..n-2} i. (End)
a(n) = A174239(n-2) * A174239(n-1). - Paul Curtz, Jul 17 2017
With offset 0, this is ceiling(n/2)*(2*floor(n/2)+3). - N. J. A. Sloane, Jan 16 2020
E.g.f.: (1/2)*((1-x)*exp(x/2) - exp(-x/2))^2. - G. C. Greubel, Mar 22 2022

Extensions

Matrix class definition checked, edited and illustrated by Olivier Gérard, Mar 26 2011

A029579 a(2*n) = n+1, a(2*n-1) = 2*n-1.

Original entry on oeis.org

1, 1, 2, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, 25, 14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, 37, 20, 39, 21, 41, 22, 43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 28, 55, 29, 57, 30, 59, 31, 61, 32, 63, 33, 65, 34, 67, 35, 69, 36, 71, 37
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • GAP
    a:=[1,1,2,3];; for n in [5..80] do a[n]:=2*a[n-2]-a[n-4]; od; a; # Muniru A Asiru, Sep 21 2018
  • Haskell
    import Data.List (transpose)
    a029579 n = if m == 0 then n' + 1 else n  where (n', m) = divMod n 2
    a029579_list = concat $ transpose [[1 ..], [1, 3 ..]]
    -- Reinhard Zumkeller, Apr 06 2015
    
  • Maple
    seq(coeff(series((1+x+x^3)/(1-x^2)^2,x,n+1), x, n), n = 0 .. 80); # Muniru A Asiru, Sep 21 2018
  • Mathematica
    With[{nn = 50}, Riffle[Range[nn], Range[1, 2 nn + 1, 2]]] (* or *) LinearRecurrence[{0, 2, 0, -1}, {1, 1, 2, 3}, 120] (* Harvey P. Dale, Apr 22 2018 *)
  • PARI
    a(n)=(3*n+2+(2-n)*(-1)^n)/4 \\ Charles R Greathouse IV, Sep 02 2015
    

Formula

G.f.: (1 + x + x^3)/(1 - x^2)^2.
From Paul Barry, Aug 29 2004: (Start)
a(n) = (3*n + 2)/4 + (2 - n)*(-1)^n/4.
a(n) = 2*a(n-2) - a(n-4).
Binomial transform is A098156. (End)
From Gary W. Adamson, May 08 2010: (Start)
Let M = an infinite lower triangular matrix with (1, 1, 0, 1, 0, 0, 0, ...) in every column; for columns > 0, shifted down twice from the previous column.
Then A029579 = M * [1, 2, 3, 0, 0, 0, ...]. (End)
From Paul Curtz, Sep 21 2018: (Start)
a(-n) = -A174239(n).
Terms of A026741(n+1) swapped in pairs. (End)

Extensions

Title simplified by Sean A. Irvine, Feb 29 2020

A214630 a(n) is the reduced numerator of 1/4 - 1/A109043(n)^2 = (1 - 1/A026741(n)^2)/4.

Original entry on oeis.org

-1, 0, 0, 2, 3, 6, 2, 12, 15, 20, 6, 30, 35, 42, 12, 56, 63, 72, 20, 90, 99, 110, 30, 132, 143, 156, 42, 182, 195, 210, 56, 240, 255, 272, 72, 306, 323, 342, 90, 380, 399, 420, 110, 462, 483, 506, 132, 552, 575, 600, 156
Offset: 0

Views

Author

Paul Curtz, Jul 23 2012

Keywords

Comments

The unreduced fractions are -1/0, 0/4, 0/1, 8/36, 3/16, 24/100, 2/9, 48/196, 15/64, 80/324, 6/25, ... = c(n)/A061038(n), say.
Note that c(n)=A061037(n) + (period of length 2: repeat 0, 3).
c(n) is a permutation of A198442(n). The corresponding ranks are (the 0's have been swapped for convenience) 0,2,1,6,4,10,... = A145979(n-2).
Define the following sequences, satisfying the recurrence a(n) = 2*a(n-4) - a(n-8),
e(n) = -1, 0, 0, 2, 1, 4, 1, 6, 3, 8, 2, 10, 5, ... (after -1, a permutation of A004526(n) or mix A026741(n-1), 2*n),
f(n) = 1, 2, 1, 4, 3, 6, 2, 8, 5, 10, 3, 12, 7, ..., (another permutation of A004526(n+2) or mix A026741(n+1), 2*n+2).
f(n) - e(n) = periodic of period length 4: repeat 2, 2, 1, 2.
e(n) + f(n) = 0, 2, 1, 6, 4, 10, ... = A145979(n-2).
Then c(n) = e(n)*f(n).
Note that A061038(n) - 4*c(n) = periodic of period length 4: repeat 4, 4, 1, 4.
After division (by period 2: repeat 1, 4, A010685(n)), the reduced fractions of c(n) are -1/0, 0/1 ?, 0/4 ?, 2/9, 3/16, 6/25, 2/9, 12/49, 15/64, 20/81, 6/25, ... = a(n)/b(n).
Note that a(1+4*n) + a(2+4*n) + a(3+4*n) = 2,20,56,... = A002378(1+3*n) = A194767(3*n).
A061037(n-2) - a(n-2) = 0, -3, 0, -3, 0, 3, 0, 15, 0, 33, 0, 57, ... = Fip(n-2).
Fip(n-2)/3 = 0,-1,0,-1,0,1,0,5,0,11,0,19,0,29, .... Without 0's: A165900(n) (a Fibonacci polynomial); also -A110331(n+1) (Pell numbers).
g(n) = -1, 0, 0, 1, 1, 2, 1, 3, 3, 4, ... = mix A026741(n-1), n.
h(n) = 1, 1, 1, 2, 3, 3, 2, 4, 5, 5, ... = mix A026741(n+1), n+1.
h(n) - g(n) = (period 2: repeat 2, 1, 1, 1 = A177704(n-1)).
k(n) = 1, 1, 0, 2, 3, 3, 1, 4, 5, 5, ... = mix A174239(n), n+1.
l(n) = -1, 0, 1, 1, 1, 2, 2, 3, 3, 4, ... .
k(n) - l(n) = period 4: repeat 2, 1, -1, 1.
2) By the second formula in the definition, we take first 1 - 1/A026741(n)^2.
Hence, using a convention for the first fraction, -1/0, 0/1, 0/1, 8/9, 3/4, 24/25, 8/9, 48/49, 15/16, 80/81, 24/25, ... = (A005563(n-1) - A033996(n))/A168077(n) = q(n)/A168077(n).
For a(n), we divide by 4.
Note that A214297 is the reduced numerator of 1/4 - 1/A061038(n).
Note also that A168077(n) = A026741(n)^2.

Crossrefs

Programs

  • Magma
    m:=50; R:=PowerSeriesRing(Integers(), m); Coefficients(R!((2*x^9+3*x^8+6*x^7+2*x^6+6*x^5+6*x^4+2*x^3-1)/((1-x)^3*(x+1)^3*(x^2+1)^3))); // G. C. Greubel, Sep 20 2018
  • Mathematica
    CoefficientList[Series[(2*x^9+3*x^8+6*x^7+2*x^6+6*x^5+6*x^4+2*x^3-1)/((1-x)^3*(x+1)^3*(x^2+1)^3), {x, 0, 50}], x] (* G. C. Greubel, Sep 20 2018 *)
    LinearRecurrence[{0,0,0,3,0,0,0,-3,0,0,0,1},{-1,0,0,2,3,6,2,12,15,20,6,30},60] (* Harvey P. Dale, Jul 01 2019 *)
  • PARI
    Vec(-(2*x^9+3*x^8+6*x^7+2*x^6+6*x^5+6*x^4+2*x^3-1)/((x-1)^3*(x+ 1)^3*(x^2+1)^3) + O(x^100)) \\ Colin Barker, Jan 22 2015
    

Formula

a(4*n) = 4*n^2-1 = (2*n-1)*(2*n+1), a(2*n+1) = a(4*n+2) = n(n+1).
a(n)= A198442(n)/(period of length 4: repeat 1,1,4,1=A010121(n+2)).
a(n) = 3*a(n-4) - 3*a(n-8) + a(n-12). Is this the shortest possible recurrence? See A214297.
a(n+2) - a(n-2) = 0, 2, 4, 6, 2, 10, 12, 14, 4, ... = 2*A214392(n). a(-2)=a(-1)=0=a(1)=a(2).
a(n+4) - a(n-4) = 0, 4, 2, 12, 16, 20, 6, 28, 32, 36,... = 2*A188167(n). a(-4)=3=a(4), a(-3)=2=a(3).
a(n) = g(n) * h(n).
a(n) = k(n) * l(n).
G.f.: -(2*x^9+3*x^8+6*x^7+2*x^6+6*x^5+6*x^4+2*x^3-1) / ((x-1)^3*(x+1)^3*(x^2+1)^3). - Colin Barker, Jan 22 2015
From Luce ETIENNE, Apr 08 2017: (Start)
a(n) = (13*n^2-28-3*(n^2+4)*(-1)^n+3*(n^2-4)*((-1)^((2*n-1+(-1)^n)/4)+(-1)^((2*n+1-(-1)^n)/4)))/64.
a(n) = (13*n^2-28-3*(n^2+4)*cos(n*Pi)+6*(n^2-4)*cos(n*Pi/2))/64. (End)

Extensions

Edited by N. J. A. Sloane, Aug 04 2012
Showing 1-3 of 3 results.