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

A386478 Array read by upward antidiagonals: T(k,n) = 1 (k = 0, n >= 0), T(k,n) = k^2*n^2/2 - (3*k-4)*n/2 + 1 (k >= 1, n >= 0).

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 2, 4, 1, 1, 3, 7, 7, 1, 1, 5, 14, 16, 11, 1, 1, 8, 25, 34, 29, 16, 1, 1, 12, 40, 61, 63, 46, 22, 1, 1, 17, 59, 97, 113, 101, 67, 29, 1, 1, 23, 82, 142, 179, 181, 148, 92, 37, 1, 1, 30, 109, 196, 261, 286, 265, 204, 121, 46, 1, 1, 38, 140, 259, 359, 416, 418, 365, 269, 154, 56, 1, 1, 47, 175, 331, 473, 571, 607, 575, 481, 343, 191, 67, 1
Offset: 0

Views

Author

N. J. A. Sloane, Jul 24 2025

Keywords

Comments

A k-chain is a planar graph consisting of a continuous path made up of k straight segments. T(k,n) is the maximum number of regions the plane can be divided into by drawing n k-chains.
The array is almost symmetric: the difference between T(k,n) and T(n,k) is 2*|k-n| (which is exactly the difference between the numbers of infinite regions). All the rows and columns satisfy the recurrence u(n) = 3*u(n-1) - 3*u(n-2) + u(n-3).

Examples

			Array begins (the rows are T(0,n>=0),, T(1,n>=0), T(2,n>=0), ...):
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
  1, 2, 4, 7, 11, 16, 22, 29, 37, ...
  1, 2, 7, 16, 29, 46, 67, 92, 121, ...
  1, 3, 14, 34, 63, 101, 148, 204, 269, ...
  1, 5, 25, 61, 113, 181, 265, 365, 481, ...
  1, 8, 40, 97, 179, 286, 418, 575, 757, ...
  1, 12, 59, 142, 261, 416, 607, 834, 1097, ...
  1, 17, 82, 196, 359, 571, 832, 1142, 1501, ...
  1, 23, 109, 259, 473, 751, 1093, 1499, 1969, ...
  ...
The first few antidiagonals are:
  1,
  1, 1,
  1, 2, 1,
  1, 2, 4, 1,
  1, 3, 7, 7, 1,
  1, 5, 14, 16, 11, 1,
  1, 8, 25, 34, 29, 16, 1,
  1, 12, 40, 61, 63, 46, 22, 1,
  ...
		

References

  • David O. H. Cutler and N. J. A. Sloane, paper in preparation, August 1 2025.

Crossrefs

The first few rows are A000124, A130883, A140064, A080856, A383465.
The n=1 and 2 columns are A152948 and A386479.

Programs

  • Mathematica
    A386478[k_, n_] := If[k == 0, 1, ((k*n - 3)*k + 4)*n/2 + 1];
    Table[A386478[k - n, n], {k, 0, 12}, {n, 0, k}] (* Paolo Xausa, Jul 26 2025 *)

Extensions

Row 0 added by N. J. A. Sloane, Jul 26 2025

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=', ')

A192136 a(n) = (5*n^2 - 3*n + 2)/2.

Original entry on oeis.org

1, 2, 8, 19, 35, 56, 82, 113, 149, 190, 236, 287, 343, 404, 470, 541, 617, 698, 784, 875, 971, 1072, 1178, 1289, 1405, 1526, 1652, 1783, 1919, 2060, 2206, 2357, 2513, 2674, 2840, 3011, 3187, 3368, 3554, 3745, 3941, 4142, 4348, 4559, 4775, 4996, 5222, 5453, 5689
Offset: 0

Views

Author

Eric Werley, Jun 24 2011

Keywords

Comments

Binomial transform of [1, 1, 5, 0, 0, 0, 0, 0, ...]. - Johannes W. Meijer, Jul 07 2011

Crossrefs

Programs

Formula

a(n) = (5*n^2 - 3*n + 2)/2.
a(n) = 2*a(n-1) - a(n-2) + 5.
a(n) = a(n-1) + 5*n - 4.
a(n) = 5*binomial(n+2,2) - 9*n - 4.
a(n) = A000217(n+1) - A000217(n) + 5*A000217(n-1); triangular numbers. - Johannes W. Meijer, Jul 07 2011
O.g.f.: (1-x+5*x^2)/(1-x)^3.
From Elmo R. Oliveira, Nov 16 2024: (Start)
E.g.f.: exp(x)*(2 + 2*x + 5*x^2)/2.
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3) for n > 2. (End)

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

A383464 a(n) = 8*n^2 - 5*n + 1.

Original entry on oeis.org

1, 4, 23, 58, 109, 176, 259, 358, 473, 604, 751, 914, 1093, 1288, 1499, 1726, 1969, 2228, 2503, 2794, 3101, 3424, 3763, 4118, 4489, 4876, 5279, 5698, 6133, 6584, 7051, 7534, 8033, 8548, 9079, 9626, 10189, 10768, 11363, 11974, 12601, 13244, 13903, 14578, 15269
Offset: 0

Views

Author

N. J. A. Sloane, Jun 26 2025

Keywords

Comments

This is equal to A139272(n) + 1, but has its own entry because of an important geometrical interpretation.
Definition: A k-legged Wu is a pencil of k semi-infinite lines originating from a common point.
A 2-legged Wu is a long-legged V (see A130883), and a 3-legged Wu is a long-legged Wu as in A140064.
Theorem (David Cutler, Jonathan Pei, and Edward Xiong, Jun 24 2025): a(n) is the maximum number of regions in the plane that can be formed from n copies of a 4-legged Wu.
Proof: [To be added]

Crossrefs

Programs

  • Magma
    I:=[1, 4, 23]; [n le 3 select I[n] else 3*Self(n-1)-3* Self(n-2)+Self(n-3): n in [1..40]]; // Vincenzo Librandi, Jun 27 2025
  • Mathematica
    LinearRecurrence[{3,-3,1},{1,4,23},50] (* Vincenzo Librandi, Jun 27 2025 *)

Formula

G.f.: (1 + x + 14*x^2)/(1 - x)^3.
E.g.f.: exp(x)*(1 + 3*x + 8*x^2). - Stefano Spezia, Jun 30 2025

A140065 a(n) = (7*n^2 - 17*n + 12)/2.

Original entry on oeis.org

1, 3, 12, 28, 51, 81, 118, 162, 213, 271, 336, 408, 487, 573, 666, 766, 873, 987, 1108, 1236, 1371, 1513, 1662, 1818, 1981, 2151, 2328, 2512, 2703, 2901, 3106, 3318, 3537, 3763, 3996, 4236, 4483, 4737, 4998, 5266, 5541, 5823, 6112, 6408, 6711, 7021, 7338, 7662
Offset: 1

Views

Author

Gary W. Adamson, May 03 2008

Keywords

Comments

Binomial transform of [1, 2, 7, 0, 0, 0, ...].
This sequence together with 1, 6, 18, 37, 63, 96, ... with signature (3,-3,1) [not yet in OEIS] contain all numbers k such that 56*k - 47 is a square. - Klaus Purath, Oct 21 2021

Examples

			a(4) = 28 = (1, 3, 3, 1) * (1, 2, 7, 0) = (1 + 6 + 21 + 0).
		

Crossrefs

Programs

  • Magma
    [(7*n^2 - 17*n + 12)/2 : n in [1..60]]; // Wesley Ivan Hurt, Oct 10 2021
  • Maple
    seq((12-17*n+7*n^2)*1/2, n=1..40); # Emeric Deutsch, May 07 2008
  • Mathematica
    Table[(7 n^2 - 17 n + 12)/2, {n, 1, 50}] (* Bruno Berselli, Mar 12 2015 *)
    LinearRecurrence[{3,-3,1},{1,3,12},50] (* Harvey P. Dale, May 28 2017 *)
  • PARI
    x = 'x + O('x^50); Vec(x*(1+6*x^2)/(1-x)^3) \\ G. C. Greubel, Feb 23 2017
    

Formula

A007318 * [1, 2, 7, 0, 0, 0, ...].
a(n) = A000217(n) + 6*A000217(n-2) = (A140064(n) + A140066(n))/2. - R. J. Mathar, May 06 2008
O.g.f.: x*(1+6*x^2)/(1-x)^3. - Alexander R. Povolotsky, May 06 2008
a(n) = 7*n + a(n-1) - 12 for n > 1, a(1)=1. - Vincenzo Librandi, Jul 08 2010
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3), n >= 4. - Klaus Purath, Oct 21 2021
E.g.f.: exp(x)*(6 - 5*x + 7*x^2/2) - 6. - Elmo R. Oliveira, Oct 31 2024

Extensions

More terms from R. J. Mathar and Emeric Deutsch, May 06 2008
More terms from Vladimir Joseph Stephan Orlovsky, Oct 25 2008

A386481 Array read by upward antidiagonals: T(k,n) = 1 (k = 0, n >= 0), T(k,n) = binomial(n,2)*k^2 + n*(k-1) + 1 (k >= 1, n >= 0).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 3, 7, 4, 1, 1, 4, 14, 16, 7, 1, 1, 5, 23, 34, 29, 11, 1, 1, 6, 34, 58, 63, 46, 16, 1, 1, 7, 47, 88, 109, 101, 67, 22, 1, 1, 8, 62, 124, 167, 176, 148, 92, 29, 1, 1, 9, 79, 166, 237, 271, 259, 204, 121, 37, 1, 1, 10, 98, 214, 319, 386, 400, 358, 269, 154, 46, 1, 1, 11, 119, 268, 413, 521, 571, 554, 473, 343, 191, 56, 1
Offset: 0

Views

Author

N. J. A. Sloane, Aug 11 2025

Keywords

Comments

T(k,n) is the maximum number of regions the plane can be divided into by drawing n k-armed long-legged V's.

Examples

			Array begins (the rows are T(0,n>=0),, T(1,n>=0), T(2,n>=0), ...):
   1, 1, 1, 1, 1, 1, 1, 1, 1, ...
   1, 1, 2, 4, 7, 11, 16, 22, 29, ...
   1, 2, 7, 16, 29, 46, 67, 92, 121, ...
   1, 3, 14, 34, 63, 101, 148, 204, 269, ...
   1, 4, 23, 58, 109, 176, 259, 358, 473, ...
   1, 5, 34, 88, 167, 271, 400, 554, 733, ...
   1, 6, 47, 124, 237, 386, 571, 792, 1049, ...
   1, 7, 62, 166, 319, 521, 772, 1072, 1421, ...
    ...
The first few antidiagonals are:
    1,
    1, 1,
    1, 1, 1,
    1, 2, 2, 1,
    1, 3, 7, 4, 1,
    1, 4, 14, 16, 7, 1,
    1, 5, 23, 34, 29, 11, 1,
    1, 6, 34, 58, 63, 46, 16, 1,
    1, 7, 47, 88, 109, 101, 67, 22, 1,
     ...
		

References

  • David O. H. Cutler and N. J. A. Sloane, paper in preparation, August 1 2025.

Crossrefs

This is a companion to the array A386478.
The rows and columns include A000124, A130883, A140064, A383464, and A008865.

Extensions

Under construction, please do not touch.
Showing 1-7 of 7 results.