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

A135276 a(0)=0, a(1)=1; for n>1, a(n) = a(n-1) + n^0 if n odd, a(n) = a(n-1) + n^1 if n is even.

Original entry on oeis.org

0, 1, 3, 4, 8, 9, 15, 16, 24, 25, 35, 36, 48, 49, 63, 64, 80, 81, 99, 100, 120, 121, 143, 144, 168, 169, 195, 196, 224, 225, 255, 256, 288, 289, 323, 324, 360, 361, 399, 400, 440, 441, 483, 484, 528, 529, 575, 576, 624, 625, 675, 676, 728, 729, 783, 784, 840, 841, 899, 900, 960, 961
Offset: 0

Views

Author

Artur Jasinski, May 12 2008, corrected May 17 2008

Keywords

Comments

Index to family of sequences of the form a(n) = a(n-1) + n^r if n odd, a(n) = a(n-1)+ n^s if n is even, for n > 1 and a(1)=1:
s=0, s=1, s=2, s=3, s=4, s=5
r=0, A000027, this seq, A135301, A135332, A140142, A140143;
Equals triangle A070909 * [1,2,3,...]. - Gary W. Adamson, May 16 2010
Right edge of the triangle in A199332: a(n) = A199332(n,n), for n > 0. - Reinhard Zumkeller, Nov 23 2011

Crossrefs

Programs

  • Magma
    [(2*n^2+6*n+1+(2*n-1)*(-1)^n)/8 : n in [0..100]]; // Wesley Ivan Hurt, Mar 22 2016
  • Maple
    A135276:=n->( 2*n^2 + 6*n + 1 + (2*n-1)*(-1)^n )/8: seq(A135276(n), n=0..100); # Wesley Ivan Hurt, Mar 22 2016
  • Mathematica
    a = {}; r = 0; s = 1; Do[k = 0; Do[k = k + (Sin[Pi m/2]^2) m^r + (Cos[Pi m/2]^2) m^s, {m, 1, n}]; AppendTo[a, k], {n, 0, 100}]; a (* Artur Jasinski *)
    LinearRecurrence[{1, 2, -2, -1, 1}, {0, 1, 3, 4, 8}, 50] (* G. C. Greubel, Oct 08 2016 *)
  • PARI
    A135276(n)=if(n%2,((n+1)/2)^2,(n/2+1)^2-1) \\ M. F. Hasler, May 17 2008
    
  • PARI
    my(x='x+O('x^200)); concat(0, Vec(x*(1+2*x-x^2)/((1+x)^2*(1-x)^3))) \\ Altug Alkan, Mar 23 2016
    

Formula

a(n) = (n/2 + 1)^2 - 1 if n is even, ((n+1)/2)^2 if n is odd. - M. F. Hasler, May 17 2008
From R. J. Mathar, Feb 22 2009: (Start)
G.f.: x*(1+2*x-x^2)/((1+x)^2*(1-x)^3).
a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5). (End)
a(n) = (2*n^2 + 6*n + 1 + (2*n-1)*(-1)^n)/8. - Luce ETIENNE, Jul 08 2014
a(n) = (floor(n/2)+1)^2 + (n mod 2) - 1. - Wesley Ivan Hurt, Mar 22 2016
a(n) = A004526((n+1)^2) - A004526(n+1)^2. - Bruno Berselli, Oct 21 2016
Sum_{n>=1} 1/a(n) = 3/4 + Pi^2/6. - Amiram Eldar, Sep 08 2022

Extensions

Offset corrected by R. J. Mathar, Feb 22 2009
Edited by Michel Marcus, Apr 07 2023

A140144 a(1)=1, a(n)=a(n-1)+n^1 if n odd, a(n)=a(n-1)+ n^0 if n is even.

Original entry on oeis.org

1, 2, 5, 6, 11, 12, 19, 20, 29, 30, 41, 42, 55, 56, 71, 72, 89, 90, 109, 110, 131, 132, 155, 156, 181, 182, 209, 210, 239, 240, 271, 272, 305, 306, 341, 342, 379, 380, 419, 420, 461, 462, 505, 506, 551, 552, 599, 600, 649, 650, 701, 702, 755, 756, 811, 812, 869
Offset: 1

Views

Author

Artur Jasinski, May 12 2008

Keywords

Comments

Equals triangle A177990 * [1,2,3,...]. - Gary W. Adamson, May 16 2010

Crossrefs

Cf. A177990. - Gary W. Adamson, May 16 2010
Cf. A002378 (even bisection), A028387 (odd bisection).

Programs

  • Mathematica
    a = {}; r = 1; s = 0; Do[k = 0; Do[k = k + (Sin[Pi m/2]^2) m^r + (Cos[Pi m/2]^2) m^s, {m, 1, n}]; AppendTo[a, k], {n, 1, 100}]; a

Formula

From R. J. Mathar, Feb 22 2009: (Start)
a(n) = a(n-1)+2*a(n-2)-2*a(n-3)-a(n-4)+a(n-5).
G.f.: x*(-1-x-x^2+x^3)/ ((1+x)^2*(x-1)^3). (End)
a(n) = Sum_{k=1..n} k^(k mod 2). - Wesley Ivan Hurt, Nov 20 2021

A135095 a(1)=1, a(n) = a(n-1) + n^5 if n odd, a(n) = a(n-1) + n^2 if n is even.

Original entry on oeis.org

1, 5, 248, 264, 3389, 3425, 20232, 20296, 79345, 79445, 240496, 240640, 611933, 612129, 1371504, 1371760, 2791617, 2791941, 5268040, 5268440, 9352541, 9353025, 15789368, 15789944, 25555569, 25556245, 39905152, 39905936, 60417085
Offset: 1

Views

Author

Artur Jasinski, May 12 2008

Keywords

Crossrefs

Programs

  • Magma
    [(1/24)*(3 + 2*n + 5*n^2 + 4*n^3 + 5*n^4 + 6*n^5 + 2*n^6 - 3*(-1)^n*(1 + n* (-2 - 7*n + 5*n^3 + 2*n^4))): n in [1..50]]; // G. C. Greubel, Jul 05 2018
  • Mathematica
    a = {}; r = 5; s = 2; Do[k = 0; Do[k = k + (Sin[Pi m/2]^2) m^r + (Cos[Pi m/2]^2) m^s, {m, 1, n}]; AppendTo[a, k], {n, 1, 100}]; a (*Artur Jasinski*)
    Table[(1/24)*(3 + 2*n + 5*n^2 + 4*n^3 + 5*n^4 + 6*n^5 + 2*n^6 - 3*(-1)^n*(1 + n* (-2 - 7*n + 5*n^3 + 2*n^4))), {n,1,50}] (* G. C. Greubel, Sep 23 2016 *)
  • PARI
    for(n=1,50, print1((1/24)*(3 + 2*n + 5*n^2 + 4*n^3 + 5*n^4 + 6*n^5 + 2*n^6 - 3*(-1)^n*(1 + n* (-2 - 7*n + 5*n^3 + 2*n^4))), ", ")) \\ G. C. Greubel, Jul 05 2018
    

Formula

G.f.: -x*(x^8 - 4*x^7 + 236*x^6 + 12*x^5 + 1446*x^4 - 12*x^3 + 236*x^2 + 4*x + 1)*(x^2 + 1)/( (1+x)^6 * (x-1)^7 ). - R. J. Mathar, Feb 22 2009
E.g.f.: (1/24)*( (-3 - 6*x - 17*x^2 + 240*x^3 - 75*x^4 + 6*x^5)*exp(x) + (3 + 24*x + 204*x^2 + 364*x^3 + 195*x^4 + 36*x^5 + 2*x^6)*exp(x) ). - G. C. Greubel, Sep 23 2016

A135099 a(1)=1, a(n) = a(n-1) + n^5 if n odd, a(n) = a(n-1) + n^3 if n is even.

Original entry on oeis.org

1, 9, 252, 316, 3441, 3657, 20464, 20976, 80025, 81025, 242076, 243804, 615097, 617841, 1377216, 1381312, 2801169, 2807001, 5283100, 5291100, 9375201, 9385849, 15822192, 15836016, 25601641, 25619217, 39968124, 39990076, 60501225
Offset: 1

Views

Author

Artur Jasinski, May 12 2008

Keywords

Crossrefs

Programs

  • Magma
    [(1/48)*(9*(1-(-1)^n) +4*n^2*(n+1)^2*(n^2 +n+1) -6*(-1)^n*n^2*(n + 2)*(2*n^2 +n-4)): n in [1..50]]; // G. C. Greubel, Jul 05 2018
  • Mathematica
    a = {}; r = 5; s = 3; Do[k = 0; Do[k = k + (Sin[Pi m/2]^2) m^r + (Cos[Pi m/2]^2) m^s, {m, 1, n}]; AppendTo[a, k], {n, 1, 100}]; a
    Table[(1/48)*(9*(1 - (-1)^n) + 4*n^2*(n + 1)^2*(n^2 + n + 1) - 6*(-1)^n*n^2*(n + 2)*(2*n^2 + n - 4)), {n, 1, 50}] (* G. C. Greubel, Sep 23 2016 *)
    nxt[{n_,a_}]:={n+1,If[EvenQ[n],a+(n+1)^5,a+(n+1)^3]}; NestList[nxt,{1,1},30][[All,2]] (* or *) LinearRecurrence[{1,6,-6,-15,15,20,-20,-15,15,6,-6,-1,1},{1,9,252,316,3441,3657,20464,20976,80025,81025,242076,243804,615097},30] (* Harvey P. Dale, Oct 02 2022 *)
  • PARI
    for(n=1,50, print1((1/48)*(9*(1-(-1)^n) +4*n^2*(n+1)^2*(n^2 +n +1) -6*(-1)^n*n^2*(n+2)*(2*n^2 +n-4)), ", ")) \\ G. C. Greubel, Jul 05 2018
    

Formula

G.f.: -x*(1 + 8*x + 237*x^2 + 16*x^3 + 1682*x^4 - 48*x^5 + 1682*x^6 + 16*x^7 + 237*x^8 + 8*x^9 + x^ 10)/((1+x)^6 * (x-1)^7). - R. J. Mathar, Feb 22 2009
E.g.f.: (1/48)*( (-9 - 18*x - 306*x^2 + 468*x^3 - 150*x^4 + 12*x^5)*exp(-x) + (9 + 48*x + 456*x^2 + 768*x^3 + 396*x^4 + 72*x^5 + 4*x^6)*exp(x) ). - G. C. Greubel, Sep 23 2016

A135214 a(1)=1, a(n) = a(n-1) + n^5 if n odd, a(n) = a(n-1) + n^4 if n is even.

Original entry on oeis.org

1, 17, 260, 516, 3641, 4937, 21744, 25840, 84889, 94889, 255940, 276676, 647969, 686385, 1445760, 1511296, 2931153, 3036129, 5512228, 5672228, 9756329, 9990585, 16426928, 16758704, 26524329, 26981305, 41330212, 41944868, 62456017
Offset: 1

Views

Author

Artur Jasinski, May 12 2008

Keywords

Crossrefs

Programs

  • Magma
    m:=50; R:=PowerSeriesRing(Integers(), m); Coefficients(R!(x*(1 + x^2)*(x^8 - 16*x^7 + 236*x^6 - 144*x^5 + 1446*x^4 + 144*x^3 + 236*x^2 + 16*x + 1)/((1-x)^7 *(1+x)^6))) // G. C. Greubel, Jul 04 2018
  • Mathematica
    a = {}; r = 5; s = 4; Do[k = 0; Do[k = k + (Sin[Pi m/2]^2) m^r + (Cos[Pi m/2]^2) m^s, {m, 1, n}]; AppendTo[a, k], {n, 1, 100}]; a
    LinearRecurrence[{1, 6, -6, -15, 15, 20, -20, -15, 15, 6, -6, -1, 1}, {1, 17, 260, 516, 3641, 4937, 21744, 25840, 84889, 94889, 255940, 276676, 647969}, 50] (* G. C. Greubel, Oct 04 2016 *)
  • PARI
    x='x+O('x^50); Vec(x*(1 + x^2)*(x^8 - 16*x^7 + 236*x^6 - 144*x^5 + 1446*x^4 + 144*x^3 + 236*x^2 + 16*x + 1)/((1-x)^7 *(1+x)^6)) \\ G. C. Greubel, Jul 04 2018
    

Formula

From R. J. Mathar, May 17 2008: (Start)
O.g.f.: x*(1 + x^2)*(x^8 - 16*x^7 + 236*x^6 - 144*x^5 + 1446*x^4 + 144*x^3 + 236*x^2 + 16*x + 1)/((1-x)^7 *(1+x)^6).
a(2*n-1) = n*(-8 + 80*n^2 + 48*n^4 + 80*n^5 + 35*n - 220*n^3)/15.
a(2*n) = n*(-8 + 80*n^2 + 48*n^4 + 80*n^5 + 35*n + 20*n^3)/15 . (End)

A135301 a(1)=1, a(n)=a(n-1)+n^0 if n odd, a(n)=a(n-1)+ n^2 if n is even.

Original entry on oeis.org

1, 5, 6, 22, 23, 59, 60, 124, 125, 225, 226, 370, 371, 567, 568, 824, 825, 1149, 1150, 1550, 1551, 2035, 2036, 2612, 2613, 3289, 3290, 4074, 4075, 4975, 4976, 6000, 6001, 7157, 7158, 8454, 8455, 9899, 9900, 11500, 11501, 13265, 13266, 15202, 15203
Offset: 1

Views

Author

Artur Jasinski, May 12 2008

Keywords

Crossrefs

Programs

  • Mathematica
    a = {}; r = 0; s = 2; Do[k = 0; Do[k = k + (Sin[Pi m/2]^2) m^r + (Cos[Pi m/2]^2) m^s, {m, 1, n}]; AppendTo[a, k], {n, 1, 100}]; a (*Artur Jasinski*)
    nxt[{n_,a_}]:={n+1,If[EvenQ[n],a+1,a+(n+1)^2]}; Transpose[NestList[nxt,{1,1},50]][[2]] (* or *) LinearRecurrence[{1,3,-3,-3,3,1,-1},{1,5,6,22,23,59,60},50] (* Harvey P. Dale, Jul 16 2014 *)

Formula

O.g.f.: x*(x^4+4*x^3-2*x^2+4*x+1)/((-1+x)^4*(1+x)^3) . a(2n-1) = 4*n^3/3-2*n^2+5*n/3, a(2n) = 4*n^3/3+2*n^2+5*n/3. - R. J. Mathar, May 17 2008
a(1)=1, a(2)=5, a(3)=6, a(4)=22, a(5)=23, a(6)=59, a(7)=60, a(n)=a(n-1)+ 3*a(n-2)- 3*a(n-3)-3*a(n-4)+3*a(n-5)+a(n-6)-a (n-7). - Harvey P. Dale, Jul 16 2014
a(n) = ( (2*n+1)*(n^2+n+3)+3*(n^2+n-1)*(-1)^n )/12. - Luce ETIENNE, Jul 26 2014

A135332 a(1)=1; for n>1, a(n) = a(n-1) + n^0 if n odd, a(n) = a(n-1) + n^3 if n is even.

Original entry on oeis.org

1, 9, 10, 74, 75, 291, 292, 804, 805, 1805, 1806, 3534, 3535, 6279, 6280, 10376, 10377, 16209, 16210, 24210, 24211, 34859, 34860, 48684, 48685, 66261, 66262, 88214, 88215, 115215, 115216, 147984, 147985, 187289, 187290, 233946, 233947, 288819
Offset: 1

Views

Author

Artur Jasinski, May 12 2008

Keywords

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{1,4,-4,-6,6,4,-4,-1,1},{1,9,10,74,75,291,292,804,805},40] (* Harvey P. Dale, Nov 28 2014 *)

Formula

From R. J. Mathar, Feb 22 2009: (Start)
a(n) = a(n-1) + 4*a(n-2) - 4*a(n-3) - 6*a(n-4) + 6*a(n-5) + 4*a(n-6) - 4*a(n-7) - a(n-8) + a(n-9).
G.f.: x*(1 + 8*x - 3*x^2 + 32*x^3 + 3*x^4 +8*x^5 -x^6)/((1+x)^4*(1-x)^5). (End)

A140142 a(1)=1, a(n)=a(n-1)+n^0 if n odd, a(n)=a(n-1)+ n^4 if n is even.

Original entry on oeis.org

1, 17, 18, 274, 275, 1571, 1572, 5668, 5669, 15669, 15670, 36406, 36407, 74823, 74824, 140360, 140361, 245337, 245338, 405338, 405339, 639595, 639596, 971372, 971373, 1428349, 1428350, 2043006, 2043007, 2853007, 2853008, 3901584, 3901585
Offset: 1

Views

Author

Artur Jasinski, May 12 2008

Keywords

Crossrefs

Programs

  • Maple
    a:= n-> (Matrix([[275,274,18,17, 1,0,0,-1,-17, -18,-274]]). Matrix(11, (i,j)-> if (i=j-1) then 1 elif j=1 then [1,5,-5,-10,10,10, -10,-5,5,1,-1][i] else 0 fi)^n)[1,6]: seq(a(n), n=1..33); # Alois P. Heinz, Aug 06 2008
  • Mathematica
    a = {}; r = 0; s = 4; Do[k = 0; Do[k = k + (Sin[Pi m/2]^2) m^r + (Cos[Pi m/2]^2) m^s, {m, 1, n}]; AppendTo[a, k], {n, 1, 100}]; a (* Artur Jasinski *)
    nxt[{n_,a_}]:={n+1,If[OddQ[n+1],a+1,a+(n+1)^4]}; Transpose[ NestList[ nxt,{1,1},40]][[2]] (* Harvey P. Dale, Dec 24 2012 *)

Formula

O.g.f.: x*(x^8+16*x^7-4*x^6+176*x^5+6*x^4+176*x^3-4*x^2+16*x+1)/((-1+x)^6*(1+x)^5) - R. J. Mathar, May 17 2008

A140145 a(1)=1, a(n)=a(n-1)+n^1 if n odd, a(n)=a(n-1)+ n^3 if n is even.

Original entry on oeis.org

1, 9, 12, 76, 81, 297, 304, 816, 825, 1825, 1836, 3564, 3577, 6321, 6336, 10432, 10449, 16281, 16300, 24300, 24321, 34969, 34992, 48816, 48841, 66417, 66444, 88396, 88425, 115425, 115456, 148224, 148257, 187561, 187596, 234252, 234289, 289161
Offset: 1

Views

Author

Artur Jasinski, May 12 2008

Keywords

Crossrefs

Programs

  • Mathematica
    a = {}; r = 1; s = 3; Do[k = 0; Do[k = k + (Sin[Pi m/2]^2) m^r + (Cos[Pi m/2]^2) m^s, {m, 1, n}]; AppendTo[a, k], {n, 1, 100}]; a (*Artur Jasinski*)

Formula

a(n)=a(n-1)+4a(n-2)-4a(n-3)-6a(n-4)+6a(n-5)+4a(n-6)-4a(n-7)-a(n-8)+a(n-9). G.f.: -x*(1+8*x-x^2+32*x^3-x^4+8*x^5+x^6)/((1+x)^4*(x-1)^5). [From R. J. Mathar, Feb 22 2009]

A140146 a(1)=1, a(n)=a(n-1)+n^1 if n odd, a(n)=a(n-1)+ n^4 if n is even.

Original entry on oeis.org

1, 17, 20, 276, 281, 1577, 1584, 5680, 5689, 15689, 15700, 36436, 36449, 74865, 74880, 140416, 140433, 245409, 245428, 405428, 405449, 639705, 639728, 971504, 971529, 1428505, 1428532, 2043188, 2043217, 2853217, 2853248, 3901824, 3901857
Offset: 1

Views

Author

Artur Jasinski, May 12 2008

Keywords

Crossrefs

Programs

  • Mathematica
    a = {}; r = 1; s = 4; Do[k = 0; Do[k = k + (Sin[Pi m/2]^2) m^r + (Cos[Pi m/2]^2) m^s, {m, 1, n}]; AppendTo[a, k], {n, 1, 100}]; a (*Artur Jasinski*)
    nxt[{n_,a_}]:={n+1,If[OddQ[n+1],a+n+1,a+(n+1)^4]}; Transpose[NestList[nxt,{1,1},40]][[2]] (* Harvey P. Dale, Mar 19 2013 *)

Formula

G.f.: -x*(x^2+1)*(x^6-16*x^5-3*x^4-160*x^3+3*x^2-16*x-1)/((1+x)^5*(x-1)^6). [From R. J. Mathar, Feb 22 2009]
Showing 1-10 of 28 results. Next