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

A137276 Triangle T(n,k), read by rows: T(n,k)= 0 if n-k odd. T(n,k)= 2*(-1)^((n-k)/2)*(2k-n)/(n+k)*binomial((n+k)/2,(n-k)/2) if n-k even.

Original entry on oeis.org

1, 0, 1, 2, 0, 1, 0, 1, 0, 1, -2, 0, 0, 0, 1, 0, -3, 0, -1, 0, 1, 2, 0, -3, 0, -2, 0, 1, 0, 5, 0, -2, 0, -3, 0, 1, -2, 0, 8, 0, 0, 0, -4, 0, 1, 0, -7, 0, 10, 0, 3, 0, -5, 0, 1, 2, 0, -15, 0, 10, 0, 7, 0, -6, 0, 1, 0, 9, 0, -25, 0, 7, 0, 12, 0, -7, 0, 1, -2, 0, 24, 0, -35, 0, 0, 0, 18, 0, -8, 0, 1, 0, -11, 0, 49, 0, -42, 0, -12, 0
Offset: 0

Views

Author

Roger L. Bagula and Gary W. Adamson, Mar 13 2008

Keywords

Comments

Polynomial coefficients of P(n,x) in increasing powers, read by rows, where P(0,x)=1, P(1,x)=x, P(2,x)=2+x^2, P(3,x)=x+x^3, P(4,x)=-2+x^4, and P(n,x) = x*P(n-1,x) - P(n-2,x) for n>=5.
The row-reversed version of A135929.
Row sums are repeating 1, 1, 3, 2, -1, -3, -2, 1, 3, 2, -1..., see A138034 and A119910.

Examples

			{1}, = 1
{0, 1}, = x
{2, 0, 1}, = 2+x^2
{0, 1, 0, 1}, = x+x^3
{-2, 0, 0, 0, 1}, = -2+x^4
{0, -3, 0, -1, 0, 1}, = -3x-x^3+x^5
{2, 0, -3, 0, -2, 0, 1},
{0, 5, 0, -2, 0, -3, 0, 1},
{-2, 0, 8, 0, 0, 0, -4, 0, 1},
{0, -7, 0, 10, 0, 3, 0, -5, 0, 1},
{2, 0, -15, 0, 10, 0, 7, 0, -6, 0, 1},
{0, 9, 0, -25, 0, 7, 0, 12, 0, -7, 0, 1}
		

Crossrefs

Programs

  • Maple
    A137276 := proc(n,k) local nmk,npk; if n = 0 then 1; elif (n-k) mod 2 <> 0 then 0; else nmk := (n-k)/2 ; npk := (n+k)/2 ; (-1)^nmk*(2*k-n)/npk*binomial(npk,nmk) ; fi; end:
    seq( seq(A137276(n,k),k=0..n),n=0..13) ;

Formula

T(n,k)= 0 if n-k odd. T(n,k)= 2*(-1)^((n-k)/2)*(2k-n)/(n+k)*binomial((n+k)/2,(n-k)/2) if n-k even.
P(n,x) = x*P(n-1,x)-P(n-2,x), n>=5.
P(n,2*x) = -2*T(n,x)+4*x*U(n-1,x), where T(n,x) is A053120 and U(n,x) is A053117.

Extensions

Fourth row inserted by the Associate Editors of the OEIS, Aug 27 2009

A138034 Expansion of (1+3*x^2)/(1-x+x^2).

Original entry on oeis.org

1, 1, 3, 2, -1, -3, -2, 1, 3, 2, -1, -3, -2, 1, 3, 2, -1, -3, -2, 1, 3, 2, -1, -3, -2, 1, 3, 2, -1, -3, -2, 1, 3, 2, -1, -3, -2, 1, 3, 2, -1, -3, -2, 1, 3, 2, -1, -3, -2, 1, 3, 2, -1, -3, -2, 1, 3, 2, -1, -3, -2, 1, 3, 2, -1, -3, -2, 1, 3, 2, -1, -3, -2, 1, 3, 2, -1, -3, -2, 1, 3, 2, -1, -3, -2, 1, 3, 2, -1, -3, -2, 1, 3, 2, -1, -3, -2, 1, 3, 2, -1, -3, -2, 1, 3
Offset: 0

Views

Author

Karem Boubaker (mmbb11112000(AT)yahoo.fr), Mar 01 2008; corrected Mar 03 2008

Keywords

Comments

Essentially a duplicate of A119910: 1, followed by A119910. - Joerg Arndt, Nov 14 2014

Crossrefs

Programs

  • Mathematica
    CoefficientList[Series[(1 + 3*x^2)/(1 - x + x^2), {x, 0, 100}], x] (* Wesley Ivan Hurt, Jan 15 2017 *)
    LinearRecurrence[{1,-1},{1,1,3},120] (* Harvey P. Dale, Jun 14 2024 *)

Formula

a(n) = A119910(n), n>=1.
G.f.: (1+3*x^2)/(1-x+x^2). a(n)=a(n-1)-a(n-2), n>2.

A130624 Binomial transform of A101000.

Original entry on oeis.org

0, 1, 5, 12, 23, 43, 84, 169, 341, 684, 1367, 2731, 5460, 10921, 21845, 43692, 87383, 174763, 349524, 699049, 1398101, 2796204, 5592407, 11184811, 22369620, 44739241, 89478485, 178956972, 357913943, 715827883, 1431655764, 2863311529, 5726623061, 11453246124
Offset: 0

Views

Author

Paul Curtz, Jun 18 2007

Keywords

Crossrefs

Cf. A101000, A119910, A130625 (first differences), A130626 (second differences).

Programs

  • Magma
    m:=32; S:=[[0, 1, 3][(n-1) mod 3 +1]: n in [1..m]]; [&+[Binomial(i-1, k-1)*S[k]: k in [1..i]]: i in [1..m]]; /* Klaus Brockhaus, Jun 21 2007 */
    
  • Magma
    I:=[0,1,5]; [n le 3 select I[n] else 3*Self(n-1)-3*Self(n-2)+2*Self(n-3): n in [1..50]]; // Vincenzo Librandi, Nov 15 2018
  • Mathematica
    LinearRecurrence[{3,-3,2},{0,1,5},40] (* Harvey P. Dale, Mar 05 2013 *)
    RecurrenceTable[{a[0]==0, a[1]==1, a[n]==(2^n) + a[n-1] - a[n-2]}, a, {n, 50}] (* Vincenzo Librandi, Nov 15 2018 *)
  • PARI
    {m=32; v=concat([0, 1, 5], vector(m-3)); for(n=4, m, v[n]=3*v[n-1]-3*v[n-2]+2*v[n-3]); v} /* Klaus Brockhaus, Jun 21 2007 */
    

Formula

a(0)=0, a(1)=1, a(2)=5; for n>2, a(n) = 3*a(n-1) - 3*a(n-2) + 2*a(n-3).
a(0)=0; a(n+1) = 2*a(n) + A119910(n).
G.f.: x*(1 + 2*x)/((1 - 2*x)*(1 - x + x^2)).
a(n) = 2^n + a(n-1) - a(n-2). - Jon Maiga, Nov 14 2018

Extensions

Edited and extended by Klaus Brockhaus, Jun 21 2007

A124038 Triangle read by rows: T(n, k) = T(n-1, k-1) - T(n-2, k), with T(n, n) = 1, T(n, n-1) = -2.

Original entry on oeis.org

1, -2, 1, -1, -2, 1, 2, -2, -2, 1, 1, 4, -3, -2, 1, -2, 3, 6, -4, -2, 1, -1, -6, 6, 8, -5, -2, 1, 2, -4, -12, 10, 10, -6, -2, 1, 1, 8, -10, -20, 15, 12, -7, -2, 1, -2, 5, 20, -20, -30, 21, 14, -8, -2, 1, -1, -10, 15, 40, -35, -42, 28, 16, -9, -2, 1
Offset: 0

Views

Author

Gary W. Adamson and Roger L. Bagula, Nov 03 2006

Keywords

Examples

			Triangular sequence begins as:
   1;
  -2,   1;
  -1,  -2,   1;
   2,  -2,  -2,   1;
   1,   4,  -3,  -2,   1;
  -2,   3,   6,  -4,  -2,   1;
  -1,  -6,   6,   8,  -5,  -2,  1;
   2,  -4, -12,  10,  10,  -6, -2,  1;
   1,   8, -10, -20,  15,  12, -7, -2,  1;
  -2,   5,  20, -20, -30,  21, 14, -8, -2,  1;
  -1, -10,  15,  40, -35, -42, 28, 16, -9, -2, 1;
		

Crossrefs

Row reversal of: A374439.
Columns are related to: A000034 (k=0), A029578 (k=1), A131259 (k=2).
Diagonals are related to: A113679 (k=n-1), A022958 (k=n-2), A005843 (k=n-3), A000217 (k=n-4), -A002378 (k=n-5).
Sums include: (-1)^floor((n+1)/2)*A016116 (signed diagonal), A057079 (row), A119910 (signed row), (-1)^n*A130706 (diagonal).

Programs

  • Magma
    function T(n,k) // T = A124038
      if k lt 0 or k gt n then return 0;
      elif k ge n-2 then return k-n + (-1)^(n+k);
      else return T(n-1,k-1) - T(n-2,k);
      end if;
    end function;
    [T(n,k): k in [0..n], n in [0..12]]; // G. C. Greubel, Jan 22 2025
  • Mathematica
    (* First program *)
    t[n_, m_, d_]:= If[n==m && n>1 && m>1, x, If[n==m-1 || n==m+1, -1, If[n==m== 1, x-2, 0]]];
    M[d_]:= Table[t[n,m,d], {n,d}, {m,d}];
    Join[{{1}}, Table[CoefficientList[Table[Det[M[d]], {d,10}][[d]], x], {d,10}]]//Flatten
    (* Second program *)
    T[n_, k_]:= T[n, k] = If[k<0 || k>n, 0, If[k>n-2, k-n+(-1)^(n-k), T[n-1, k- 1] -T[n-2,k]]];
    Table[T[n,k], {n,0,12}, {k,0,n}]//Flatten (* G. C. Greubel, Jan 22 2025 *)
  • SageMath
    @CachedFunction
    def A124038(n,k):
        if n< 0: return 0
        if n==0: return 1 if k == 0 else 0
        h = 2*A124038(n-1,k) if n==1 else 0
        return A124038(n-1,k-1) - A124038(n-2,k) - h
    for n in (0..9): [A124038(n,k) for k in (0..n)] # Peter Luschny, Nov 20 2012
    
  • SageMath
    from sage.combinat.q_analogues import q_stirling_number2
    def A124038(n,k): return (1 + ((n-k)%2))*q_stirling_number2(n+1, n-k+1, -1)
    print(flatten([[A124038(n, k) for k in range(n+1)] for n in range(13)])) # G. C. Greubel, Jan 22 2025
    

Formula

From G. C. Greubel, Jan 22 2025: (Start)
T(n, k) = T(n-1, k-1) - T(n-2, k), with T(n, n) = 1, T(n, n-1) = -2.
T(n, k) = (-1)^floor((n-k+1)/2)*(1 + (n-k mod 2))*qStirling2(n+1, n-k+1,-1).
T(2*n, n) = (1/2)*(-1)^floor(n/2)*( (1+(-1)^n)*A005809(n/2) - 2*(1-(-1)^n)* A045721((n-1)/2) ). (End)

Extensions

Edited by G. C. Greubel, Jan 22 2025

A134977 Period 6: repeat [1, 4, 2, 3, 0, 2].

Original entry on oeis.org

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

Views

Author

Paul Curtz, Feb 04 2008

Keywords

Comments

Northwest diagonal sums of A134658, omitting row 0.

Crossrefs

Programs

Formula

O.g.f.: -1/(x+1)-2/(x-1)+x/(x^2-x+1). a(n) = 2-(-1)^n+A010892(n-1). - R. J. Mathar, Feb 08 2008
From Wesley Ivan Hurt, Jun 18 2016: (Start)
a(n) = a(n-1) - a(n-3) + a(n-4) for n>3.
a(n) = (6-3*cos(n*Pi)+2*sqrt(3)*sin(n*Pi/3))/3. (End)

A135694 Period 6: repeat [1, -1, -1, -1, 0, 2].

Original entry on oeis.org

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

Views

Author

Paul Curtz, Feb 24 2008

Keywords

Crossrefs

Programs

Formula

From R. J. Mathar, Mar 31 2008: (Start)
a(n) = a(n-6) for n>5. a(n) = -a(n-2) - a(n-4) for n>3.
a(n) = (A119910(n+3) - A049347(n+1))/2 for n>0.
G.f.: (1-x-2*x^3)/((x^2-x+1)*(x^2+x+1)). (End)
a(n) = (3*cos(n*Pi/3) - 8*sqrt(3)*cos(n*Pi/6)^3*sin(n*Pi/6))/3. - Wesley Ivan Hurt, Jun 22 2016

Extensions

More periods from R. J. Mathar, Feb 07 2009

A155751 A variation on 10^n mod 17.

Original entry on oeis.org

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

Views

Author

Ferruccio Guidi (fguidi(AT)cs.unibo.it), Jan 26 2009, Feb 08 2009

Keywords

Comments

This is 10^n mod 17, using values -8,-7,...,7,8 (instead of 0..16). - Don Reble, Sep 02 2017.
This sequence can be employed in a test for divisibility by 17 and works like A033940 works for 7.
The use of negative coefficients ensures the termination of the test because the modulus of the intermediate sum at each step of the test decreases strictly.
The test is successful if the final sum is 0.
The negative coefficients have the form (10^n mod 17) - 17 when 10^n mod 17 > 8.
Example: 9996 is divisible by 17 since |6*1 + 9*(-7) + 9*(-2) + 9*(-3)| = 102 and 2*1 + 0*(-7) + 1*(-2) = 0.

Crossrefs

Formula

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

A188125 Number of strictly increasing arrangements of 6 nonzero numbers in -(n+4)..(n+4) with sum zero.

Original entry on oeis.org

4, 16, 52, 137, 308, 624, 1154, 1999, 3278, 5144, 7772, 11387, 16230, 22602, 30830, 41303, 54440, 70734, 90706, 114963, 144146, 178984, 220244, 268797, 325548, 391514, 467756, 555449, 655816, 770208, 900020, 1046787, 1212094, 1397668
Offset: 0

Views

Author

R. H. Hardin, Mar 21 2011

Keywords

Comments

Row 6 of A188122.

Examples

			4 + 16*x + 52*x^2 + 137*x^3 + 308*x^4 + 624*x^5 + 1154*x^6 + 1999*x^7 + 3278*x^8 + ...
Some solutions for n=6
-10...-8...-7...-8...-8...-9...-9...-9...-9...-7..-10...-9...-7..-10...-9...-9
.-8...-6...-5...-5...-6...-3...-7...-3...-2...-5...-6...-5...-5...-6...-4...-5
.-1....1...-1...-1...-1...-2...-2....1...-1...-2...-2...-1...-1...-2...-2...-4
..4....3....1....1....2....3....3....2....1....1....2....1....3....3....1....3
..7....4....2....3....5....4....5....4....2....4....6....6....4....5....5....6
..8....6...10...10....8....7...10....5....9....9...10....8....6...10....9....9
		

Crossrefs

Programs

  • PARI
    {a(n) = local(v, c, m); m = n+4; forvec( v = vector( 6, i, [-m, m]), if( 0==prod( k=1, 6, v[k]), next); if( 0==sum( k=1, 6, v[k]), c++), 2); c} /* Michael Somos, Apr 11 2011 */

Formula

Empirical: a(n)=2*a(n-1)-a(n-3)-a(n-5)+2*a(n-8)-a(n-11)-a(n-13)+2*a(n-15)-a(n-16)
= 168587/43200 +187*n/32 +3593*n^3/2160 +619*n^2/144 +457*n^4/1440 +11*n^5/450 -(-1)^n/64-3*n*(-1)^n/32 +4*(-1)^n*A119910(n+1)/27 -2*A117444(n+2)/25 +A057077(n)/8.
Empirical: G.f. -x*(-16 -20*x -33*x^2 -50*x^3 -60*x^4 -59*x^5 -51*x^6 -41*x^7 -18*x^8 -3*x^9 -x^10 +x^11 +4*x^12 -2*x^13 -7*x^14 +4*x^15) / ( (1+x+x^2) *(x^4+x^3+x^2+x+1) *(x^2+1) *(1+x)^2 *(x-1)^6 ). - R. J. Mathar, Mar 21 2011

A155754 A variation on 10^n mod 19.

Original entry on oeis.org

1, -9, 5, -7, 6, 3, -8, -4, -2, -1, 9, -5, 7, -6, -3, 8, 4, 2, 1, -9, 5, -7, 6, 3, -8, -4, -2, -1, 9, -5, 7, -6, -3, 8, 4, 2, 1, -9, 5, -7, 6, 3, -8, -4, -2, -1, 9, -5, 7, -6, -3, 8, 4, 2, 1, -9, 5, -7, 6, 3, -8, -4, -2, -1, 9, -5, 7, -6, -3, 8, 4, 2
Offset: 0

Views

Author

Ferruccio Guidi (fguidi(AT)cs.unibo.it), Jan 26 2009

Keywords

Comments

This sequence can be employed in a test for divisibility by 19 and works like A033940 works for 7.
The use of negative coefficients ensures the termination of the test because the modulus of the intermediate sum at each step of the test decreases strictly.
The test is successful if the final sum is 0.
The negative coefficients have the form (10^n mod 19) - 19 when 10^n mod 19 > 9.
Example: 8284 is divisible by 19 since |4*1 + 8*(-9) + 2*5 + 8*(-7)| = 114 and 4*1 + 1*(-9) + 1*5 = 0.

Crossrefs

Formula

a(n) = -a(n-9). G.f.: (-2*x^8-4*x^7-8*x^6+3*x^5+6*x^4-7*x^3+5*x^2-9*x+1) / (x^9+1). [Colin Barker, Feb 14 2013]
Showing 1-9 of 9 results.