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

A064226 a(n) = (9*n^2 + 13*n + 6)/2.

Original entry on oeis.org

3, 14, 34, 63, 101, 148, 204, 269, 343, 426, 518, 619, 729, 848, 976, 1113, 1259, 1414, 1578, 1751, 1933, 2124, 2324, 2533, 2751, 2978, 3214, 3459, 3713, 3976, 4248, 4529, 4819, 5118, 5426, 5743, 6069, 6404, 6748, 7101, 7463, 7834, 8214, 8603, 9001, 9408, 9824
Offset: 0

Views

Author

N. J. A. Sloane, Sep 22 2001

Keywords

Comments

Diagonal of triangular spiral in A051682. - Paul Barry, Mar 15 2003
Ehrhart polynomial of open quadrilateral with vertices (0,2),(2,3),(3,1),(2,0). - Michael Somos, Jul 22 2006

Crossrefs

Programs

  • Magma
    I:=[3,14,34]; [n le 3 select I[n] else 3*Self(n-1) - 3*Self(n-2) + Self(n-3): n in [1..50]]; // Vincenzo Librandi, Jul 19 2015
  • Maple
    A064226:=n-> (9*n^2 + 13*n + 6) / 2; seq(A064226(n), n=0..50); # Wesley Ivan Hurt, May 08 2014
  • Mathematica
    Table[(9 n^2 + 13 n + 6)/2, {n, 0, 50}] (* Wesley Ivan Hurt, May 08 2014 *)
    LinearRecurrence[{3, -3, 1}, {3, 14, 34}, 50] (* Vincenzo Librandi, Jul 19 2015 *)
  • PARI
    {a(n) = 3 + n * (9*n + 13) / 2}; /* Michael Somos, Jul 22 2006 */
    

Formula

From Paul Barry, Mar 15 2003: (Start)
a(n) = 3*C(n,0) + 11*C(n,1) + 9*C(n,2); binomial transform of (3, 11, 9, 0, 0, 0, ...).
G.f.: (3 + 5*x + x^2)/(1-x)^3.
a(n) = A081268(n) + 2. (End)
A064225(n) = a(-1-n). - Michael Somos, Jul 22 2006
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3). - Wesley Ivan Hurt, Apr 16 2023
E.g.f.: (3 + 11*x + 9*x^2/2)*exp(x). - Elmo R. Oliveira, Oct 21 2024

A235332 a(n) = n*(9*n + 25)/2 + 6.

Original entry on oeis.org

6, 23, 49, 84, 128, 181, 243, 314, 394, 483, 581, 688, 804, 929, 1063, 1206, 1358, 1519, 1689, 1868, 2056, 2253, 2459, 2674, 2898, 3131, 3373, 3624, 3884, 4153, 4431, 4718, 5014, 5319, 5633, 5956, 6288, 6629, 6979, 7338, 7706, 8083, 8469, 8864, 9268, 9681, 10103
Offset: 0

Views

Author

Bruno Berselli, Jan 22 2014

Keywords

Comments

This is the case d=6 of n*(9*n + 4*d + 1)/2 + d. Other similar sequences are:
d=0, A022267;
d=1, A064225;
d=2, A062123;
d=3, A064226;
d=4, A022266 (with initial 0);
d=5, A178977.
First bisection of A235537.

Crossrefs

Programs

  • Magma
    [n*(9*n+25)/2+6: n in [0..50]];
    
  • Mathematica
    Table[n (9 n + 25)/2 + 6, {n, 0, 50}]
    LinearRecurrence[{3,-3,1},{6,23,49},50] (* Harvey P. Dale, Feb 12 2022 *)
  • PARI
    a(n)=n*(9*n+25)/2+6 \\ Charles R Greathouse IV, Oct 07 2015

Formula

G.f.: (6 + 5*x - 2*x^2)/(1 - x)^3.
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3).
2*a(n) - a(n+1) + 12 = A081267(n).
E.g.f.: exp(x)*(12 + 34*x + 9*x^2)/2. - Elmo R. Oliveira, Nov 13 2024

A214230 Sum of the eight nearest neighbors of n in a right triangular type-1 spiral with positive integers.

Original entry on oeis.org

53, 88, 78, 125, 85, 84, 125, 97, 108, 143, 223, 168, 158, 169, 201, 284, 208, 183, 179, 187, 210, 281, 226, 219, 227, 235, 261, 314, 430, 339, 311, 310, 318, 326, 346, 396, 515, 403, 360, 347, 355, 363, 371, 379, 411, 509, 427, 411, 419, 427, 435, 443, 451, 486, 557
Offset: 1

Views

Author

Alex Ratushnyak, Jul 08 2012

Keywords

Comments

Right triangular type-1 spiral implements the sequence Up, Right-down, Left.
Right triangular type-2 spiral (A214251): Left, Up, Right-down.
Right triangular type-3 spiral (A214252): Right-down, Left, Up.
A140064 -- rightwards from 1: 3,14,34...
A064225 -- leftwards from 1: 8,24,49...
A117625 -- upwards from 1: 2,12,31...
A006137 -- downwards from 1: 6,20,43...
A038764 -- left-down from 1: 7,22,46...
A081267 -- left-up from 1: 9,26,52...
A081589 -- right-up from 1: 13, 61, 145...
9*x^2/2 - 19*x/2 + 6 -- right-down from 1: 5,18,40...

Examples

			Right triangular spiral begins:
56
55  57
54  29  58
53  28  30  59
52  27  11  31  60
51  26  10  12  32  61
50  25   9   2  13  33  62
49  24   8   1   3  14  34  63
48  23   7   6   5   4  15  35  64
47  22  21  20  19  18  17  16  36  65
46  45  44  43  42  41  40  39  38  37  66
78  77  76  75  74  73  72  71  70  69  68  67
The eight nearest neighbors of 3 are 1, 2, 13, 33, 14, 4, 5, 6. Their sum is a(3)=78.
		

Crossrefs

Programs

  • Python
    SIZE=29  # must be odd
    grid = [0] * (SIZE*SIZE)
    saveX = [0]* (SIZE*SIZE)
    saveY = [0]* (SIZE*SIZE)
    saveX[1] = saveY[1] = posX = posY = SIZE//2
    grid[posY*SIZE+posX]=1
    n = 2
    def walk(stepX,stepY,chkX,chkY):
      global posX, posY, n
      while 1:
        posX+=stepX
        posY+=stepY
        grid[posY*SIZE+posX]=n
        saveX[n]=posX
        saveY[n]=posY
        n+=1
        if posY==0 or grid[(posY+chkY)*SIZE+posX+chkX]==0:
            return
    while 1:
        walk(0, -1,  1,  1)    # up
        if posY==0:
            break
        walk( 1, 1, -1,  0)    # right-down
        walk(-1, 0,  0, -1)    # left
    for n in range(1,92):
        posX = saveX[n]
        posY = saveY[n]
        k = grid[(posY-1)*SIZE+posX] + grid[(posY+1)*SIZE+posX]
        k+= grid[(posY-1)*SIZE+posX-1] + grid[(posY-1)*SIZE+posX+1]
        k+= grid[(posY+1)*SIZE+posX-1] + grid[(posY+1)*SIZE+posX+1]
        k+= grid[posY*SIZE+posX-1] + grid[posY*SIZE+posX+1]
        print(k, end=', ')

A371967 Irregular triangle T(r,w) read by rows: number of ways of placing w non-attacking wazirs on a 3 X r board.

Original entry on oeis.org

1, 1, 3, 1, 1, 6, 8, 2, 1, 9, 24, 22, 6, 1, 1, 12, 49, 84, 61, 18, 2, 1, 15, 83, 215, 276, 174, 53, 9, 1, 1, 18, 126, 442, 840, 880, 504, 158, 28, 2, 1, 21, 178, 792, 2023, 3063, 2763, 1478, 472, 93, 12, 1, 1, 24, 239, 1292, 4176, 8406, 10692, 8604, 4374, 1416, 297, 38, 2, 1, 27, 309
Offset: 0

Views

Author

R. J. Mathar, Apr 14 2024

Keywords

Examples

			The triangle starts with r>=0 rows and w>=0 wazirs as
  1 ;
  1 3 1 ;
  1 6 8 2  ;
  1 9 24 22 6 1 ;
  1 12 49 84 61 18 2  ;
  1 15 83 215 276 174 53 9 1 ;
  1 18 126 442 840 880 504 158 28 2  ;
  1 21 178 792 2023 3063 2763 1478 472 93 12 1 ;
  1 24 239 1292 4176 8406 10692 8604 4374 1416 297 38 2  ;
  1 27 309 1969 7731 19591 32716 36257 26674 13035 4264 945 142 15 1 ;
  ...
		

Crossrefs

Cf. A051736 (row sums), A035607 (on 2Xr board), A011973 (on 1Xr board), A232833 (on rXr board).
T(n,n) gives A371978.
Row maxima give A371979.
Cf. A007494.

Programs

  • Maple
    b:= proc(n, l) option remember; `if`(n=0, 1,
          add(`if`(Bits[And](j, l)>0, 0, expand(b(n-1, j)*
          x^add(i, i=Bits[Split](j)))), j=[0, 1, 2, 4, 5]))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, 0)):
    seq(T(n), n=0..10);  # Alois P. Heinz, Apr 14 2024
  • Mathematica
    b[n_, l_] := b[n, l] = If[n == 0, 1, Sum[If[BitAnd[j, l] > 0, 0, Expand[b[n - 1, j]*x^DigitCount[j, 2, 1]]], {j, {0, 1, 2, 4, 5}}]];
    T[n_] := CoefficientList[b[n, 0], x];
    Table[T[n], {n, 0, 10}] // Flatten (* Jean-François Alcover, Jun 05 2024, after Alois P. Heinz *)

Formula

T(r,0) = 1.
T(r,1) = 3*r.
T(r,2) = A064225(r-1).
T(r,3) = A172229(r).
T(r,4) = 27*r^4/8 -117*r^3/4 +829*r^2/8 -715*r/4 +126. [Siehler Table 3]
T(3,w) = A232833(3,w).
G.f.: (1+x*y) *(1 +x*y +x*y^2 -x^2*y^3)/(1 -x -x*y -x^2*y^3 -2*x^2*y -3*x^2*y^2 -x^3*y^2 +x^3*y^4 +x^4*y^4). - R. J. Mathar, Apr 21 2024

A198392 a(n) = (6*n*(3*n+7)+(2*n+13)*(-1)^n+3)/16 + 1.

Original entry on oeis.org

2, 4, 12, 18, 31, 41, 59, 73, 96, 114, 142, 164, 197, 223, 261, 291, 334, 368, 416, 454, 507, 549, 607, 653, 716, 766, 834, 888, 961, 1019, 1097, 1159, 1242, 1308, 1396, 1466, 1559, 1633, 1731, 1809, 1912, 1994, 2102, 2188, 2301, 2391, 2509, 2603, 2726, 2824, 2952
Offset: 0

Views

Author

Bruno Berselli, Oct 25 2011

Keywords

Comments

For an origin of this sequence, see the triangular spiral illustrated in the Links section.
First bisection gives A117625 (without the initial term).

Crossrefs

Cf. A152832 (by Superseeker).
Cf. sequences related to the triangular spiral: A022266, A022267, A027468, A038764, A045946, A051682, A062708, A062725, A062728, A062741, A064225, A064226, A081266-A081268, A081270-A081272, A081275 [incomplete list].

Programs

  • Magma
    [(6*n*(3*n+7)+(2*n+13)*(-1)^n+3)/16+1: n in [0..50]];
  • Mathematica
    LinearRecurrence[{1,2,-2,-1,1},{2,4,12,18,31},60] (* Harvey P. Dale, Jun 15 2022 *)
  • PARI
    for(n=0, 50, print1((6*n*(3*n+7)+(2*n+13)*(-1)^n+3)/16+1", "));
    

Formula

G.f.: (2+2*x+4*x^2+2*x^3-x^4)/((1+x)^2*(1-x)^3).
a(n) = a(n-1)+2*a(n-2)-2*a(n-3)-a(n-4)+a(n-5).
a(n)-a(-n-1) = A168329(n+1).
a(n)+a(n-1) = A102214(n).
a(2n)-a(2n-1) = A016885(n).
a(2n+1)-a(2n) = A016825(n).

A276819 a(n) = (9*n^2 - n)/2 + 1.

Original entry on oeis.org

1, 5, 18, 40, 71, 111, 160, 218, 285, 361, 446, 540, 643, 755, 876, 1006, 1145, 1293, 1450, 1616, 1791, 1975, 2168, 2370, 2581, 2801, 3030, 3268, 3515, 3771, 4036, 4310, 4593, 4885, 5186, 5496, 5815, 6143, 6480, 6826, 7181, 7545, 7918, 8300, 8691, 9091, 9500, 9918, 10345, 10781, 11226, 11680, 12143, 12615
Offset: 0

Views

Author

Yuriy Sibirmovsky, Sep 18 2016

Keywords

Comments

Diagonal of triangular spiral in A051682. The other 5 diagonals are given by A140064, A117625, A081267, A064225, A006137. See the link as well.
First differences are given by A017209.
72*a(n) - 71 is a perfect square. - Klaus Purath, Jan 14 2022

Crossrefs

Programs

  • Mathematica
    Table[(9*n^2-n)/2+1, {n,0,100}]
  • PARI
    Vec((1+2*x+6*x^2)/(1-x)^3 + O(x^60)) \\ Colin Barker, Sep 18 2016
    
  • PARI
    a(n) = (9*n^2 - n)/2 + 1; \\ Altug Alkan, Sep 18 2016

Formula

a(n) = (9*n^2 - n)/2 + 1.
a(n) = a(n-1) + 9*n - 5 with a(0) = 1.
From Colin Barker, Sep 18 2016: (Start)
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3) for n > 2.
G.f.: (1 + 2*x + 6*x^2)/(1 - x)^3. (End)
From Klaus Purath, Jan 14 2022: (Start)
a(n) = A006137(n) - n.
A003215(a(n)) - A003215(a(n)-3) = A002378(9*n-1). (End)
E.g.f.: exp(x)*(2 + 8*x + 9*x^2)/2. - Stefano Spezia, Dec 25 2022

A239304 Triangle of permutations corresponding to the compressed square roots of Gray code * bit-reversal permutation (A239303).

Original entry on oeis.org

1, 1, 2, 3, 1, 2, 4, 2, 1, 3, 2, 5, 4, 1, 3, 2, 5, 6, 3, 1, 4, 6, 2, 3, 7, 5, 1, 4, 7, 3, 2, 6, 8, 4, 1, 5, 3, 8, 7, 2, 4, 9, 6, 1, 5, 3, 8, 9, 4, 2, 7, 10, 5, 1, 6, 9, 3, 4, 10, 8, 2, 5, 11, 7, 1, 6, 10, 4, 3, 9
Offset: 1

Views

Author

Tilman Piesk, Mar 14 2014

Keywords

Comments

The symmetrical binary matrices corresponding to the rows of A239303 can be interpreted as adjacency matrices of undirected graphs. These graphs are chains where one end is connected to itself, so they can be interpreted as permutations. The end connected to itself is always the first element of the permutation, i.e., on the left side of the triangle.
Columns of the square array:
T(m,1) = A008619(m) = 1,2,2,3,3...
T(m,2) = 1,1,1...
T(m,3) = A028242(m+3) = 3,2,4,3,5,4,6,5,7,6,8,7,9,8,10,9,11,10,12...
T(m,4) = m+3 = 4,5,6...
T(m,5) = A084964(m+4) = 2,5,3,6,4,7,5,8,6,9,7,10,8,11,9,12,10,13...
T(m,6) = 2,2,2...
T(m,7) = A168230(m+5) = 6,3,7,4,8,5,9,6,10,7,11,8,12,9,13,10,14...
T(m,8) = m+6 = 7,8,9...
T(m,9) = A152832(m+9) = 3,8,4,9,5,10,6,11,7,12,8,13,9,14,10,15...
T(m,10) = 3,3,3...
Diagonals of the square array:
T(n,n) = a(A001844(n)) = 1,1,4,7,4,2,9,14,7,3,14,21,10,4,19,28,13,5,24...
T(n,2n-1) = a(A064225(n)) = 1,2,3...
T(2n-1,n) = a(A081267(n)) = 1,1,5,10,6,2,12,21,11,3,19,32,16,4,26,43,21...

Examples

			Triangular array begins:
  1
  1 2
  3 1 2
  4 2 1 3
  2 5 4 1 3
  2 5 6 3 1 4
Square array begins:
  1 1 3 4 2 2
  2 1 2 5 5 2
  2 1 4 6 3 2
  3 1 3 7 6 2
  3 1 5 8 4 2
  4 1 4 9 7 2
Row 5 of A239303 is the vector (12,18,1,17,10), which corresponds to the following binary matrix:
  0 0 1 1 0
  0 1 0 0 1
  1 0 0 0 0
  1 0 0 0 1
  0 1 0 1 0
Interpreted as an adjacency matrix it describes the following graph, where each number is connected to its neighbors, and only the 2 is connected to itself:
  2 5 4 1 3
This is row 5 of the triangular array.
		

Crossrefs

A236267 a(n) = 8*n^2 + 3*n + 1.

Original entry on oeis.org

1, 12, 39, 82, 141, 216, 307, 414, 537, 676, 831, 1002, 1189, 1392, 1611, 1846, 2097, 2364, 2647, 2946, 3261, 3592, 3939, 4302, 4681, 5076, 5487, 5914, 6357, 6816, 7291, 7782, 8289, 8812, 9351, 9906, 10477, 11064, 11667, 12286, 12921, 13572, 14239, 14922, 15621, 16336
Offset: 0

Views

Author

Vladimir Shevelev, Jan 21 2014

Keywords

Comments

Positions a(n) of hexagonal numbers such that h(a(n)) = h(a(n)-1) + h(4*n+1), where h = A000384.
First bisection of A057029. The sequence contains infinitely many squares: 1, 676, 779689, 899760016, ... [Bruno Berselli, Jan 24 2014]

Examples

			For n=5, A000384(a(5)) = 93096 = A000384(a(5)-1) + A000384(4*5+1) = 92235 + 861.
		

Crossrefs

Programs

  • Magma
    [8*n^2+3*n+1: n in [0..50]]; // Bruno Berselli, Jan 24 2014
  • Mathematica
    Table[8 n^2 + 3 n + 1, {n, 0, 50}] (* Bruno Berselli, Jan 24 2014 *)
    LinearRecurrence[{3,-3,1},{1,12,39},50] (* Harvey P. Dale, May 26 2019 *)
  • PARI
    Vec(-(6*x^2+9*x+1)/(x-1)^3 + O(x^100)) \\ Colin Barker, Jan 21 2014
    

Formula

From Colin Barker, Jan 21 2014: (Start)
G.f.: -(6*x^2 + 9*x + 1)/(x-1)^3.
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3). (End)
E.g.f.: exp(x)*(1 + 11*x + 8*x^2). - Elmo R. Oliveira, Oct 19 2024

Extensions

More terms from Colin Barker, Jan 21 2014
a(44)-a(45) from Elmo R. Oliveira, Oct 19 2024

A277983 a(n) = 54*n^2 - 78*n + 36.

Original entry on oeis.org

36, 12, 96, 288, 588, 996, 1512, 2136, 2868, 3708, 4656, 5712, 6876, 8148, 9528, 11016, 12612, 14316, 16128, 18048, 20076, 22212, 24456, 26808, 29268, 31836, 34512, 37296, 40188, 43188, 46296, 49512, 52836, 56268, 59808, 63456, 67212, 71076, 75048, 79128, 83316
Offset: 0

Views

Author

Emeric Deutsch, Nov 11 2016

Keywords

Comments

For n>=1, a(n) is the second Zagreb index of the triangular grid graph T[n] (see the West reference, p. 390). The second Zagreb index of a simple connected graph is the sum of the degree products d(i)d(j) over all edges ij of the graph.
The M-polynomial of the triangular grid graph T[n] is M(T[n], x, y) = 6*x^2*y^4 + 3*(n-1)*x^4*y^4 +6*(n-2)*x^4*y^6+3*(n-2)*(n-3)*x^6*y^6/2.

References

  • D. B. West, Introduction to Graph Theory, 2nd edition, Prentice-Hall, 2001.

Crossrefs

Cf. A153792.

Programs

  • Magma
    [54*n^2-78*n+36: n in [0..50]]; // Bruno Berselli, Nov 11 2016
    
  • Maple
    seq(54*n^2-78*n+36, n=0..40);
  • Mathematica
    Table[54 n^2 - 78 n + 36, {n, 0, 50}] (* Bruno Berselli, Nov 11 2016 *)
  • PARI
    a(n)=54*n^2-78*n+36 \\ Charles R Greathouse IV, Jun 17 2017
  • Sage
    [54*n^2-78*n+36 for n in range(50)] # Bruno Berselli, Nov 11 2016
    

Formula

O.g.f.: 12*(14*x^2 - 8*x + 3)/(1 - x)^3.
E.g.f.: 6*(9*x^2 - 4*x + 6)*exp(x). - Bruno Berselli, Nov 11 2016
a(n) = 3*a(n-1)-3*a(n-2)+a(n-3). - Wesley Ivan Hurt, Jan 15 2022
a(n) = 12*A064225(n-1). - R. J. Mathar, Jul 22 2022
Showing 1-9 of 9 results.