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 31-40 of 47 results. Next

A062862 Number of ways n can be written as the sum of squares of consecutive numbers (possibly including squares of negative numbers).

Original entry on oeis.org

1, 4, 1, 0, 2, 4, 2, 0, 0, 2, 1, 0, 0, 2, 4, 2, 2, 0, 0, 2, 0, 0, 0, 0, 0, 4, 0, 0, 1, 2, 4, 2, 0, 0, 0, 2, 2, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 0, 0, 2, 2, 0, 0, 0, 2, 4, 2, 0, 0, 0, 3, 2, 0, 0, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 4, 2, 0, 0, 0, 2, 4, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0
Offset: 0

Views

Author

Henry Bottomley, Jun 25 2001

Keywords

Examples

			a(25)=4 since 25 = 5^2 = 3^2+4^2 = (-4)^2+(-3)^2 = (-5)^2.
		

Crossrefs

If a(n) is zero then n is in A062863, otherwise in A062861. If a(n) is odd then n is in A006331.

A108582 n appears n^3 times.

Original entry on oeis.org

1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 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, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5
Offset: 1

Views

Author

Jonathan Vos Post, Jul 25 2005

Keywords

Comments

From Jonathan Vos Post, Mar 18 2006: (Start)
The key to this sequence is: 1^3 + 2^3 + 3^3 + ... + n^3 = (1+2+3+...+n)^2.
Since the last occurrence of n comes one before the first occurrence of n+1 and the former is at Sum_{i=0..n} i^3 = A000537(n) = (A000217(n))^2 = (n*(n+1)/2)^2 = (C(n+1,2))^2, have a(A000537(n)) = a((A000217(n))^2) = n and thus a(1+A000537(n)) = a(1+(A000217(n))^2) = n+1.
The current sequence is, loosely, the inverse function of the square of the triangular number sequence. (End)

Crossrefs

Programs

  • Mathematica
    Flatten @ Table[ Table[k, {k^3}], {k, 5}] (* Giovanni Resta, Jun 17 2016 *)
    a[n_]:=Ceiling[1/2 (Sqrt[8 Sqrt[n]+1]-1)]
    Nmax=225; Table[a[n],{n,1,Nmax}] (* Boris Putievskiy, Jun 19 2024 *)
  • Python
    from sympy import integer_nthroot
    def A108582(n): return (m:=integer_nthroot(k:=n<<2,4)[0])+(k>(m*(m+1))**2) # Chai Wah Wu, Nov 04 2024

Formula

a(n) = ceiling((1/2)*(sqrt(8*sqrt(n) + 1) - 1)). - Boris Putievskiy, Jun 19 2024
From Chai Wah Wu, Nov 04 2024: (Start)
a(n) = m+1 if n>(m(m+1))^2/4 and a(n) = m otherwise where m = floor((4n)^(1/4)).
More generally, for a sequence a_k(n) where n appears n^(k-1) times, a_k(n) = m+1 if n > Sum_{i=1..m} i^(k-1) and a_k(n) = m otherwise where m = floor((kn)^(1/k)).
Note that Sum_{i=1..m} i^(k-1) can be written as a k-th order polynomial of m using Faulhaber's formula. (End)

Extensions

Two missing terms from Giovanni Resta, Jun 17 2016

A112524 a(n) = a(n-1) + 2*n^2 with a(1) = 1.

Original entry on oeis.org

1, 9, 27, 59, 109, 181, 279, 407, 569, 769, 1011, 1299, 1637, 2029, 2479, 2991, 3569, 4217, 4939, 5739, 6621, 7589, 8647, 9799, 11049, 12401, 13859, 15427, 17109, 18909, 20831, 22879, 25057, 27369, 29819, 32411, 35149, 38037, 41079, 44279, 47641
Offset: 1

Views

Author

Dennis Farr (dfarr(AT)comcast.net), Dec 13 2005

Keywords

Comments

This is the total number of operations or total storage if a process first replaces a square array by an array one smaller, repeatedly down to 1 and then regrows the array to the original size.

Crossrefs

Cf. A006331.

Programs

  • Magma
    [n*(n+1)*(2*n+1)/3 - 1: n in [1..40]]; // G. C. Greubel, Jan 12 2022
  • Maple
    a[1]:=1: for n from 2 to 50 do a[n]:=a[n-1]+2*n^2 od: seq(a[n],n=1..50); # Emeric Deutsch, Feb 13 2006
    a:=n->sum(k^2, k=1..n):seq(a(n)+sum(k^2, k=2..n), n=1...40); # Zerinvary Lajos, Jun 11 2008
  • Mathematica
    Table[n*(n+1)*(2n+1)/3 - 1, {n, 50}] (* Stefan Steinerberger, Mar 11 2006 *)
    2*Accumulate[Range[50]^2]-1 (* or *) LinearRecurrence[{4,-6,4,-1},{1,9,27,59},50] (* Harvey P. Dale, Dec 03 2012 *)
  • Sage
    [n*(n+1)*(2*n+1)/3 - 1 for n in (1..40)] # G. C. Greubel, Jan 12 2022
    

Formula

Twice the sum of the first n square numbers - 1 = n*(n + 1)*(2n + 1)/3 - 1. - Stefan Steinerberger, Mar 11 2006
From R. J. Mathar, Sep 09 2008: (Start)
G.f.: x*(1 +5*x -3*x^2 +x^3)/(1-x)^4.
a(n) = A006331(n) - 1. (End)
a(n) = 4*a(n-1) - 6*a(n-2) + 4*a(n-3) - a(n-4), a(1)=1, a(2)=9, a(3)=27, a(4)=59. - Harvey P. Dale, Dec 03 2012
E.g.f.: ( 3 + (-3 + 6*x + 9*x^2 + 2*x^3)*exp(x) )/3. - G. C. Greubel, Jan 12 2022

Extensions

Definition corrected by Alexandre Wajnberg, Jan 02 2006
More terms from Emeric Deutsch, Feb 13 2006
More terms from Stefan Steinerberger, Mar 11 2006

A183157 Triangle read by rows: T(n,k) is the number of partial isometries of an n-chain of height k (height of alpha = |Im(alpha)|).

Original entry on oeis.org

1, 1, 1, 1, 4, 2, 1, 9, 10, 2, 1, 16, 28, 12, 2, 1, 25, 60, 40, 14, 2, 1, 36, 110, 100, 54, 16, 2, 1, 49, 182, 210, 154, 70, 18, 2, 1, 64, 280, 392, 364, 224, 88, 20, 2, 1, 81, 408, 672, 756, 588, 312, 108, 22, 2, 1, 100, 570, 1080, 1428, 1344, 900, 420, 130, 24, 2
Offset: 0

Views

Author

Abdullahi Umar, Dec 28 2010

Keywords

Comments

Rows also give the coefficients of the clique polynomial of the n X n bishop graph. - Eric W. Weisstein, Jun 04 2017

Examples

			T (3,2) = 10 because there are exactly 10 partial isometries (on a 3-chain) of height 2, namely: (1,2)-->(1,2); (1,2)-->(2,1); (1,2)-->(2,3); (1,2)-->(3,2); (2,3)-->(1,2); (2,3)-->(2,1); (2,3)-->(2,3); (2,3)-->(3,2); (1,3)-->(1,3); (1,3)-->(3,1) - the mappings are coordinate-wise.
The triangle starts
  1;
  1,    1;
  1,    4,    2;
  1,    9,   10,    2;
  1,   16,   28,   12,    2;
  1,   25,   60,   40,   14,    2;
  1,   36,  110,  100,   54,   16,    2;
  1,   49,  182,  210,  154,   70,   18,    2;
  1,   64,  280,  392,  364,  224,   88,   20,    2;
  1,   81,  408,  672,  756,  588,  312,  108,   22,    2;
  1,  100,  570, 1080, 1428, 1344,  900,  420,  130,   24,    2;
		

Crossrefs

Cf. A183156 (row sums), A006331 (k=2), A008911 (k=3), A067056 (k=4).

Programs

  • Maple
    A183157 := proc(n,k) if k =0 then 1; elif k = 1 then n^2 ; else 2*(2*n-k+1)*binomial(n,k)/(k+1) ; end if; end proc: # R. J. Mathar, Jan 06 2011
  • Mathematica
    T[, 0] = 1; T[n, 1] := n^2; T[n_, k_] := 2*(2*n - k + 1)*Binomial[n, k] / (k + 1);
    Table[T[n, k], {n, 0, 10}, {k, 0, n}] // Flatten (* Jean-François Alcover, Nov 25 2017 *)

Formula

T(n,0)=1, T(n,1) = n^2 and T(n,k)=2*(2*n-k+1)*binomial(n,k)/(k+1), k > 1.

A208532 Mirror image of triangle in A125185; unsigned version of A120058.

Original entry on oeis.org

1, 2, 1, 3, 4, 2, 4, 9, 10, 4, 5, 16, 28, 24, 8, 6, 25, 60, 80, 56, 16, 7, 36, 110, 200, 216, 128, 32, 8, 49, 182, 420, 616, 560, 288, 64, 9, 64, 280, 784, 1456, 1792, 1408, 640, 128, 10, 81, 408, 1344, 3024, 4704, 4992, 3456, 1408, 256
Offset: 0

Views

Author

Philippe Deléham, Feb 27 2012

Keywords

Comments

Subtriangle of the triangle given by (1, 1, -1, 1, 0, 0, 0, 0, 0, 0, 0, ...) DELTA (0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, ...) where DELTA is the operator defined in A084938.
Equals A007318*A134309*A097806 as infinite lower triangular matrix.
Row sums are powers of 3 (A000244).
Diagonal sums are powers of 2 (A000079).

Examples

			Triangle begins :
1
2, 1
3, 4, 2
4, 9, 10, 4
5, 16, 28, 24, 8
6, 25, 60, 80, 56, 16
7, 36, 110, 200, 216, 128, 32
8, 49, 182, 420, 616, 560, 288, 64
9, 64, 280, 784, 1456, 1792, 1408, 640, 128
10, 81, 408, 1344, 3024, 4704, 4992, 3456, 1408, 256
Triangle (1, 1, -1, 1, 0, 0, 0, ...) DELTA (0, 1, 1, 0, 0, 0, ...) begins :
1
1, 0
2, 1, 0
3, 4, 2, 0
4, 9, 10, 4, 0
5, 16, 28, 24, 8, 0
6, 25, 60, 80, 56, 16, 0
		

Crossrefs

Cf. Columns: A000027, A000290, A006331, A112742.
Cf. Diagonals: A011782, 2*A045623,

Formula

T(n,k) = 2*T(n-1,k) + 2*T(n-1,k-1) - T(n-2,k) - 2*T(n-1,k-1), T(0,0) = T(1,1) = 1, T(n,k) = 0 if k<0 or if k>n.
G.f.: (1-y*x)/((1-x)*(1-(1+2*y)*x)).
Sum_{k, 0<=k<=n} T(n,k)*x^k = A083085(n), A084567(n), A000012(n), A000027(n+1), A000244(n), A083065(n), A083076(n) for x = -3, -2, -1, 0, 1, 2, 3 respectively.

A259317 a(n) = 2*(2*n+1)*A000538(n) - 4*A000330(n)^2.

Original entry on oeis.org

0, 2, 70, 588, 2772, 9438, 26026, 61880, 131784, 257754, 471086, 814660, 1345500, 2137590, 3284946, 4904944, 7141904, 10170930, 14202006, 19484348, 26311012, 35023758, 46018170, 59749032, 76735960, 97569290, 122916222, 153527220, 190242668, 233999782
Offset: 0

Views

Author

N. J. A. Sloane, Jun 24 2015

Keywords

Examples

			n=3: 588 = 2*7*92-4*14^2.
		

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{7,-21,35,-35,21,-7,1},{0,2,70,588,2772,9438,26026},30] (* Harvey P. Dale, Jul 12 2025 *)
  • PARI
    concat(0, Vec(-2*x*(x^4+28*x^3+70*x^2+28*x+1)/(x-1)^7 + O(x^100))) \\ Colin Barker, Jun 28 2015
    
  • Python
    def A259317(n): return n*(n*(n**2*(n*(16*n + 48) + 40) - 11) - 3)//45 # Chai Wah Wu, Dec 07 2021

Formula

Also a(n) = (2*n+1)*A259108(n) - A006331(n)^2.
a(n) = (n*(1+2*n)^2*(-3+n+8*n^2+4*n^3))/45. - Colin Barker, Jun 28 2015
G.f.: -2*x*(x^4+28*x^3+70*x^2+28*x+1) / (x-1)^7. - Colin Barker, Jun 28 2015

A268434 Triangle read by rows, Lah numbers of order 2, T(n,n) = 1, T(n,k) = 0 if k<0 or k>n, otherwise T(n,k) = T(n-1,k-1)+((n-1)^2+k^2)*T(n-1,k), for n>=0 and 0<=k<=n.

Original entry on oeis.org

1, 0, 1, 0, 2, 1, 0, 10, 10, 1, 0, 100, 140, 28, 1, 0, 1700, 2900, 840, 60, 1, 0, 44200, 85800, 31460, 3300, 110, 1, 0, 1635400, 3476200, 1501500, 203060, 10010, 182, 1, 0, 81770000, 185874000, 90563200, 14700400, 943800, 25480, 280, 1
Offset: 0

Views

Author

Peter Luschny, Mar 07 2016

Keywords

Comments

0

Examples

			[1]
[0,        1]
[0,        2,         1]
[0,       10,        10,        1]
[0,      100,       140,       28,        1]
[0,     1700,      2900,      840,       60,      1]
[0,    44200,     85800,    31460,     3300,    110,     1]
[0,  1635400,   3476200,  1501500,   203060,  10010,   182,   1]
		

Crossrefs

Cf. A038207 (order 0), A111596 (order 1), A269946 (order 3).

Programs

  • Maple
    T := proc(n,k) option remember;
    if n=k then return 1 fi; if k<0 or k>n then return 0 fi;
    T(n-1,k-1)+((n-1)^2+k^2)*T(n-1,k) end:
    seq(seq(T(n,k), k=0..n), n=0..8);
    # Alternatively with the P-transform (cf. A269941):
    A268434_row := n -> PTrans(n, n->`if`(n=1,1, ((n-1)^2+1)/(n*(4*n-2))),
    (n,k)->(-1)^k*(2*n)!/(2*k)!): seq(print(A268434_row(n)), n=0..8);
  • Mathematica
    T[n_, n_] = 1; T[, 0] = 0; T[n, k_] /; 0 < k < n := T[n, k] = T[n-1, k-1] + ((n-1)^2 + k^2)*T[n-1, k]; T[, ] = 0;
    Table[T[n, k], {n, 0, 8}, {k, 0, n}] // Flatten (* Jean-François Alcover, Jun 20 2017 *)
  • Sage
    #cached_function
    def T(n, k):
        if n==k: return 1
        if k<0 or k>n: return 0
        return T(n-1, k-1)+((n-1)^2+k^2)*T(n-1, k)
    for n in range(8): print([T(n, k) for k in (0..n)])
    # Alternatively with the function PtransMatrix (cf. A269941):
    PtransMatrix(8, lambda n: 1 if n==1 else ((n-1)^2+1)/(n*(4*n-2)), lambda n, k: (-1)^k*factorial(2*n)/factorial(2*k))

Formula

T(n,k) = (-1)^k*((2*n)!/(2*k)!)*P[n,k](s(n)) where P is the P-transform and s(n) = ((n-1)^2+1)/(n*(4*n-2)). The P-transform is defined in the link. Compare also the Sage and Maple implementations below.
T(n,k) = Sum_{j=k..n} A269944(n,j)*A269945(j,k).
T(n,1) = Product_{k=1..n} (k-1)^2+1 for n>=1 (cf. A101686).
T(n,n-1) = (n-1)*n*(2*n-1)/3 for n>=1 (cf. A006331).
Row sums: A269938.

A300758 a(n) = 2n*(n+1)*(2n+1).

Original entry on oeis.org

0, 12, 60, 168, 360, 660, 1092, 1680, 2448, 3420, 4620, 6072, 7800, 9828, 12180, 14880, 17952, 21420, 25308, 29640, 34440, 39732, 45540, 51888, 58800, 66300, 74412, 83160, 92568, 102660, 113460, 124992, 137280, 150348, 164220, 178920, 194472, 210900, 228228
Offset: 0

Views

Author

Christopher Purcell, Mar 12 2018

Keywords

Comments

The altitude h(n) = a(n)/A001844(n) of the (A005408(n), A046092(n) and A001844(n)) rectangular triangle is an irreducible fraction. - Ralf Steiner, Feb 25 2020
In this case, area A = a(n)/2 = A055112(n). - Bernard Schott, Feb 27 2020

Crossrefs

Formula

a(n) = 12*A000330(n).
G.f.: 12*x*(1+x)/(1-x)^4. - Colin Barker, Mar 12 2018
a(n) = 6*A006331(n) = 4*A059270(n) = 3*A002492(n) = 2*A055112(n). - Omar E. Pol, Apr 04 2018
From Ralf Steiner, Feb 27 2020: (Start)
a(n) = 2*n*A000384(n+1).
a(n) = sqrt(A016754(n)*A060300(n)).
(End)
a(n) = A005408(n) * A046092(n). - Bruce J. Nicholson, Apr 24 2020

Extensions

Edited by N. J. A. Sloane, Aug 01 2019

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).

A181773 Molecular topological indices of the cocktail party graphs.

Original entry on oeis.org

0, 48, 240, 672, 1440, 2640, 4368, 6720, 9792, 13680, 18480, 24288, 31200, 39312, 48720, 59520, 71808, 85680, 101232, 118560, 137760, 158928, 182160, 207552, 235200, 265200, 297648, 332640, 370272, 410640
Offset: 1

Views

Author

Eric W. Weisstein, Jul 10 2011

Keywords

Comments

a(n) is the number of 2 X 2 matrices (all four elements distinct) having entries in {-n,...,0,...,n} with determinant equal to the permanent. - Indranil Ghosh, Dec 25 2016

Crossrefs

Cf. A280059 (2 X 2 matrices, elements can be repeated).

Programs

Formula

a(n) = 8*(n-1)*n*(2n-1).
a(n) = 16*A059270(n-1).
G.f.: 48*x^2*(x+1)/(x-1)^4. - Colin Barker, Oct 17 2012
a(n) = 48*A000330(n-1). - R. J. Mathar, Jan 04 2017
From Omar E. Pol, Jan 05 2017: (Start)
a(n) = 24*A006331(n-1) = 12*A002492(n-1) = 8*A055112(n-1).
a(n) = 2*A069074(n-2), n >= 2. (End)
Previous Showing 31-40 of 47 results. Next