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-10 of 14 results. Next

A034705 Numbers that are sums of consecutive squares.

Original entry on oeis.org

0, 1, 4, 5, 9, 13, 14, 16, 25, 29, 30, 36, 41, 49, 50, 54, 55, 61, 64, 77, 81, 85, 86, 90, 91, 100, 110, 113, 121, 126, 135, 139, 140, 144, 145, 149, 169, 174, 181, 190, 194, 196, 199, 203, 204, 221, 225, 230, 245, 255, 256, 265, 271, 280, 284, 285, 289, 294, 302
Offset: 1

Views

Author

Keywords

Comments

Also, differences of any pair of square pyramidal numbers (A000330). These could be called "truncated square pyramidal numbers". - Franklin T. Adams-Watters, Nov 29 2006
If n is the sum of d consecutive squares up to m^2, n = A000330(m) - A000330(m-d) = d*(m^2 - (d-1)*m + (d-1)*(2*d-1)/6) <=> m^2 - (d-1)*m = c := n/d - (d-1)*(2*d-1)/6 <=> m = (d-1)/2 + sqrt((d-1)^2/4 + c) which must be an integer. Moreover, A000330(x) >= x^3/3, so m and d can't be larger than (3*n)^(1/3). - M. F. Hasler, Jan 02 2024

Examples

			All squares (A000290: 0, 1, 4, 9, ...) are in this sequence, since "consecutive" in the definition means a subsequence without interruption, so a single term qualifies.
5 = 1^2 + 2^2 = A000330(2) is in this sequence, and similarly 13 = 2^2 + p3^2  = A000330(3) - A000330(1) and 14 = 1^2 + 2^2 + 3^2 = A000330(3), etc.
		

Crossrefs

Cf. A217843-A217850 (sums of consecutive powers 3 to 10).
Cf. A368570 (first of each pair of consecutive integers in this sequence).

Programs

  • Haskell
    import Data.Set (deleteFindMin, union, fromList); import Data.List (inits)
    a034705 n = a034705_list !! (n-1)
    a034705_list = f 0 (tail $ inits $ a000290_list) (fromList [0]) where
       f x vss'@(vs:vss) s
         | y < x = y : f x vss' s'
         | otherwise = f w vss (union s $ fromList $ scanl1 (+) ws)
         where ws@(w:_) = reverse vs
               (y, s') = deleteFindMin s
    -- Reinhard Zumkeller, May 12 2015
    
  • Mathematica
    nMax = 1000; t = {0}; Do[k = n; s = 0; While[s = s + k^2; s <= nMax, AppendTo[t, s]; k++], {n, Sqrt[nMax]}]; t = Union[t] (* T. D. Noe, Oct 23 2012 *)
  • PARI
    {is_A034705(n)= for(d=1,sqrtnint(n*3,3), my(b = (d-1)/2, s = n/d - (d-1)*(d*2-1)/6 + b^2); denominator(s)==denominator(b)^2 && issquare(s, &s) && return(b+s)); !n} \\ Return the index of the largest square of the sum (or 1 for n = 0) if n is in the sequence, else 0. - M. F. Hasler, Jan 02 2024
    
  • Python
    import heapq
    from itertools import islice
    def agen(): # generator of terms
        m = 0; h = [(m, 0, 0)]; nextcount = 1; v1 = None
        while True:
            (v, s, l) = heapq.heappop(h)
            if v != v1: yield v; v1 = v
            if v >= m:
                m += nextcount*nextcount
                heapq.heappush(h, (m, 1, nextcount))
                nextcount += 1
            v -= s*s; s += 1; l += 1; v += l*l
            heapq.heappush(h, (v, s, l))
    print(list(islice(agen(), 60))) # Michael S. Branicky, Jan 06 2024

Extensions

Terms a(1..10^4) double-checked with independent code by M. F. Hasler, Jan 02 2024

A322468 Numbers that are sums of consecutive tetrahedral numbers.

Original entry on oeis.org

0, 1, 4, 5, 10, 14, 15, 20, 30, 34, 35, 55, 56, 65, 69, 70, 84, 91, 111, 120, 121, 125, 126, 140, 165, 175, 195, 204, 205, 209, 210, 220, 260, 285, 286, 295, 315, 325, 329, 330, 364, 369, 385, 425, 455, 460, 480, 490, 494, 495, 505, 506, 560, 589, 645, 650, 671, 680, 700
Offset: 1

Views

Author

Ilya Gutkovskiy, Dec 09 2018

Keywords

Examples

			209 = sum_{k=2..7} A000292(k) so 209 is in the list. 295=sum_{k=5..8} A000292(k), so 295 is in the list.
		

Crossrefs

Cf. A000292 (tetrahedral numbers, a subsequence), A000330 (subsequence), A006003 (subsequence), A005894 (subsequence).
Other sums of consecutive numbers: A034705 (squares), A034706 (triangular numbers), A322479 (square pyramidal numbers), A322610 (centered triangular numbers), A322611 (centered square numbers).

Programs

  • Mathematica
    tet[n_] := n (n + 1) (n + 2)/6; nMax = 700; t = {0}; Do[k = n; s = 0; While[s = s + tet[k]; s <= nMax, AppendTo[t, s]; k++], {n, (6*nMax)^(1/3) + 1}]; t = Union[t] (* Amiram Eldar, Dec 09 2018 after T. D. Noe at A034705 *)
    anmax = 1000; nmax = Floor[(6*anmax)^(1/3)] + 1; Select[Union[Flatten[Table[Sum[k*(k + 1)*(k + 2)/6, {k, i, j}], {i, 0, nmax}, {j, i, nmax}]]], # <= anmax &] (* Vaclav Kotesovec, Dec 21 2018 *)

A322610 Numbers that are sums (of a nonempty sequence) of consecutive centered triangular numbers.

Original entry on oeis.org

1, 4, 5, 10, 14, 15, 19, 29, 31, 33, 34, 46, 50, 60, 64, 65, 77, 85, 96, 106, 109, 110, 111, 136, 141, 149, 160, 166, 170, 174, 175, 194, 195, 199, 226, 235, 245, 255, 258, 259, 260, 274, 302, 304, 316, 330, 335, 354, 361, 364, 365, 368, 369, 394, 409, 411, 434, 440, 460, 471, 490, 496, 500
Offset: 1

Views

Author

Ilya Gutkovskiy, Dec 20 2018

Keywords

Crossrefs

Programs

  • Mathematica
    anmax = 1000; nmax = Floor[Sqrt[2*anmax/3]] + 1; Select[Union[Flatten[Table[Sum[(3*k^2 + 3*k + 2)/2, {k, i, j}], {i, 0, nmax}, {j, i, nmax}]]], # <= anmax &] (* Vaclav Kotesovec, Dec 21 2018 *)

A322636 Numbers that are sums of consecutive heptagonal numbers (A000566).

Original entry on oeis.org

0, 1, 7, 8, 18, 25, 26, 34, 52, 55, 59, 60, 81, 89, 107, 112, 114, 115, 136, 148, 170, 188, 189, 193, 195, 196, 235, 248, 260, 282, 286, 300, 307, 308, 337, 341, 342, 396, 403, 424, 430, 448, 449, 455, 456, 469, 521, 530, 540, 572, 585, 616, 619, 628, 637, 644, 645, 684, 697
Offset: 1

Views

Author

Ilya Gutkovskiy, Dec 21 2018

Keywords

Crossrefs

Programs

  • Maple
    N:= 1000: # for terms up to N
    Hepta:= [seq(n*(5*n-3)/2,n=0..floor((3+sqrt(9+40*N))/10))]:
    PS:= ListTools:-PartialSums(Hepta):
    S:= select(`<=`,{0,seq(seq(PS[i]-PS[j],j=1..i-1),i=1..nops(PS))},N):
    sort(convert(S,list)); # Robert Israel, May 22 2025
  • Mathematica
    terms = 59;
    nmax = 17; kmax = 9; (* empirical *)
    T = Table[n(5n-3)/2, {n, 0, nmax}];
    Union[T, Table[k MovingAverage[T, k], {k, 2, kmax}]//Flatten][[1 ;; terms]] (* Jean-François Alcover, Dec 26 2018 *)

A322637 Numbers that are sums of consecutive octagonal numbers (A000567).

Original entry on oeis.org

0, 1, 8, 9, 21, 29, 30, 40, 61, 65, 69, 70, 96, 105, 126, 133, 134, 135, 161, 176, 201, 222, 225, 229, 230, 231, 280, 294, 309, 334, 341, 355, 363, 364, 401, 405, 408, 470, 481, 505, 510, 531, 534, 539, 540, 560, 621, 630, 645, 681, 695, 735, 736, 749, 756, 764, 765, 814, 833, 846
Offset: 1

Views

Author

Ilya Gutkovskiy, Dec 21 2018

Keywords

Crossrefs

Programs

  • Maple
    N:= 1000: # for terms up to N
    Octa:= [seq(n*(3*n-2),n=0..floor((1+sqrt(1+3*N))/3))]:
    PS:= ListTools:-PartialSums(Octa):
    S:= select(`<=`,{0,seq(seq(PS[i]-PS[j],j=1..i-1),i=1..nops(PS))},N):
    sort(convert(S,list)); # Robert Israel, May 22 2025
  • Mathematica
    terms = 60;
    nmax = 17; kmax = 9; (* empirical *)
    T = Table[n(3n-2), {n, 0, nmax}];
    Union[T, Table[k MovingAverage[T, k], {k, 2, kmax}]//Flatten][[1 ;; terms]] (* Jean-François Alcover, Dec 26 2018 *)

A334007 a(n) is the least integer that can be expressed as the sum of one or more consecutive nonzero triangular numbers in exactly n ways.

Original entry on oeis.org

1, 10, 2180, 10053736, 13291443468940
Offset: 1

Views

Author

Ilya Gutkovskiy, Apr 12 2020

Keywords

Examples

			Let S(k, m) denote the sum of m triangular numbers starting from k(k+1)/2. We have
a(1) = S(1, 1);
a(2) = S(4, 1) = S(1, 3);
a(3) = S(31, 4) = S(27, 5) = S(9, 15);
a(4) = S(945, 22) = S(571, 56) = S(968, 21) = S(131, 266);
a(5) = S(4109, 38947) = S(25213, 20540) = S(10296, 32943) = S(32801, 15834) = S(31654, 16472).
		

Crossrefs

Extensions

a(5) from Giovanni Resta, Apr 13 2020

A319184 Numbers that are sums of consecutive pentagonal numbers.

Original entry on oeis.org

0, 1, 5, 6, 12, 17, 18, 22, 34, 35, 39, 40, 51, 57, 69, 70, 74, 75, 86, 92, 108, 117, 120, 121, 125, 126, 145, 156, 162, 176, 178, 190, 195, 196, 209, 210, 213, 247, 248, 262, 270, 279, 282, 287, 288, 321, 330, 354, 365, 376, 386, 387, 399, 404, 405, 424, 425, 438, 457, 475
Offset: 1

Views

Author

Ilya Gutkovskiy, Dec 21 2018

Keywords

Crossrefs

Programs

  • Mathematica
    anmax = 1000; nmax = Floor[Sqrt[2*anmax/3]] + 1; Select[Union[Flatten[Table[Sum[k*(3*k-1)/2, {k, i, j}], {i, 0, nmax}, {j, i, nmax}]]], # <= anmax &] (* Vaclav Kotesovec, Dec 21 2018 *)
    Module[{nn=20,pn},pn=PolygonalNumber[5,Range[0,nn]];Take[Union[Flatten[Table[Total/@Partition[pn,d,1],{d,nn}]]],60]] (* Harvey P. Dale, Jun 22 2025 *)

A307614 Number of partitions of the n-th triangular number into consecutive positive triangular numbers.

Original entry on oeis.org

1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 2, 1, 1, 2, 2, 1, 1, 1, 2, 1, 2, 1, 1, 2, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 2, 1
Offset: 1

Views

Author

Ilya Gutkovskiy, Apr 18 2019

Keywords

Examples

			A000217(4) = 10 = 1 + 3 + 6, so a(4) = 2.
		

Crossrefs

Formula

a(n) = [x^(n*(n+1)/2)] Sum_{i>=1} Sum_{j>=i} Product_{k=i..j} x^(k*(k+1)/2).

A307666 Number of partitions of n into consecutive positive triangular numbers.

Original entry on oeis.org

1, 0, 1, 1, 0, 1, 0, 0, 1, 2, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 2
Offset: 1

Views

Author

Ilya Gutkovskiy, Apr 20 2019

Keywords

Comments

Equivalently, number of ways n can be expressed as the difference between two tetrahedral numbers. - Charlie Neder, Apr 24 2019
Records: a(10)=2, a(2180)=3, a(10053736)=4. - Robert Israel, Aug 20 2019

Examples

			10 = 1 + 3 + 6, so a(10) = 2.
		

Crossrefs

Programs

  • Maple
    N:= 100:
    V:= Vector(N):
    for i from 1 while i*(i+1)/2 <= N do
      s:= i*(i+1)*(i+2)/6;
      for j from i-1 to 0 by -1 do
        t:= j*(j+1)*(j+2)/6;
        if s-t > N then break fi;
        V[s-t]:= V[s-t]+1
      od;
    od:
    convert(V,list); # Robert Israel, Aug 20 2019

Formula

G.f.: Sum_{i>=1} Sum_{j>=i} Product_{k=i..j} x^(k*(k+1)/2).

A319185 Numbers that are sums of consecutive hexagonal numbers (A000384).

Original entry on oeis.org

0, 1, 6, 7, 15, 21, 22, 28, 43, 45, 49, 50, 66, 73, 88, 91, 94, 95, 111, 120, 139, 153, 154, 157, 160, 161, 190, 202, 211, 230, 231, 245, 251, 252, 273, 276, 277, 322, 325, 343, 350, 364, 365, 371, 372, 378, 421, 430, 435, 463, 475, 496, 503, 507, 518, 524, 525, 554, 561
Offset: 1

Views

Author

Ilya Gutkovskiy, Dec 21 2018

Keywords

Crossrefs

Programs

  • Mathematica
    anmax = 1000; nmax = Floor[Sqrt[anmax/2]] + 1; Select[Union[Flatten[Table[Sum[k*(2*k-1), {k, i, j}], {i, 0, nmax}, {j, i, nmax}]]], # <= anmax &] (* Vaclav Kotesovec, Dec 21 2018 *)
Showing 1-10 of 14 results. Next