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

A368045 Triangle read by rows. T(n, k) = (k*(k + 1)*(2*k + 1) + n*(n + 1)*(2*n + 1)) / 6.

Original entry on oeis.org

0, 1, 2, 5, 6, 10, 14, 15, 19, 28, 30, 31, 35, 44, 60, 55, 56, 60, 69, 85, 110, 91, 92, 96, 105, 121, 146, 182, 140, 141, 145, 154, 170, 195, 231, 280, 204, 205, 209, 218, 234, 259, 295, 344, 408, 285, 286, 290, 299, 315, 340, 376, 425, 489, 570
Offset: 0

Views

Author

Peter Luschny, Dec 09 2023

Keywords

Comments

Consider a sequence-to-triangle transformation a -> T, where a is a 0-based sequence and T a regular (0, 0)-based triangular array. The transformation is recursively defined, starting with T(0, 0) = 0, and T(n, n) = a(n) + T(n, n - 1) for n > 0. For k <> n let T(n, k) = a(n) + T(n-1, k).
If a(n) = 1, then T = A051162; if a(n) = n, then T = A367964 (generalizing the triangular numbers); if a(n) = n^2, then T is this triangle.
In the multiplicative form of the transformation, T(0, 0) is set to 1, and the operation '+' is replaced by '*'. For instance, a(n) = 2 is then mapped to T = A368043 and a(n) = n to A143216.

Examples

			Triangle T(n, k) starts:
  [0] [  0]
  [1] [  1,   2]
  [2] [  5,   6,  10]
  [3] [ 14,  15,  19,  28]
  [4] [ 30,  31,  35,  44,  60]
  [5] [ 55,  56,  60,  69,  85, 110]
  [6] [ 91,  92,  96, 105, 121, 146, 182]
  [7] [140, 141, 145, 154, 170, 195, 231, 280]
  [8] [204, 205, 209, 218, 234, 259, 295, 344, 408]
  [9] [285, 286, 290, 299, 315, 340, 376, 425, 489, 570]
		

Crossrefs

Cf. A000330 (T(n,0)), A056520 (T(n,1)), A005900 (T(n-1,n)), A006331 (T(n,n)), A094952 (T(2*n,n)), A368046 (row sums), A368047 (alternating row sums).
Cf. A051162 (transform of n^0), A367964 (transform of n^1), this sequence (transform of n^2).

Programs

  • Mathematica
    Module[{n=1},NestList[Append[#+n^2,Last[#]+2(n++^2)]&,{0},10]] (* or *)
    Table[(k(k+1)(2k+1)+n(n+1)(2n+1))/6,{n,0,10},{k,0,n}] (* Paolo Xausa, Dec 10 2023 *)
  • Python
    from functools import cache
    @cache
    def Trow(n: int) -> list[int]:
        if n == 0: return [0]
        row = Trow(n - 1) + [0]
        for k in range(n): row[k] += n * n
        row[n] = row[n - 1] + n * n
        return row
    print([k for n in range(10) for k in Trow(n)])

Formula

T(n, k) = A000330(k) + A000330(n).

A180174 Triangle read by rows of the numbers C(n,k) of k-subsets of a quadratically populated n-multiset M.

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 3, 5, 7, 9, 10, 10, 10, 10, 10, 9, 7, 5, 3, 1, 1, 4, 9, 16, 25, 35, 45, 55, 65, 75, 84, 91, 96, 99, 100, 100, 100, 99, 96, 91, 84, 75, 65, 55, 45, 35, 25, 16, 9, 4, 1, 1, 5, 14, 30, 55, 90, 135, 190, 255, 330, 414, 505, 601, 700, 800, 900, 1000, 1099
Offset: 0

Views

Author

Thomas Wieder, Aug 15 2010

Keywords

Comments

The multiplicity m(i) of the i-th element with 1 <= i <= n is m(i)=i^2.
Thus M=[1,2,2,2,2,...,i^2 x i,...,n^2 x n].
Row sum is equal to A028361.
Column for k=2 is equal to AA000096.
Column for k=3 is equal to AA005581.
Column for k=4 is equal to AA005582.
The number of coefficients C(n,k) for given n is equal to A056520.

Examples

			For n=4 one has M=[1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4].
For k=7 we have 55 subsets from M:
[1, 2, 2, 3, 3, 4, 4], [1, 2, 3, 3, 4, 4, 4], [1, 2, 3, 3, 3, 4, 4],
[1, 2, 2, 3, 4, 4, 4], [1, 2, 2, 3, 3, 3, 4], [1, 2, 2, 2,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 3, 3, 3],
[4, 4, 4, 4, 4, 4, 4].
		

Crossrefs

Programs

  • Maple
    with(combinat)
    kend := 4;
    Liste := NULL;
    for k from 0 to kend do
    Liste := Liste, `$`(k, k^2)
    end do;
    Liste := [Liste];
    for k from 0 to 2^(kend+1)-1 do
    Teilergebnis[k] := choose(Liste, k)
    end do;
    seq(nops(Teilergebnis[k]), k = 0 .. 2^(kend+1)-1)
    ' Excel VBA
    Sub A180174()
    Dim n As Long, nend As Long, k As Long, kk As Long, length_row As Long, length_sum As Long
    Dim ATable(10, -1000 To 1000) As Double, Summe As Double
    Dim offset_row As Integer, offset_column As Integer
    Worksheets("Tabelle2").Select
    Cells.Select
    Selection.ClearContents
    Range("A1").Select
    offset_row = 1
    offset_column = 1
    nend = 7
    ATable(0, 0) = 1
    Cells(0 + offset_row, 0 + offset_column) = 1
    For n = 1 To nend
    length_row = n * (n + 1) * (2 * n + 1) / 6
    length_sum = n ^ 2 + 1
    For k = 0 To length_row / 2
    Summe = 0
    For kk = k - length_sum + 1 To k
    Summe = Summe + ATable(n - 1, kk)
    Next kk
    ATable(n, k) = Summe
    Cells(n + offset_row, k + offset_column) = ATable(n, k)
    ATable(n, length_row - k) = Summe
    Cells(n + offset_row, length_row - k + 0 + offset_column) = ATable(n, k)
    Next k
    Next n
    End Sub

Formula

C(0,0) = 0.
C(n,k) = sum_{j=(k-LS+1)}^{k} C(n-1,j).
for n > 0 and k=1,...,LR with LS = n^2+1 and LR = n*(n+1)*(2*n+1)/6.
C(n,k) = C(n,LR-k).

A214651 Count down from n to 1, n times.

Original entry on oeis.org

1, 2, 1, 2, 1, 3, 2, 1, 3, 2, 1, 3, 2, 1, 4, 3, 2, 1, 4, 3, 2, 1, 4, 3, 2, 1, 4, 3, 2, 1, 5, 4, 3, 2, 1, 5, 4, 3, 2, 1, 5, 4, 3, 2, 1, 5, 4, 3, 2, 1, 5, 4, 3, 2, 1, 6, 5, 4, 3, 2, 1, 6, 5, 4, 3, 2, 1, 6, 5, 4, 3, 2, 1, 6, 5, 4, 3, 2, 1, 6, 5, 4, 3, 2, 1, 6, 5
Offset: 1

Views

Author

Arkadiusz Wesolowski, Jul 24 2012

Keywords

Comments

This sequence contains every positive integer infinitely often.
This is a fractal sequence. Striking out the first instance of every term produces 1, 2, 1, 2, 1, 3, 2, 1, 3, 2, 1, 3, ..., which is the same as the original sequence, as far as it goes.

Examples

			1;
2, 1, 2, 1;
3, 2, 1, 3, 2, 1, 3, 2, 1;
...
		

Crossrefs

Cf. A056520 (locations of new values), A060432 (locations of 1's).
Cf. A000290 (row lengths), A002411 (row sums), A036740 (row products).

Programs

  • Mathematica
    f[n_] := Table[Range[n, 1, -1], {n}]; Flatten@Array[f, 6] (* Wesolowski *)
    Flatten[Table[Table[Range[n, 1, -1], {n}], {n, 6}]] (* Alonso del Arte, Jul 24 2012 *)

A215147 For n odd, a(n) = 1^2+2^2+3^2+...+n^2; for n even, a(n) = (1^2+2^2+3^2+...+n^2)+1.

Original entry on oeis.org

1, 2, 5, 6, 14, 15, 30, 31, 55, 56, 91, 92, 140, 141, 204, 205, 285, 286, 385, 386, 506, 507, 650, 651, 819, 820, 1015, 1016, 1240, 1241, 1496, 1497, 1785, 1786, 2109, 2110, 2470, 2471, 2870, 2871, 3311, 3312, 3795, 3796, 4324, 4325, 4900, 4901, 5525, 5526
Offset: 1

Views

Author

Kritsana Sokhuma, Aug 04 2012

Keywords

Comments

Square pyramidal numbers when n is odd.
An interleaving of A000330 and A056520. - Michel Marcus, Aug 07 2013

Crossrefs

Programs

  • Maple
    for i from 1 to 100 do a(2*i-1):=sum('k^2','k'=1..i);
    a(2*i):=a(2*i-1)+1; end do;
  • Mathematica
    LinearRecurrence[{1, 3, -3, -3, 3, 1, -1}, {1, 2, 5, 6, 14, 15, 30}, 50] (* or *)
    Riffle[#, #+1] & [Accumulate[Range[25]^2]] (* Paolo Xausa, Feb 22 2024 *)

Formula

From Colin Barker, Nov 16 2012: (Start)
a(n) = (6*(5+3*(-1)^n)+(13-9*(-1)^n)*n-3*(-3+(-1)^n)*n^2+2*n^3)/48.
G.f.: -x*(x^6-x^5-2*x^4+2*x^3-x-1)/((x-1)^4*(x+1)^3). (End)

Extensions

More terms from Paolo Xausa, Feb 22 2024

A263689 a(n) = (2*n^6 - 6*n^5 + 5*n^4 - n^2 + 12)/12.

Original entry on oeis.org

1, 1, 2, 34, 277, 1301, 4426, 12202, 29009, 61777, 120826, 220826, 381877, 630709, 1002002, 1539826, 2299201, 3347777, 4767634, 6657202, 9133301, 12333301, 16417402, 21571034, 28007377, 35970001, 45735626, 57617002, 71965909, 89176277, 109687426, 133987426, 162616577, 196171009, 235306402, 280741826
Offset: 0

Views

Author

Ilya Gutkovskiy, Nov 20 2015

Keywords

Examples

			a(0) = 1,
a(1) = 0^5 + 1 = 1,
a(2) = 1^5 + 1 = 2,
a(3) = 2^5 + 2 = 34,
a(4) = 3^5 + 34 = 227,
a(5) = 4^5 + 227 = 1301, etc.
		

Crossrefs

Programs

  • Mathematica
    Table[(1/12) (12 + (-1 + n)^2 n^2 (-1 + 2 (-1 + n) n)), {n, 0, 35}]
  • PARI
    first(m)=vector(m,n,n--;(2*n^6 - 6*n^5 + 5*n^4 - n^2 + 12)/12) \\ Anders Hellström, Nov 20 2015

Formula

G.f.: (1 - 6*x + 16*x^2 + 6*x^3 + 81*x^4 + 20*x^5 + 2*x^6)/(1 - x)^7.
a(n + 1) = a(n) + n^5, a(0) = 1.
a(n + 1) - a(n) = A000584(n).
a(n + 1) = A000539(n) + 1.
Sum_{n>0} 1/(a(n + 1) - a(n)) = zeta(5) = 1.036927755...

A267691 a(n) = (n + 1)*(6*n^4 - 21*n^3 + 31*n^2 - 31*n + 30)/30.

Original entry on oeis.org

1, 1, 2, 18, 99, 355, 980, 2276, 4677, 8773, 15334, 25334, 39975, 60711, 89272, 127688, 178313, 243849, 327370, 432346, 562667, 722667, 917148, 1151404, 1431245, 1763021, 2153646, 2610622, 3142063, 3756719, 4464000, 5274000, 6197521, 7246097, 8432018, 9768354
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 19 2016

Keywords

Examples

			a(0) = 1,
a(1) = 1 + 0^4 = 1,
a(2) = 1 + 1^4 = 2,
a(3) = 2 + 2^4 = 18,
a(4) = 18+ 3^4 = 99, etc.
		

Crossrefs

Essentially the same as A000538.
Cf. A013662 (zeta(4)).

Programs

  • Magma
    [(n+1)*(6*n^4-21*n^3+31*n^2-31*n+30)/30: n in [0..35]]; // Vincenzo Librandi, Jan 20 2016
  • Mathematica
    Table[(n + 1) (6 n^4 - 21 n^3 + 31 n^2 - 31 n + 30)/30, {n, 0, 30}]
    LinearRecurrence[{6, -15, 20, -15, 6, -1}, {1, 1, 2, 18, 99, 355}, 40] (* Vincenzo Librandi, Jan 20 2016 *)
  • PARI
    a(n)=(n+1)*(6*n^4-21*n^3+31*n^2-31*n+30)/30 \\ Charles R Greathouse IV, Jan 19 2016
    
  • PARI
    Vec((1-5*x+11*x^2+x^3+16*x^4)/(x-1)^6 + O(x^100)) \\ Altug Alkan, Jan 19 2016
    

Formula

G.f.: (1 - 5*x + 11*x^2 + x^3 + 16*x^4)/(1 - x)^6.
a(n + 1) = a(n) + n^4.
a(n + 1) = A000538(n) + 1.
a(n + 2) - a(n) = A008514(n).
Sum_{n>=0} 1/a(n) = 2.570450909491318975...
Sum_{n>=1} 1/(a(n + 1) - a(n)) = zeta(4) = Pi^4/90.

A338819 The entries in the rows of the n X n identity matrix, multiplied by the size of the matrix (n).

Original entry on oeis.org

1, 2, 0, 0, 2, 3, 0, 0, 0, 3, 0, 0, 0, 3, 4, 0, 0, 0, 0, 4, 0, 0, 0, 0, 4, 0, 0, 0, 0, 4, 5, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 5, 6, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 6, 7, 0
Offset: 1

Views

Author

Julia Zimmerman, Nov 10 2020

Keywords

Examples

			For every identity matrix of size n starting with n=1, append n*(each entry of each row of the matrix), e.g., n=1 -> 1, n=2 -> 2,0,0,2, so the first 5 terms of the sequence are 1,2,0,0,2.
		

Crossrefs

Cf. A191747 (with 1's), A191748 (locations of nonzero terms), A056520 (start location of each matrix).

Programs

  • Python
    import numpy as np
    def n_id_sequence(iterations):
        sequence = []
        for i in range(1,iterations+1):
            matrix = i*(np.identity(i))
            for row in matrix:
                for entry in row:
                    sequence.append(int(entry))
        return sequence

A386319 Triangle read by rows where row n is the start, corner and end vertex numbers of a triangular spiral with n sides on a triangular grid, starting from 1 and working inwards (0 <= k <= n).

Original entry on oeis.org

1, 1, 1, 1, 2, 3, 1, 3, 5, 6, 1, 4, 7, 9, 10, 1, 5, 9, 12, 14, 15, 1, 6, 11, 15, 18, 20, 21, 1, 7, 13, 18, 22, 25, 27, 28, 1, 8, 15, 21, 26, 30, 33, 35, 36, 1, 9, 17, 24, 30, 35, 39, 42, 44, 45, 1, 10, 19, 27, 34, 40, 45, 49, 52, 54, 55, 1, 11, 21, 30, 38, 45, 51, 56, 60, 63, 65, 66, 1, 12, 23, 33, 42, 50, 57, 63, 68, 72, 75, 77, 78
Offset: 0

Views

Author

Binay Krishna Maity, Jul 18 2025

Keywords

Comments

The first 2 sides are length n-1 so that T(n,1) = 1 + (n-1) and T(n,2) = 1 + 2*(n-1) and then the side lengths decrease by 1 each time as it spirals in (ending at triangular number A000217(n) when n>=1).
These sides mesh to fill the triangle as they go inwards, and can also be thought of going outwards tracing out the sides of the triangle.
The resulting vertex numbers are 1 together with row n of A141419.
Row n=1 is taken as a side of length 0 so the start and end numbers are both 1 (which is not really a spiral but is consistent with the formula and two points 1,2 would be even less like a triangle filled by a spiral).

Examples

			Triangle begins:
--------------------------------------
   n\k  0   1   2   3   4   5   6   7
--------------------------------------
   0|   1;
   1|   1,  1;
   2|   1,  2,  3;
   3|   1,  3,  5,  6;
   4|   1,  4,  7,  9, 10;
   5|   1,  5,  9, 12, 14, 15;
   6|   1,  6, 11, 15, 18, 20, 21;
   7|   1,  7, 13, 18, 22, 25, 27, 28;
  ...
For n = 2 the spiral is 2 sides of length 1 so row [1, 2, 3],
   1 --- 2
       /
     3
For n = 4 the spiral is:
   1  2  3  4
    9  10  5
      8  6
        7
The start, corner and end vertices are [1, 4, 7, 9, 10].
		

Crossrefs

Columns: A000012 (k=0), A000027 (k=1), A144396 (k=3).
Cf. A179865(n+1) (main diagonal), A056520 (row sums).

Programs

  • Mathematica
    T[n_,k_]:=If[k==0,1,k(2n-k+1)/2];Table[T[n,k],{n,0,12},{k,0,n}]//Flatten (* James C. McMahon, Jul 31 2025 *)

Formula

T(n,0) = 1.
T(n,k) = k*(2*n - k + 1)/2 for k >= 1.
Previous Showing 11-18 of 18 results.