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

A109265 Row sums of Riordan array (1-x-x^2,x(1-x)).

Original entry on oeis.org

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

Views

Author

Paul Barry, Jun 24 2005

Keywords

Examples

			G.f. = 1 - 2*x^2 - 2*x^3 + 2*x^5 + 2*x^6 - 2*x^8 - 2*x^9 + 2*x^11 + 2*x^12 + ...
		

Crossrefs

Programs

  • Magma
    m:=25; R:=PowerSeriesRing(Integers(), m); Coefficients(R!((1-x-x^2)/(1-x+x^2))); // G. C. Greubel, Aug 04 2018
  • Mathematica
    CoefficientList[Series[(1-x-x^2)/(1-x+x^2), {x, 0, 60}], x] (* G. C. Greubel, Aug 04 2018 *)
    LinearRecurrence[{1,-1},{1,0,-2},120] (* Harvey P. Dale, Apr 08 2019 *)
  • PARI
    {a(n) = n+=2; if( n<3, n==2, 2 * (n%3>0) * (-1)^(n\3))}; /* Michael Somos, Apr 15 2015 */
    

Formula

G.f.: (1-x-x^2)/(1-x+x^2).
a(n) = -a(n+3) if n>0. - Michael Somos, Apr 15 2015
a(n) = A257076(n+1). - Michael Somos, Apr 15 2015
Convolution inverse of A006355. - Michael Somos, Apr 15 2015
a(n) = A130772(n+1) = A184334(n+2) if n>0. - Michael Somos, Sep 01 2015

A194960 a(n) = floor((n+2)/3) + ((n-1) mod 3).

Original entry on oeis.org

1, 2, 3, 2, 3, 4, 3, 4, 5, 4, 5, 6, 5, 6, 7, 6, 7, 8, 7, 8, 9, 8, 9, 10, 9, 10, 11, 10, 11, 12, 11, 12, 13, 12, 13, 14, 13, 14, 15, 14, 15, 16, 15, 16, 17, 16, 17, 18, 17, 18, 19, 18, 19, 20, 19, 20, 21, 20, 21, 22, 21, 22, 23, 22, 23, 24, 23, 24, 25, 24, 25, 26, 25, 26
Offset: 1

Views

Author

Clark Kimberling, Sep 06 2011

Keywords

Comments

The sequence is formed by concatenating triples of the form (n, n+1, n+2) for n>=1. See A194961 and A194962 for the associated fractalization and interspersion. The sequence can be obtained from A008611 by deleting its first four terms.
The sequence contains every positive integer n exactly min(n,3) times. - Wesley Ivan Hurt, Dec 17 2013

Crossrefs

Programs

  • Magma
    I:=[1,2,3,2]; [n le 4 select I[n] else Self(n-1)+Self(n-3)-Self(n-4): n in [1..100]]; // Vincenzo Librandi, Dec 17 2013
    
  • Maple
    A194960:=n->floor((n+2)/3)+((n-1) mod 3); seq(A194960(n), n=1..100); # Wesley Ivan Hurt, Dec 17 2013
  • Mathematica
    (* First program *)
    p[n_]:= Floor[(n+2)/3] + Mod[n-1, 3]
    Table[p[n], {n, 1, 90}]  (* A194960 *)
    g[1] = {1}; g[n_]:= Insert[g[n-1], n, p[n]]
    f[1] = g[1]; f[n_]:= Join[f[n-1], g[n]]
    f[20]  (* A194961 *)
    row[n_]:= Position[f[30], n];
    u = TableForm[Table[row[n], {n, 1, 5}]]
    v[n_, k_]:= Part[row[n], k];
    w = Flatten[Table[v[k, n-k+1], {n, 1, 13}, {k, 1, n}]]  (* A194962 *)
    q[n_]:= Position[w, n];
    Flatten[Table[q[n], {n, 1, 80}]]  (* A194963 *)
    (* Other programs *)
    CoefficientList[Series[(1 +x +x^2 -2 x^3)/((1+x+x^2) (1-x)^2), {x, 0, 100}], x] (* Vincenzo Librandi, Dec 17 2013 *)
    Table[(n+4 -2*ChebyshevU[2*n+4, 1/2])/3, {n,80}] (* G. C. Greubel, Oct 23 2022 *)
  • PARI
    a(n)=(n+2)\3 + (n-1)%3 \\ Charles R Greathouse IV, Sep 02 2015
    
  • SageMath
    [(n+4 - 2*chebyshev_U(2*n+4, 1/2))/3 for n in (1..80)] # G. C. Greubel, Oct 23 2022

Formula

From R. J. Mathar, Sep 07 2011: (Start)
a(n) = ((-1)^n*A130772(n) + n + 4)/3.
G.f.: x*(1 + x + x^2 - 2*x^3)/((1+x+x^2)*(1-x)^2). (End)
a(n) = A006446(n)/floor(sqrt(A006446(n))). - Benoit Cloitre, Jan 15 2012
a(n) = a(n-1) + a(n-3) - a(n-4). - Vincenzo Librandi, Dec 17 2013
a(n) = a(n-3) + 1, n >= 1, with input a(-2) = 0, a(-1) = 1 and a(0) = 2. Proof trivial. a(n) = A008611(n+3), n >= -2. See the first comment above. - Wolfdieter Lang, May 06 2017
From Guenther Schrack, Nov 09 2020: (Start)
a(n) = n - 2*floor((n-1)/3).
a(n) = (n + 2 + 2*((n-1) mod 3))/3.
a(n) = (3*n + 12 + 2*(w^(2*n)*(1 - w) + w^n*(2 + w)))/9, where w = (-1 + sqrt(-3))/2.
a(n) = (n + 4 + 2*A049347(n))/3.
a(n) = (2*n + 3 - A330396(n-1))/3. (End)
a(n) = (n + 4 - 2*A010892(2*n+4))/3. - G. C. Greubel, Oct 23 2022

A184334 Period 6 sequence [0, 2, 2, 0, -2, -2, ...] except a(0) = 1.

Original entry on oeis.org

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

Views

Author

Michael Somos, Feb 13 2011

Keywords

Examples

			G.f. = 1 + 2*x + 2*x^2 - 2*x^4 - 2*x^5 + 2*x^7 + 2*x^8 - 2*x^10 - 2*x^11 + ...
		

Crossrefs

Programs

  • Magma
    m:=30; R:=PowerSeriesRing(Integers(), m); Coefficients(R!((1 + x+x^2)/(1-x+x^2))); // G. C. Greubel, Aug 04 2018
  • Mathematica
    PadRight[{1},120,{0,2,2,0,-2,-2}] (* Harvey P. Dale, Apr 02 2015 *)
    a[ n_] := Boole[n == 0] + {2, 2, 0, -2, -2, 0}[[Mod[n, 6, 1]]]; (* Michael Somos, Sep 01 2015 *)
  • PARI
    {a(n) = (n==0) + [ 0, 2, 2, 0, -2, -2][n%6+1]};
    
  • PARI
    {a(n) = (n==0) + 2 * (-1)^(n\3) * sign( n%3)};
    

Formula

a(n) = 2 * b(n) where b() is multiplicative with b(2^e) = (-1)^(e-1) if e>0, b(3^e) = 0^e, b(p^e) = 1 if p == 1 mod 6, b(p^e) = (-1)^e if p == 5 mod 6.
Euler transform of length 6 sequence [2, -1, -2, 0, 0, 1].
G.f. A(x) satisfies 0 = f(A(x), A(x^2)) where f(u, v) = 2 * u * (v - 1) - (u - 1)^2 * v.
G.f.: (1 + x + x^2) / (1 - x + x^2).
a(-n) = -a(n) unless n = 0. a(n+3) = -a(n) unless n = 0 or n = -3.
G.f.: 1 / (1 - 2*x / (1 + x / (1 - x / (1 + x)))). - Michael Somos, Jan 03 2013
a(n) = A130772(n-1) if n>0.
a(n) = A257076(n-1) = A109265(n-2) if n>2. - Michael Somos, Sep 01 2015

A257076 Expansion of (1 - x^3) / (1 - x + x^2) in powers of x.

Original entry on oeis.org

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

Views

Author

Michael Somos, Apr 15 2015

Keywords

Examples

			G.f. = 1 + x - 2*x^3 - 2*x^4 + 2*x^6 + 2*x^7 - 2*x^9 - 2*x^10 + 2*x^12 + ...
		

Crossrefs

Programs

  • Magma
    m:=50; R:=PowerSeriesRing(Integers(), m); Coefficients(R!((1 - x^3)/(1-x+x^2))); // G. C. Greubel, Aug 03 2018
  • Mathematica
    a[ n_] := SeriesCoefficient[ (1 - x^3) / (1 - x + x^2), {x, 0, n}];
    Join[{1, 1},LinearRecurrence[{1, -1},{0, -2},76]] (* Ray Chandler, Aug 10 2015 *)
  • PARI
    {a(n) = n++; if( n<3, n>0, 2 * (n%3>0) * (-1)^(n\3))};
    
  • PARI
    {a(n) = if( n<0, 0, polcoeff( (1 - x^3) / (1 - x + x^2) + x * O(x^n), n))};
    

Formula

Euler transform of length 6 sequence [ 1, -1, -2, 0, 0, 1].
G.f.: (1 - x^2) * (1 - x^3)^2 / ((1 - x) * (1 - x^6)).
a(n) = -a(n+3) if n>1.
a(n) = A109265(n-1) if n>0.
Convolution inverse of A257075.
a(n) = A130772(n) for n>1. - R. J. Mathar, Apr 19 2015
a(n) = A184334(n+1) if n>1. - Michael Somos, Sep 01 2015

A131562 a(n)= -3a(n-1) -3a(n-2)-2a(n-3), a(0)=1, a(1)=-2, a(2)=2.

Original entry on oeis.org

1, -2, 2, -2, 4, -10, 22, -44, 86, -170, 340, -682, 1366, -2732, 5462, -10922, 21844, -43690, 87382, -174764, 349526, -699050, 1398100, -2796202, 5592406, -11184812, 22369622, -44739242, 89478484, -178956970, 357913942, -715827884, 1431655766, -2863311530
Offset: 0

Views

Author

Paul Curtz, Aug 27 2007

Keywords

Crossrefs

Cf. A130707.

Programs

  • Mathematica
    LinearRecurrence[{-3,-3,-2},{1,-2,2},40] (* Harvey P. Dale, Jan 11 2017 *)

Formula

|v(n)| = 2^n+A130772(n); 2*|v(n)|-|v(n+1)|= 2*A057079(n), where v(n)=a(n+1)-a(n) are first differences.
O.g.f.: (1+x-x^2)/((1+2*x)*(1+x+x^2)). a(n)=(-1)^n*A130707(n). - R. J. Mathar, Jul 07 2008
Binomial transform yields A130151 without the first two terms. - R. J. Mathar, Jul 07 2008

Extensions

Edited by R. J. Mathar, Jul 07 2008

A168673 Binomial transform of A169609.

Original entry on oeis.org

1, 4, 10, 20, 38, 74, 148, 298, 598, 1196, 2390, 4778, 9556, 19114, 38230, 76460, 152918, 305834, 611668, 1223338, 2446678, 4893356, 9786710, 19573418, 39146836, 78293674, 156587350, 313174700, 626349398, 1252698794, 2505397588, 5010795178, 10021590358
Offset: 0

Views

Author

Paul Curtz, Dec 02 2009

Keywords

Comments

Sequence and successive differences are identical to their third differences. See principal sequence A024495. Main diagonal of the array of successive differences is A083595 (1,6,8,20,36,...).

Crossrefs

Programs

  • Magma
    I:=[1,4,10]; [n le 3 select I[n] else 3*Self(n-1)- 3*Self(n-2)+2*Self(n-3): n in [1..40]]; // Vincenzo Librandi, Jul 30 2016
    
  • Mathematica
    LinearRecurrence[{3,-3,2},{1,4,10},25] (* G. C. Greubel, Jul 29 2016 *)
    RecurrenceTable[{a[0] == 1, a[1] == 4, a[2] == 10, a[n] == 3 a[n-1] - 3 a[n-2] + 2 a[n-3]}, a, {n, 40}] (* Vincenzo Librandi, Jul 30 2016 *)
  • PARI
    a(n)=([0,1,0; 0,0,1; 2,-3,3]^n*[1;4;10])[1,1] \\ Charles R Greathouse IV, Jul 30 2016

Formula

a(n+1) - 2a(n) = A130772(n).
a(n) = A062092(n) - A130151(n+1).
a(n) = 3*a(n-1) - 3*a(n-2) + 2*a(n-3) for n > 2; a(0) = 1, a(1) = 4, a(2) = 10.
G.f.: (1 + x + x^2)/(1 -3*x +3*x^2 -2*x^3). - Philippe Deléham, Dec 03 2009

Extensions

Edited and extended by Klaus Brockhaus, Dec 03 2009
Showing 1-6 of 6 results.