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.

Previous Showing 11-20 of 21 results. Next

A214604 Odd numbers by transposing the right half of A176271, triangle read by rows: T(n,k) = A176271(n - 1 + k, n), 1 <= k <= n.

Original entry on oeis.org

1, 5, 9, 11, 17, 25, 19, 27, 37, 49, 29, 39, 51, 65, 81, 41, 53, 67, 83, 101, 121, 55, 69, 85, 103, 123, 145, 169, 71, 87, 105, 125, 147, 171, 197, 225, 89, 107, 127, 149, 173, 199, 227, 257, 289, 109, 129, 151, 175, 201, 229, 259, 291, 325, 361, 131, 153, 177, 203, 231, 261, 293, 327, 363, 401, 441
Offset: 1

Views

Author

Reinhard Zumkeller, Jul 25 2012

Keywords

Examples

			.     Take the first n elements of the n-th diagonal (northeast to
.     southwest) of the triangle on the left side
.     and write this as n-th row on the triangle of the right side.
. 1:                1                    1
. 2:              _   5                  5  9
. 3:            _   9  11               11 17 25
. 4:         __  __  17  19             19 27 37 49
. 5:       __  __  25  27  29           29 39 51 65 ..
. 6:     __  __  __  37  39  41         41 53 67 .. .. ..
. 7:   __  __  __  49  51  53  55       55 69 .. .. .. .. ..
. 8: __  __  __  __  65  67  69  71     71 .. .. .. .. .. .. .. .
		

Crossrefs

Cf. A214659 (row sums), A214660 (main diagonal), A214661.

Programs

  • Haskell
    import Data.List (transpose)
    a214604 n k = a214604_tabl !! (n-1) !! (k-1)
    a214604_row n = a214604_tabl !! (n-1)
    a214604_tabl = zipWith take [1..] $ transpose a176271_tabl
    
  • Magma
    [(n+k)^2-n-3*k+1: k in [1..n], n in [1..15]]; // G. C. Greubel, Mar 10 2024
    
  • Mathematica
    Table[(n+k)^2-n-3*k+1, {n,15}, {k,n}]//Flatten (* G. C. Greubel, Mar 10 2024 *)
  • SageMath
    flatten([[(n+k)^2-n-3*k+1 for k in range(1,n+1)] for n in range(1,16)]) # G. C. Greubel, Mar 10 2024

Formula

T(n,k) = (n+k)^2 - n - 3*k + 1.
Sum_{k=1..n} T(n, k) = A214659(n).
T(2*n-1, n) = A214660(n) (main diagonal).
T(n, 1) = A028387(n-1).
T(n, n) = A016754(n-1).
T(n, k) = A214661(n,k) + 2*A025581(n,k).
T(n, k) = 2*A000290(A094727(n,k)) - A214661(n,k).

A214661 Odd numbers obtained by transposing the left half of A176271 into rows of a triangle: T(n,k) = A176271(n - 1 + k, k), 1 <= k <= n.

Original entry on oeis.org

1, 3, 9, 7, 15, 25, 13, 23, 35, 49, 21, 33, 47, 63, 81, 31, 45, 61, 79, 99, 121, 43, 59, 77, 97, 119, 143, 169, 57, 75, 95, 117, 141, 167, 195, 225, 73, 93, 115, 139, 165, 193, 223, 255, 289, 91, 113, 137, 163, 191, 221, 253, 287, 323, 361, 111, 135, 161, 189, 219, 251, 285, 321, 359, 399, 441
Offset: 1

Views

Author

Reinhard Zumkeller, Jul 25 2012

Keywords

Examples

			.     Take the first n elements of the n-th diagonal (northwest to
.     southeast) of the triangle on the left side
.     and write this as n-th row on the triangle of the right side.
. 1:                1                    1
. 2:              3   _                  3  9
. 3:            7   9  __                7 15 25
. 4:         13  15  __  __             13 23 35 49
. 5:       21  23  25  __  __           21 33 47 63 ..
. 6:     31  33  35  __  __  __         31 45 61 .. .. ..
. 7:   43  45  47  49  __  __  __       43 59 .. .. .. .. ..
. 8: 57  59  61  63  __  __  __  __     57 .. .. .. .. .. .. .. .
		

Crossrefs

Cf. A051673 (row sums), A214675 (main diagonal).

Programs

  • Haskell
    import Data.List (transpose)
    a214661 n k = a214661_tabl !! (n-1) !! (k-1)
    a214661_row n = a214661_tabl !! (n-1)
    a214661_tabl = zipWith take [1..] $ transpose $ map reverse a176271_tabl
    
  • Magma
    [(n+k)^2-3*n-k+1: k in [1..n], n in [1..15]]; // G. C. Greubel, Mar 10 2024
    
  • Mathematica
    Table[(n+k)^2-3*n-k+1, {n,15}, {k,n}]//Flatten (* G. C. Greubel, Mar 10 2024 *)
  • SageMath
    flatten([[(n+k)^2-3*n-k+1 for k in range(1,n+1)] for n in range(1,16)]) # G. C. Greubel, Mar 10 2024

Formula

T(n, k) = (n+k)^2 - 3*n - k + 1.
T(n,k) = A176271(n+k-1, k).
T(n, k) = A214604(n,k) - 2*A025581(n,k).
T(n, k) = 2*A000290(A094727(n,k)) - A214604(n,k).
T(2*n-1, n) = A214675() (main diagonal).
T(n,1) = A002061(n).
T(n,n) = A016754(n-1).
Sum_{k=1..n} T(n, k) = A051673(n) (row sums).

A182630 T(n,k) = A002024(k+1)*n + A002262(k), n >= 0, k >= 0, read by antidiagonals.

Original entry on oeis.org

0, 1, 0, 2, 2, 1, 3, 4, 3, 0, 4, 6, 5, 3, 1, 5, 8, 7, 6, 4, 2, 6, 10, 9, 9, 7, 5, 0, 7, 12, 11, 12, 10, 8, 4, 1, 8, 14, 13, 15, 13, 11, 8, 5, 2, 9, 16, 15, 18, 16, 14, 12, 9, 6, 3, 10, 18, 17, 21, 19, 17, 16, 13, 10, 7, 0
Offset: 0

Views

Author

Omar E. Pol, Dec 06 2010

Keywords

Comments

A table of congruences.
See A182631 for another version.

Examples

			Table of congruences:
===============+====+=======+==========+=============+====
           mod |  1 |   2   |     3    |      4      | ...
===============+====+=======+==========+=============+====
  congruent to |  0 |  0  1 |  0  1  2 |  0  1  2  3 | ...
===============+====+=======+==========+=============+====
Array begins:  |  0 |  0  1 |  0  1  2 |  0  1  2  3 | ...
               |  1 |  2  3 |  3  4  5 |  4  5  6  7 | ...
               |  2 |  4  5 |  6  7  8 |  8  9 10 11 | ...
               |  3 |  6  7 |  9 10 11 | 12 13 14 15 | ...
               |  4 |  8  9 | 12 13 14 | 16 17 18 19 | ...
               |  5 | 10 11 | 15 16 17 | 20 21 22 23 | ...
               |  6 | 12 13 | 18 19 20 | 24 25 26 27 | ...
               |  7 | 14 15 | 21 22 23 | 28 29 30 31 | ...
               |  8 | 16 17 | 24 25 26 | 32 33 34 35 | ...
               |  9 | 18 19 | 27 28 29 | 36 37 38 39 | ...
               | 10 | 20 21 | 30 31 32 | 40 41 42 43 | ...
		

Crossrefs

Programs

A193657 First difference of A002627.

Original entry on oeis.org

1, 2, 7, 31, 165, 1031, 7423, 60621, 554249, 5611771, 62353011, 754471433, 9876716941, 139097096919, 2097156230471, 33704296561141, 575219994643473, 10389911153247731, 198019483156015579, 3971390745517868001, 83608226221428800021, 1843561388182505040463
Offset: 0

Views

Author

Clark Kimberling, Aug 02 2011

Keywords

Comments

Previous name was: Q-residue of the triangle A094727, where Q is the triangular array (t(i,j)) given by t(i,j)=1. For the definition of Q-residue, see A193649.
Number of n X n rook placements avoiding the pattern 001. - N. J. A. Sloane, Feb 04 2013
Let M(n) denote the n X n matrix with ones along the subdiagonal, ones everywhere above the main diagonal, the integers 2, 3, etc., along the main diagonal, and zeros everywhere else. Then a(n) is equal to the permanent of M(n). - John M. Campbell, Apr 20 2021

Crossrefs

Programs

  • Maple
    a := n -> 1-n*GAMMA(n+1)+exp(1)*n*GAMMA(n+1,1):
    seq(simplify(a(n)), n=0..9); # Peter Luschny, May 30 2014
  • Mathematica
    q[n_, k_] := n + k + 1;  (* A094727 *)
    r[0] = 1; r[k_] := Sum[q[k - 1, i] r[k - 1 - i], {i, 0, k - 1}]
    p[n_, k_] := 1
    v[n_] := Sum[p[n, k] r[n - k], {k, 0, n}]
    Table[v[n], {n, 0, 18}]    (* A193657 *)
    TableForm[Table[q[i, k], {i, 0, 4}, {k, 0, i}]]
    Table[r[k], {k, 0, 8}]  (* A193668 *)
    TableForm[Table[p[n, k], {n, 0, 4}, {k, 0, 4}]]
    CoefficientList[Series[(E^x-x)/(x-1)^2,{x,0,20}],x]*Range[0,20]! (* Vaclav Kotesovec, Nov 20 2012 *)
  • PARI
    a(n) = { sum(k=0, n, if (k <= n-2, binomial(n,k)*(k+1)!, binomial(n,k)^2*k!));} \\ Michel Marcus, Feb 07 2013
    
  • Sage
    def A193657():
        a = 2; b = 7; c = 31; n = 3
        yield 1
        while True:
            yield a
            n += 1
            a,b,c = b,c,((n-2)^2*a+2*(1+n-n^2)*b+(3*n+n^2-2)*c)/n
    a = A193657(); [next(a) for n in range(19)] # Peter Luschny, May 30 2014

Formula

E.g.f.: (exp(x)-x)/(x-1)^2. - Vaclav Kotesovec, Nov 20 2012
a(n) ~ n!*n*(e-1). - Vaclav Kotesovec, Nov 20 2012
a(n) = 1-n*Gamma(n+1)+e*n*Gamma(n+1,1). - Peter Luschny, May 30 2014
a(n) +(-n-2)*a(n-1) +(n-1)*a(n-2)=0. - R. J. Mathar, May 30 2014
From Peter Bala, Feb 10 2020: (Start)
a(n) = n*A002627(n) + 1.
a(n) = A114870(n) + n!.
a(n) = A296964(n+1) - A296964(n) for n >= 2.
a(1) = 2 and a(n) = (n^2*a(n-1) - 1)/(n - 1) for n >= 2. See A082425 for solutions to this recurrence with different starting values.
Also, a(0) = 1 and a(n) = n*( a(n-1) + ... + a(0) ) + 1 for n >= 1.
Second column of A176305. (End)

Extensions

Simpler definition by Peter Luschny, May 30 2014

A319556 a(n) gives the alternating sum of length n, starting at n: n - (n+1) + (n+2) - ... + (-1)^(n+1) * (2n-1).

Original entry on oeis.org

1, -1, 4, -2, 7, -3, 10, -4, 13, -5, 16, -6, 19, -7, 22, -8, 25, -9, 28, -10, 31, -11, 34, -12, 37, -13, 40, -14, 43, -15, 46, -16, 49, -17, 52, -18, 55, -19, 58, -20, 61, -21, 64, -22, 67, -23, 70, -24, 73, -25, 76, -26, 79, -27, 82, -28, 85, -29, 88, -30
Offset: 1

Views

Author

Mark Povich, Aug 27 2019

Keywords

Comments

As can be observed from Bernard Schott's formula, and also proved using elementary methods of slope and angle determination, extending the graph of this sequence forms two lines (given by y = 1.5x - 0.5 and y = -0.5x) that intersect at (0.25, -0.125) in an angle of intersection of ~82.87 degrees. The angles of incidence of these lines off the horizontal axis are ~56.31 and ~-26.56 degrees.
If one wished to include negative input values, one could proceed, e.g., -3+4-5 (=-8) or -3+2-1 (=-2). If the former, then the sequence merely switches signs for negative inputs, graphically extending the previous lines to the left of the vertical. If the latter, two new lines emerge left of the vertical, both of slope 1/2. Increasing the run in this case "spreads apart" all y-intercepts.

Examples

			If n=5, a(n)=7, since 5-6+7-8+9 = 7.
If n=6, a(n)=-3, since 6-7+8-9+10-11 = -3.
		

Crossrefs

Programs

  • Magma
    [((2*n-1)*(n mod 2) - n*(-1)^n)/2: n in [0..70]]; // G. C. Greubel, Mar 14 2024
    
  • Mathematica
    LinearRecurrence[{0,2,0,-1}, {1,-1,4,-2}, 60] (* Metin Sariyar, Sep 15 2019 *)
  • PARI
    a(n) = sum(k=n, 2*n-1, (-1)^(n-k)*k); \\ Michel Marcus, Aug 27 2019
    
  • PARI
    Vec(x*(1 - x + 2*x^2) / ((1 - x)^2*(1 + x)^2) + O(x^60)) \\ Colin Barker, Sep 07 2019
    
  • Python
    def alt(k):
        return sum(k[::2])-sum(k[1::2])
    def alt_run(n):
        m = []
        m.append(n)
        for i in range (1, n):
            m.append(m[0]+i)
        return alt(m)
    t=[]
    for i in range (100):
        t.append(alt_run(i))
    print(t)
    
  • SageMath
    [((2*n-1)*(n%2) - n*(-1)^n)/2 for n in range(1,71)] # G. C. Greubel, Mar 14 2024

Formula

From Bernard Schott, Aug 27 2019: (Start)
a(2*n-1) = 3*n-2 for n >= 1,
a(2*n) = - n for n >= 1. (End)
a(n) = Sum_{k=n..2*n-1} (-1)^(n-k)*k.
From Colin Barker, Sep 07 2019: (Start)
G.f.: x*(1 - x + 2*x^2) / ((1 - x)^2*(1 + x)^2).
a(n) = 2*a(n-2) - a(n-4) for n>4.
a(n) = ((2*n-1)*(1 - (-1)^n) - 2*n*(-1)^n)/4. (End)
E.g.f.: (1/4)*((1 + 4*x)*exp(-x) - (1 - 2*x)*exp(x)). - Stefano Spezia, Sep 07 2019 after Colin Barker
From G. C. Greubel, Mar 14 2024: (Start)
a(n) = Sum_{k=0..n-1} (-1)^k*A094727(n, k).
a(n) = Sum_{k=1..n} (-1)^(k-1)*A128622(n, k). (End)

A334016 Table read by antidiagonals upward: T(n,k) is the number of ways to move a chess queen from (1,1) to (n,k) in the first quadrant using only right, diagonal up-right, and diagonal up-left moves.

Original entry on oeis.org

1, 1, 1, 2, 4, 6, 4, 10, 21, 35, 8, 25, 65, 139, 237, 16, 60, 179, 451, 978, 1684, 32, 140, 470, 1337, 3339, 7239, 12557, 64, 320, 1189, 3725, 10325, 25559, 55423, 96605, 128, 720, 2926, 9958, 30018, 81716, 200922, 435550, 761938, 256, 1600, 7048, 25802, 83518
Offset: 1

Views

Author

Peter Kagey, Apr 12 2020

Keywords

Examples

			Table begins:
n\k|   1    2     3      4       5        6         7          8
---+------------------------------------------------------------
  1|   1    1     6     35     237     1684     12557      96605
  2|   1    4    21    139     978     7239     55423     435550
  3|   2   10    65    451    3339    25559    200922    1611624
  4|   4   25   179   1337   10325    81716    658918    5394051
  5|   8   60   470   3725   30018   245220   2027447   16935981
  6|  16  140  1189   9958   83518   703635   5961973   50811786
  7|  32  320  2926  25802  224831  1951587  16938814  147261146
  8|  64  720  7048  65241  589701  5269220  46826316  415175289
For example, the T(2,2) = 4 valid sequences of moves from (1,1) to (2,2) are:
(1,1) -> (2,1) -> (1,2) -> (2,2),
(1,1) -> (2,1) -> (3,1) -> (2,2),
(1,1) -> (2,2), and
(1,1) -> (3,1) -> (2,2).
		

Crossrefs

Cf. A035002 (up, right), A059450 (right, up-left), A132439 (up, right, up-right), A279212 (up, right, up-right, up-left), A334017 (up, right, up-left).
A071945 is the analog for king moves. For both king and queen moves, A094727 is the length of the longest sequence of moves.

Formula

T(n,k) = Sum_{i=1..k-1} T(n+i, k-i) + Sum_{i=1..min(n,k)-1} T(n-i, k-i) + Sum_{i=1..n-1} T(n-i, k).

A334017 Table read by antidiagonals upward: T(n,k) is the number of ways to move a chess queen from (1,1) to (n,k) in the first quadrant using only up, right, and diagonal up-left moves.

Original entry on oeis.org

1, 1, 2, 2, 5, 10, 4, 13, 33, 63, 8, 32, 98, 240, 454, 16, 76, 269, 777, 1871, 3539, 32, 176, 702, 2295, 6420, 15314, 29008, 64, 400, 1768, 6393, 19970, 54758, 129825, 246255, 128, 896, 4336, 17088, 58342, 176971, 478662, 1129967, 2145722, 256, 1984, 10416
Offset: 1

Views

Author

Peter Kagey, Apr 12 2020

Keywords

Comments

First row is A175962.

Examples

			Table begins:
n\k|  1   2     3      4       5        6         7          8
---+----------------------------------------------------------
  1|  1   2    10     63     454     3539     29008     246255
  2|  1   5    33    240    1871    15314    129825    1129967
  3|  2  13    98    777    6420    54758    478662    4266102
  4|  4  32   269   2295   19970   176971   1593093   14532881
  5|  8  76   702   6393   58342   536080   4965056   46345046
  6| 16 176  1768  17088  163041  1550809  14765863  140982374
  7| 32 400  4336  44280  440602  4332221  42373370  413689403
  8| 64 896 10416 111984 1159580 11771312 118190333 1179448443
For example, the T(2,2) = 5 sequences of permissible queen's moves from (1,1) to (2,2) are:
(1,1) -> (1,2) -> (2,2),
(1,1) -> (2,1) -> (1,2) -> (2,2),
(1,1) -> (2,1) -> (2,2),
(1,1) -> (2,1) -> (3,1) -> (2,2), and
(1,1) -> (3,1) -> (2,2).
		

Crossrefs

Cf. A175962.
Cf. A035002 (up, right), A059450 (right, up-left), A132439 (up, right, up-right), A279212 (up, right, up-left), A334016 (right, up-right, up-left).
A033877 is the analog for king moves. For both king and queen moves, A094727 is the length of the longest sequence of moves.

A102105 a(n) = (19*5^n - 16*3^n + 1) / 4.

Original entry on oeis.org

1, 12, 83, 486, 2645, 13872, 71303, 362346, 1829225, 9198612, 46150523, 231225006, 1157542205, 5791962552, 28972567343, 144901100466, 724620293585, 3623445841692, 18118262329763, 90594411012726, 452981353155365, 2264934660052032, 11324756983085783
Offset: 0

Views

Author

Gary W. Adamson, Dec 30 2004

Keywords

Comments

Sum of the entries in the last row of the 3 X 3 matrix M^n, where M = {{1, 0, 0}, {2, 3, 0}, {3, 4, 5}}.
Sum of the entries in the second row of M^n = A048473(n).

Examples

			a(4) = 2645 = 9*486 - 23*83 + 15*12 = 9*a(3) - 23*a(2) + 15*a(1).
a(4) = 2645 since M^4 * {1, 1, 1} = {1, 161, 2645}, where 161 = A048473(4).
		

Crossrefs

Programs

  • GAP
    List([0..30], n-> (19*5^n -16*3^n +1)/4); # G. C. Greubel, Oct 27 2019
  • Magma
    [(19*5^n -16*3^n +1)/4: n in [0..30]]; // G. C. Greubel, Oct 27 2019
    
  • Maple
    with(linalg): M[1]:=matrix(3,3,[1,0,0,2,3,0,3,4,5]): for n from 2 to 23 do M[n]:=multiply(M[1],M[n-1]) od: 1,seq(multiply(M[n],matrix(3,1,[1,1,1]))[3,1],n=1..23);
    seq((19*5^n -16*3^n +1)/4, n=0..30); # G. C. Greubel, Oct 27 2019
  • Mathematica
    Table[(19*5^n -16*3^n +1)/4, {n,0,30}] (* G. C. Greubel, Oct 27 2019 *)
    LinearRecurrence[{9,-23,15},{1,12,83},30] (* Harvey P. Dale, Sep 19 2021 *)
  • PARI
    Vec((1 + 3*x - 2*x^2) / ((1 - x)*(1 - 3*x)*(1 - 5*x)) + O(x^30)) \\ Colin Barker, Mar 03 2017
    
  • Sage
    [(19*5^n -16*3^n +1)/4 for n in (0..30)] # G. C. Greubel, Oct 27 2019
    

Formula

a(n) = 9*a(n-1) - 23*a(n-2) + 15*a(n-3), a(0)=1,a(1)=12,a(2)=83 (derived from the minimal polynomial of the matrix M).
G.f.: (1 + 3*x - 2*x^2) / ((1 - x)*(1 - 3*x)*(1 - 5*x)). - Colin Barker, Mar 03 2017
E.g.f.: (exp(x) - 16*exp(3*x) + 19*exp(5*x))/4. - G. C. Greubel, Oct 27 2019

Extensions

Corrected by T. D. Noe, Nov 07 2006
Edited by N. J. A. Sloane, Dec 02 2006
New definition from Ralf Stephan, May 17 2007

A182815 The third row of table A182630.

Original entry on oeis.org

2, 4, 5, 6, 7, 8, 8, 9, 10, 11, 10, 11, 12, 13, 14, 12, 13, 14, 15, 16, 17, 14, 15, 16, 17, 18, 19, 20, 16, 17, 18, 19, 20, 21, 22, 23, 18, 19, 20, 21, 22, 23, 24, 25, 26, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 26
Offset: 0

Views

Author

Omar E. Pol, Dec 06 2010

Keywords

Crossrefs

Programs

  • Maple
    seq(A182630(2,n),n=0..80) ;

Formula

a(n) = A182630(2,n).

A347823 Triangle read by rows: T(n,k) = (n+k+1)*binomial(n,k), 0 <= k <= n.

Original entry on oeis.org

1, 2, 3, 3, 8, 5, 4, 15, 18, 7, 5, 24, 42, 32, 9, 6, 35, 80, 90, 50, 11, 7, 48, 135, 200, 165, 72, 13, 8, 63, 210, 385, 420, 273, 98, 15, 9, 80, 308, 672, 910, 784, 420, 128, 17, 10, 99, 432, 1092, 1764, 1890, 1344, 612, 162, 19, 11, 120, 585, 1680, 3150, 4032, 3570, 2160, 855, 200, 21
Offset: 0

Views

Author

Jules Beauchamp, Jan 23 2022

Keywords

Examples

			Triangle begins:
  1;
  2,  3;
  3,  8,   5;
  4, 15,  18,   7;
  5, 24,  42,  32,   9;
  6, 35,  80,  90,  50,  11;
  7, 48, 135, 200, 165,  72, 13;
  8, 63, 210, 385, 420, 273, 98, 15;
  ...
		

Crossrefs

Row sums give A053220.
Columns give A000027, A005563, A212343.
Diagonals give A005408, A001105, A059270, A112742.

Programs

Formula

T(n,k) = A094727(n+1,k)*A007318(n,k).
Row g.f.: (1 + x)^(n-1)*(1 + n + x + 2*n*x). - Stefano Spezia, Jan 23 2022
Previous Showing 11-20 of 21 results. Next