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 13 results. Next

A121997 Count up to n, n times.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

The n-th block consists of n subblocks, each of which counts from 1 to n.
This a fractal sequence: removing the first instance of each value leaves the original sequence.
The first comment implies that this gives the column index of the n-th element of a sequence whose terms are coefficients, read by rows, of a sequence of matrices of size 1 X 1, 2 X 2, 3 X 3, etc.; cf. example. The row index is given by A238013(n), and the size of the matrix by A074279(n). - M. F. Hasler, Feb 16 2014

Examples

			Sequence begins:
  1;
  1,2;
  1,2;
  1,2,3;
  1,2,3;
  1,2,3;
  ...
The blocks of n subblocks of n terms (n=1,2,3,...) can be cast into a square matrices of order n; then the terms are equal to the index of the column they fall into.
		

Crossrefs

Cf. A081489 (locations of new values), A075349 (locations of 1's).
Cf. A000290 (row lengths), A002411 (row sums), A036740 (row products).
Cf. A002024 and references there, esp. in PROG section.
Cf. A238013.

Programs

  • PARI
    A121997(N=9)=concat(vector(N,i,concat(vector(i,j,vector(i,k,k))))) \\ Note: this creates a vector; use A121997()[n] to get the n-th term. - M. F. Hasler, Feb 16 2014
    
  • Python
    from sympy import integer_nthroot
    def A121997(n): return 1+(n-(k:=(m:=integer_nthroot(3*n,3)[0])+(6*n>m*(m+1)*((m<<1)+1)))*(k-1)*((k<<1)-1)//6-1)%k # Chai Wah Wu, Nov 04 2024

A145066 Partial sums of A002522, starting at n=1.

Original entry on oeis.org

2, 7, 17, 34, 60, 97, 147, 212, 294, 395, 517, 662, 832, 1029, 1255, 1512, 1802, 2127, 2489, 2890, 3332, 3817, 4347, 4924, 5550, 6227, 6957, 7742, 8584, 9485, 10447, 11472, 12562, 13719, 14945, 16242, 17612, 19057, 20579, 22180, 23862, 25627
Offset: 1

Views

Author

Keywords

Examples

			a(2) = a(1) + 2^2 + 1 = 2 + 4 + 1 = 7; a(3) = a(2) + 3^2 + 1 = 7 + 9 + 1 = 17.
		

Crossrefs

Cf. A002522 (n^2 + 1), A005563 ((n+1)^2 - 1), A051925 (zero followed by partial sums of A005563), A081489 (partial sums of A002522 starting at n=0).

Programs

  • Mathematica
    Accumulate[Range[50]^2+1] (* Harvey P. Dale, Dec 07 2016 *)
  • PARI
    {a=0; for(n=1, 42, print1(a=a+n^2+1, ","))}
    
  • Python
    def A145066(n): return (n*(n*(2*n + 3) + 1))//6 + n # Chai Wah Wu, Oct 30 2024

Formula

a(1) = 2; a(n) = a(n-1) + n^2 + 1 for n > 1.
From Christoph Pacher (christoph.pacher(AT)ait.ac.at), Jul 23 2010: (Start)
a(n) = Sum_{k=1..n} (k^2 + 1).
a(n) = A000330(n) + n.
a(n) = n*(n+1)*(2*n+1)/6 + n. (End)
G.f.: x*(2-x+x^2)/(1-x)^4. - Colin Barker, Apr 04 2012
E.g.f.: (1/6)*x*(12 + 9*x + 2*x^2)*exp(x). - G. C. Greubel, Jul 22 2017
a(n) = A081489(n+1) - 1. - Jianing Song, Oct 10 2021

Extensions

Edited by Klaus Brockhaus, Oct 17 2008

A081490 Leading term of n-th row of A081491.

Original entry on oeis.org

1, 2, 4, 9, 19, 36, 62, 99, 149, 214, 296, 397, 519, 664, 834, 1031, 1257, 1514, 1804, 2129, 2491, 2892, 3334, 3819, 4349, 4926, 5552, 6229, 6959, 7744, 8586, 9487, 10449, 11474, 12564, 13721, 14947, 16244, 17614, 19059, 20581, 22182, 23864, 25629
Offset: 1

Views

Author

Amarnath Murthy, Mar 25 2003

Keywords

Comments

First differences are given by A002522 = n^2 + 1. Second differences are odd numbers given by A005408.
a(1)=1, a(2)=2, (a(n+1) -a(n)) - (a(n) -a(n-1)) = 2*(n-1)-1. - Ben Paul Thurston, Aug 22 2009

Crossrefs

Programs

  • GAP
    List([1..50], n-> (2*n^3-9*n^2+19*n-6)/6); # G. C. Greubel, Aug 13 2019
  • Magma
    [(2*n^3-9*n^2+19*n-6)/6: n in [1..50]]; // G. C. Greubel, Aug 13 2019
    
  • Maple
    with (combinat):a:=n->sum(fibonacci(3,i), i=0..n):seq(a(n)+1, n=-1..42); # Zerinvary Lajos, Apr 25 2008
  • Mathematica
    Rest[CoefficientList[Series[x (1-2x+2x^2+x^3)/(x-1)^4,{x,0,50}],x]] (* or *) LinearRecurrence[{4,-6,4,-1}, {1,2,4,9}, 50] (* Harvey P. Dale, Apr 30 2011 *)
  • PARI
    vector(50, n, (2*n^3-9*n^2+19*n-6)/6) \\ G. C. Greubel, Aug 13 2019
    
  • Sage
    [(2*n^3-9*n^2+19*n-6)/6 for n in (1..50)] # G. C. Greubel, Aug 13 2019
    

Formula

a(1) = 1, a(n) = A081489(n-1) + 1.
From R. J. Mathar, Feb 06 2010: (Start)
G..f: x*(1-2*x+2*x^2+x^3)/(x-1)^4.
a(n) = n*(2*n^2 -9*n +19)/6 -1. (End)
a(n) = (n-2)^2 + a(n-1)+1, n>1. - Gary Detlefs, Jun 29 2010
a(1)=1, a(2)=2, a(3)=4, a(4)=9, a(n) = 4*a(n-1) -6*a(n-2) +4*a(n-3) -a(n-4). - Harvey P. Dale, Apr 30 2011

Extensions

More terms from Antonio G. Astudillo (afg_astudillo(AT)lycos.com), Apr 29 2003

A081491 Triangle read by rows in which the n-th row contains n terms of an arithmetic progression with a common difference of (n-1) and the first term of (n+1)-th row is 1 more than the last term of the n-th row.

Original entry on oeis.org

1, 2, 3, 4, 6, 8, 9, 12, 15, 18, 19, 23, 27, 31, 35, 36, 41, 46, 51, 56, 61, 62, 68, 74, 80, 86, 92, 98, 99, 106, 113, 120, 127, 134, 141, 148, 149, 157, 165, 173, 181, 189, 197, 205, 213, 214, 223, 232, 241, 250, 259, 268, 277, 286, 295, 296, 306, 316, 326, 336, 346
Offset: 1

Views

Author

Amarnath Murthy, Mar 25 2003

Keywords

Examples

			1; 2,3; 4,6,8; 9,12,15,18; 19,23,27,31,35; 36,41,46,51,56,61; ...
		

Crossrefs

Programs

  • Mathematica
    Table[NestList[#+n-1&,(2n^3-9n^2+19n-6)/6,n-1],{n,11}]//Flatten (* Harvey P. Dale, Feb 12 2024 *)

Extensions

More terms from Antonio G. Astudillo (afg_astudillo(AT)lycos.com), Apr 29 2003

A081492 Sum of terms in n-th row of A081491.

Original entry on oeis.org

1, 5, 18, 54, 135, 291, 560, 988, 1629, 2545, 3806, 5490, 7683, 10479, 13980, 18296, 23545, 29853, 37354, 46190, 56511, 68475, 82248, 98004, 115925, 136201, 159030, 184618, 213179, 244935, 280116, 318960, 361713, 408629, 459970, 516006, 577015
Offset: 1

Views

Author

Amarnath Murthy, Mar 25 2003

Keywords

Comments

For odd n a(n) is a multiple of n and a(n)/n is the middle term of the corresponding row.

Crossrefs

Programs

  • GAP
    List([1..40], n-> n*(2*(n-1)^3+7*n-1)/6); # G. C. Greubel, Aug 13 2019
  • Magma
    [n*(2*(n-1)^3+7*n-1)/6: n in [1..40]]; // G. C. Greubel, Aug 13 2019
    
  • Maple
    seq(n*(2*(n-1)^3+7*n-1)/6, n=1..40); # G. C. Greubel, Aug 13 2019
  • Mathematica
    LinearRecurrence[{5,-10,10,-5,1},{1,5,18,54,135},40] (* Harvey P. Dale, Jul 01 2018 *)
  • PARI
    vector(40, n, n*(2*(n-1)^3+7*n-1)/6) \\ G. C. Greubel, Aug 13 2019
    
  • Sage
    [n*(2*(n-1)^3+7*n-1)/6 for n in (1..40)] # G. C. Greubel, Aug 13 2019
    

Formula

a(n) = n*(2*n^3 - 6*n^2 + 13*n - 3)/6.
G.f.: x*(1+x)*(1-x+4*x^2)/(1-x)^5. - Colin Barker, Jul 28 2012
E.g.f.: x*(6 +9*x +6*x^2 +2*x^3)/6. - G. C. Greubel, Aug 13 2019

Extensions

More terms from Antonio G. Astudillo (afg_astudillo(AT)lycos.com), Apr 29 2003.
Formula corrected by Colin Barker, Jul 28 2012

A116701 Number of permutations of length n that avoid the patterns 132, 4321.

Original entry on oeis.org

1, 1, 2, 5, 13, 31, 66, 127, 225, 373, 586, 881, 1277, 1795, 2458, 3291, 4321, 5577, 7090, 8893, 11021, 13511, 16402, 19735, 23553, 27901, 32826, 38377, 44605, 51563, 59306, 67891, 77377, 87825, 99298, 111861, 125581, 140527, 156770, 174383, 193441, 214021
Offset: 0

Views

Author

Lara Pudwell, Feb 26 2006

Keywords

Comments

Also, number of permutations of length n which avoid the patterns 312, 1234, 4312; or avoid the patterns 132, 1324, 4321, etc.
a(n) is the number of Dyck n-paths (A000108) with <= 3 peaks. For example, a(4)=13 counts all 14 Dyck 4-paths except the "sawtooth" path UDUDUDUD which has 4 peaks. - David Callan, Oct 13 2012
Apparently the number of Dyck paths of semilength n+1 in which the sum of the first 3 ascents adds to n+1. (Nonexistent ascents count as zero length.) - David Scambler, Apr 22 2013

Examples

			a(4)=13 because we have 11 permutations of [4] that do not avoid the patterns 132 and 4321; namely: 1324, 1342, 1432, 4132, 1423, 3142, 2431, 2413, 2143, 1243 and 4321.
		

Crossrefs

Programs

  • Maple
    G:=1+(x*(x^4-2*x^3+5*x^2-3*x+1))/(1-x)^5: Gser:=series(G,x=0,48): seq(coeff(Gser,x,n),n=0..45); # Emeric Deutsch, Jul 29 2006
  • Mathematica
    LinearRecurrence[{5, -10, 10, -5, 1}, {1, 2, 5, 13, 31}, 40] (* Jean-François Alcover, Jan 09 2019 *)

Formula

G.f.: -(3*x^4 - 5*x^3 + 7*x^2 - 4*x + 1)/(x-1)^5.
a(n) = (n^4 - 4n^3 + 11n^2 - 8n + 12)/12. - Franklin T. Adams-Watters, Sep 16 2006
Binomial transform of [1, 1, 2, 3, 2, 0, 0, 0, ...]. - Gary W. Adamson, Oct 23 2007
Equals A001263 * [1, 1, 1, 0, 0, 0, ...], where A001263 = the Narayana triangle. - Gary W. Adamson, Nov 19 2007
E.g.f.: (1/12)*exp(x)*(12 + 12*x + 12*x^2 + 6*x^3 + x^4). - Stefano Spezia, Jan 09 2019
a(n) = binomial(n+1,4) + binomial(n,4) + binomial(n,2) + 1. - Michael Coopman, Oct 24 2021
a(n)-a(n-1) = A081489(n-1). - R. J. Mathar, Mar 08 2025

Extensions

Entry revised by N. J. A. Sloane, Jul 25 2006
a(0)=1 prepended by Alois P. Heinz, Nov 28 2021

A320388 Number of partitions of n into distinct parts such that the successive differences of consecutive parts are decreasing.

Original entry on oeis.org

1, 1, 1, 2, 2, 3, 3, 4, 5, 5, 6, 8, 7, 9, 11, 10, 12, 15, 14, 16, 19, 18, 21, 25, 23, 26, 31, 29, 33, 38, 36, 40, 46, 44, 49, 56, 53, 58, 66, 64, 70, 77, 76, 82, 92, 89, 96, 106, 104, 113, 123, 120, 130, 142, 141, 149, 162, 160, 172, 186, 184, 195, 211, 210, 223, 238
Offset: 0

Views

Author

Seiichi Manyama, Oct 12 2018

Keywords

Comments

Partitions are usually written with parts in descending order, but the conditions are easier to check "visually" if written in ascending order.
Partitions into distinct parts (p(1), p(2), ..., p(m)) such that p(k-1) - p(k-2) > p(k) - p(k-1) for all k >= 3.

Examples

			There are a(17) = 15 such partitions of 17:
  01: [17]
  02: [1, 16]
  03: [2, 15]
  04: [3, 14]
  05: [4, 13]
  06: [5, 12]
  07: [6, 11]
  08: [7, 10]
  09: [1, 6, 10]
  10: [8, 9]
  11: [1, 7, 9]
  12: [2, 6, 9]
  13: [2, 7, 8]
  14: [3, 6, 8]
  15: [4, 6, 7]
There are a(18) = 14 such partitions of 18:
  01: [18]
  02: [1, 17]
  03: [2, 16]
  04: [3, 15]
  05: [4, 14]
  06: [5, 13]
  07: [6, 12]
  08: [7, 11]
  09: [8, 10]
  10: [1, 7, 10]
  11: [1, 8, 9]
  12: [2, 7, 9]
  13: [3, 7, 8]
  14: [1, 4, 6, 7]
		

Crossrefs

Programs

  • Ruby
    def partition(n, min, max)
      return [[]] if n == 0
      [max, n].min.downto(min).flat_map{|i| partition(n - i, min, i - 1).map{|rest| [i, *rest]}}
    end
    def f(n)
      return 1 if n == 0
      cnt = 0
      partition(n, 1, n).each{|ary|
        ary0 = (1..ary.size - 1).map{|i| ary[i - 1] - ary[i]}
        cnt += 1 if ary0.sort == ary0 && ary0.uniq == ary0
      }
      cnt
    end
    def A320388(n)
      (0..n).map{|i| f(i)}
    end
    p A320388(50)

A375041 Irregular triangular array T; row n shows the coefficients of the (n-1)-st polynomial in the obverse convolution s(x)**t(x), where s(x) = n^2 x and t(x) = x+1. See Comments.

Original entry on oeis.org

1, 1, 1, 3, 2, 1, 8, 17, 10, 1, 18, 97, 180, 100, 1, 35, 403, 1829, 3160, 1700, 1, 61, 1313, 12307, 50714, 83860, 44200, 1, 98, 3570, 60888, 506073, 1960278, 3147020, 1635400, 1, 148, 8470, 239388, 3550473, 27263928, 101160920, 158986400, 81770000, 1, 213
Offset: 1

Views

Author

Clark Kimberling, Sep 11 2024

Keywords

Comments

See A374848 for the definition of obverse convolution and a guide to related sequences and arrays.

Examples

			First 3 polynomials in s(x)**t(x) are
  1 + x,
  1 + 3 x + 2 x^2,
  1 + 8 x + 17 x^2 + 10 x^3.
First 5 rows of array:
  1    1
  1    3     2
  1    8    17    10
  1   18    97   180   100
  1   35  4034  1829  3160  1700
		

Crossrefs

Cf. A000290, A081489 (column 2), A101686 (T(n,n+1)), A374848, A375042, A375043.

Programs

  • Mathematica
    s[n_] := n^2  x; t[n_] := 1 + x;
    u[n_] := Product[s[k] + t[n - k], {k, 0, n}]
    Table[Expand[u[n]], {n, 0, 10}]
    Column[Table[CoefficientList[Expand[u[n]], x], {n, 0, 10}]]   (* array *)
    Flatten[Table[CoefficientList[Expand[u[n]], x], {n, 0, 10}]]  (* sequence *)

A144337 Triangle read by rows, A000012 * (2*A144328 - A000012).

Original entry on oeis.org

1, 2, 1, 3, 2, 3, 4, 3, 6, 5, 5, 4, 9, 10, 7, 6, 5, 12, 15, 14, 9, 7, 6, 15, 20, 21, 18, 11, 8, 7, 18, 25, 28, 27, 22, 13, 9, 8, 21, 30, 35, 36, 33, 26, 15, 10, 9, 24, 35, 42, 45, 44, 39, 30, 17, 11, 10, 27, 40, 49, 54, 55, 52, 45, 34, 19
Offset: 1

Views

Author

Gary W. Adamson and Roger L. Bagula, Sep 18 2008

Keywords

Comments

When the first column is removed from this triangle (A144337), the result is triangle A101447. - Georg Fischer, Aug 10 2023

Examples

			First few rows of the triangle:
   1;
   2,  1;
   3,  2,  3;
   4,  3,  6,  5;
   5,  4,  9, 10,  7;
   6,  5, 12, 15, 14,  9;
   7,  6, 15, 20, 21, 18, 11;
   8,  7, 18, 25, 28, 27, 22, 13;
   9,  8, 21, 30, 35, 36, 33, 26, 15;
  10,  9, 24, 35, 42, 45, 44, 39, 30, 17;
  ...
		

Crossrefs

Extensions

a(25) corrected by Georg Fischer, Aug 10 2023

A159938 The number of homogeneous trisubstituted linear alkanes.

Original entry on oeis.org

2, 6, 16, 36, 70, 122, 196, 296, 426, 590, 792, 1036, 1326, 1666, 2060, 2512, 3026, 3606, 4256, 4980, 5782, 6666, 7636, 8696, 9850, 11102, 12456, 13916, 15486, 17170, 18972, 20896, 22946, 25126, 27440, 29892, 32486
Offset: 2

Views

Author

Parthasarathy Nambi, Apr 26 2009

Keywords

Comments

See the paper by Valentin Vankov Iliev for details.
This sequence is related to A152947 by a(n) = (n-1)*A152947(n) + sum( A152947(i), i=1..n-1 ). - Bruno Berselli, Dec 19 2013

Examples

			The number of homogeneous trisubstituted linear alkane with ten carbon atoms is 426.
		

Crossrefs

Formula

a(n) = (1/3)*(2*n^3 - 9*n^2 + 19*n - 12), where n is the number of carbons.
a(n) = 2*A081489(n-1) = (n-1)*(2*n^2-7*n+12)/3. - R. J. Mathar, Apr 28 2009
G.f.: 2*x^2*(1-x+2*x^2)/(1-x)^4. - Colin Barker, Aug 06 2012

Extensions

More terms from Colin Barker, Aug 06 2012
Showing 1-10 of 13 results. Next