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.

Previous Showing 11-20 of 20 results.

A166711 Permutation of the integers: two positives, one negative.

Original entry on oeis.org

0, 1, 2, -1, 3, 4, -2, 5, 6, -3, 7, 8, -4, 9, 10, -5, 11, 12, -6, 13, 14, -7, 15, 16, -8, 17, 18, -9, 19, 20, -10, 21, 22, -11, 23, 24, -12, 25, 26, -13, 27, 28, -14, 29, 30, -15, 31, 32, -16, 33, 34, -17, 35, 36, -18, 37, 38, -19, 39, 40, -20, 41, 42, -21, 43, 44, -22, 45, 46
Offset: 0

Views

Author

Jaume Oliver Lafont, Oct 18 2009

Keywords

Comments

Setting m=2 in
log(m) = Sum_{n>0} (n mod m - (n-1) mod m)/n [1]
yields the sum
log(2) = (1 -1/2) +(1/3 -1/4) +(1/5 -1/6)+...
Substituting every -1/d by 1/d - 2/d we obtain
log(2) = (1+1/2-1)+(1/3+1/4-1/2)+(1/5+1/6-1/3)+...
a(n) is the sequence of denominators of this modified sum with unit numerators, so
Sum_{k>0} 1/a(k) = log(2)
Substituting -1/d by -2/d + 1/d would yield another permutation (one positive, one negative, one positive) with the same sum of inverses.
Similar sequences (m positives, one negative) may be obtained for the logarithm of any integer m>0. A001057 is the case m=1, with sum of inverses log(1).
Equation [1] is a result of expanding log( Sum_{0<=k<=m-1} x^k ) at x=1 (see comment to A061347.)

Crossrefs

Cf. A001057, A002162, A038608. Signed and shifted version of A009947.

Programs

  • Mathematica
    LinearRecurrence[{0, 0, 2, 0, 0, -1}, {0, 1, 2, -1, 3, 4}, 100] (* G. C. Greubel, May 24 2016 *)
    Join[{0},With[{nn=50},Riffle[Range[nn],Range[-1,-nn/2,-1],3]]] (* Harvey P. Dale, May 15 2023 *)
  • PARI
    a(n)=(2*(n+1)\3)*(1-3/2*!(n%3))
    
  • PARI
    a(n)=if(n>=0,[ -n\3, 2*(n\3)+1, 2*(n\3)+2][n%3+1]) \\ Jaume Oliver Lafont, Nov 14 2009

Formula

G.f.: (x*(1+2*x-x^2+x^3)/((1-x)^2*(1+x+x^2)^2)).
a(0)=0, a(1)=1, a(2)=2, a(3)=-1, a(4)=3, a(5)=4, a(n)=2*a(n-3)-a(n-6), n>=6.
a(n) = (n+1)/3 +2*A049347(n)/3 -(-1)^n*A076118(n+1). - R. J. Mathar, Oct 30 2009

Extensions

Corrected by Jaume Oliver Lafont, Oct 22 2009
frac keyword removed by Jaume Oliver Lafont, Nov 02 2009

A097141 Expansion of x*(1+2*x)/(1+x)^2.

Original entry on oeis.org

0, 1, 0, -1, 2, -3, 4, -5, 6, -7, 8, -9, 10, -11, 12, -13, 14, -15, 16, -17, 18, -19, 20, -21, 22, -23, 24, -25, 26, -27, 28, -29, 30, -31, 32, -33, 34, -35, 36, -37, 38, -39, 40, -41, 42, -43, 44, -45, 46, -47, 48, -49, 50, -51, 52, -53, 54, -55, 56, -57, 58, -59, 60
Offset: 0

Views

Author

Paul Barry, Jul 29 2004

Keywords

Comments

Partial sums of A097140.
Binomial transform is x(1+x)/(1-x), or {0,1,2,2,2,2,....}.
Second binomial transform is x/((1-x)^2(1 - 2x)), or Eulerian numbers A000295(n+1).

Crossrefs

Programs

Formula

G.f.: x*(1+2*x)/(1+x)^2.
a(n) = (n-2)*(-1)^n + 2*0^n.
a(n) = -2*a(n-1) - a(n-2) for n > 2.
a(n) = A099570(n) for n > 1. - R. J. Mathar, Dec 15 2008
a(n) = (Sum_{k=1..n} k*(-1)^(n-k)*binomial(n-1,k-1)*binomial(2*n-k-1,n-1))/n, n>0, a(0)=0. - Vladimir Kruchinin, Mar 09 2014
a(n) = A038608(n-2) for n > 2. - Georg Fischer, Oct 06 2018
E.g.f.: 2 - exp(-x)*(2 + x). - Stefano Spezia, Mar 07 2023

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

Original entry on oeis.org

1, 0, 0, -1, 2, -3, 4, -5, 6, -7, 8, -9, 10, -11, 12, -13, 14, -15, 16, -17, 18, -19, 20, -21, 22, -23, 24, -25, 26, -27, 28, -29, 30, -31, 32, -33, 34, -35, 36, -37, 38, -39, 40, -41, 42, -43, 44, -45, 46, -47, 48, -49, 50, -51, 52, -53, 54, -55, 56, -57, 58, -59, 60, -61, 62, -63, 64, -65, 66, -67, 68, -69, 70, -71, 72, -73
Offset: 0

Views

Author

Paul Barry, Oct 22 2004

Keywords

Comments

Row sums of number triangle A099569.

Crossrefs

Programs

  • Magma
    [1,0] cat [(-1)^n*(n-2): n in [2..100]]; // G. C. Greubel, Jul 25 2022
    
  • Mathematica
    Table[(-1)^n*(n-2) -Boole[n==1]+3*Boole[n==0], {n,0,100}] (* G. C. Greubel, Jul 25 2022 *)
  • SageMath
    [(-1)^n*(n-2) -bool(n==1) +3*bool(n==0) for n in (0..100)] # G. C. Greubel, Jul 25 2022

Formula

a(n) = 2*0^n + (-1)^n*(n-2) - Sum_{k=0..n} k*binomial(n, k)*(-1)^(n-k).
a(n) = -2*a(n-1) - a(n-2), n>3, with a(0) = 1, a(1) = 0, a(2) = 0, a(3) = -1.
From G. C. Greubel, Jul 25 2022: (Start)
a(n) = (-1)^n*(n-2) - [n=1] + 3*[n=0].
a(n) = A038608(n-2), for n >= 2, with a(0) = 1, a(1) = 0.
E.g.f.: 3 - x - (x+2)*exp(-x). (End)

A076040 a(n) = (-1)^n * (3^n - 1)/2.

Original entry on oeis.org

0, -1, 4, -13, 40, -121, 364, -1093, 3280, -9841, 29524, -88573, 265720, -797161, 2391484, -7174453, 21523360, -64570081, 193710244, -581130733, 1743392200, -5230176601, 15690529804, -47071589413, 141214768240, -423644304721, 1270932914164
Offset: 0

Views

Author

M. F. Hasler, Oct 21 2014

Keywords

Crossrefs

Programs

  • Mathematica
    Table[(-1)^n*(3^n -1)/2, {n, 0, 30}] (* G. C. Greubel, Jun 18 2021 *)
  • PARI
    concat(0, Vec(-x/((x+1)*(3*x+1)) + O(x^100))) \\ Colin Barker, Oct 22 2014
    
  • Sage
    [(-1)^n*(3^n -1)/2 for n in (0..30)] # G. C. Greubel, Jun 18 2021

Formula

Equals A038608 o A003462 = A033999 * A003462, i.e., a(n) = (-1)^n*A003462(n) = (-1)^A003462(n)*A003462(n) = A038608(A003462(n)). - M. F. Hasler, Oct 21 2014
From Colin Barker, Oct 22 2014: (Start)
a(n) = -4*a(n-1) - 3*a(n-2).
G.f.: -x / ((1+x)*(1+3*x)). (End)
E.g.f.: (-1)*exp(-2*x)*sinh(x). - G. C. Greubel, Jun 18 2021

Extensions

Former duplicate of A003462 changed to the signed variant by M. F. Hasler, Oct 21 2014

A062534 Table by antidiagonals of coefficient of x^k in expansion of 1/((1+x)^2*(1-x)^n).

Original entry on oeis.org

1, -2, 1, 3, -1, 1, -4, 2, 0, 1, 5, -2, 2, 1, 1, -6, 3, 0, 3, 2, 1, 7, -3, 3, 3, 5, 3, 1, -8, 4, 0, 6, 8, 8, 4, 1, 9, -4, 4, 6, 14, 16, 12, 5, 1, -10, 5, 0, 10, 20, 30, 28, 17, 6, 1, 11, -5, 5, 10, 30, 50, 58, 45, 23, 7, 1, -12, 6, 0, 15, 40, 80, 108, 103, 68, 30, 8, 1, 13, -6, 6, 15, 55, 120, 188, 211, 171, 98, 38, 9, 1, -14, 7, 0, 21, 70, 175
Offset: 0

Views

Author

Henry Bottomley, Jun 25 2001

Keywords

Crossrefs

Rows are effectively (with minor adjustments): A038608, A001057, A027656, A008805, A006918, A002624, A028346. Cf. A058394 which (adjusting for signs and an overlap of three rows) is effectively the continuation of this table for negative n.

Formula

Each row is partial sum of preceding row, i.e. T(n, k)=T(n-1, k)+T(n, k-1) with T(0, k)=(k+1)*(-1)^k and T(n, 0)=1.

A176624 a(n) = prime(n) + n*(-1)^n.

Original entry on oeis.org

1, 5, 2, 11, 6, 19, 10, 27, 14, 39, 20, 49, 28, 57, 32, 69, 42, 79, 48, 91, 52, 101, 60, 113, 72, 127, 76, 135, 80, 143, 96, 163, 104, 173, 114, 187, 120, 201, 128, 213, 138, 223, 148, 237, 152, 245, 164, 271, 178, 279, 182, 291, 188, 305, 202, 319, 212, 329, 218
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Apr 22 2010

Keywords

Examples

			a(1)=1 because prime(1) + 1*(-1)^1 = 1.
		

Crossrefs

Programs

  • Magma
    [NthPrime(n) +(-1)^n*n: n in [1..60]]; // G. C. Greubel, Jul 01 2021
    
  • Maple
    A176624 := proc(n) ithprime(n)+n*(-1)^n ; end proc: seq(A176624(n),n=1..120) ; # R. J. Mathar, Apr 27 2010
  • Mathematica
    Table[Prime[n]+(-1)^n*n, {n,60}] (* G. C. Greubel, Jul 01 2021 *)
  • Sage
    [nth_prime(n) +(-1)^n*n for n in (1..60)] # G. C. Greubel, Jul 01 2021

Formula

a(n) = A000040(n) + A038608(n+1).

Extensions

Entries checked by R. J. Mathar, Apr 27 2010

A195084 a(2n-1) = 2-n, a(2n) = 2+n.

Original entry on oeis.org

2, 1, 3, 0, 4, -1, 5, -2, 6, -3, 7, -4, 8, -5, 9, -6, 10, -7, 11, -8, 12, -9, 13, -10, 14, -11, 15, -12, 16, -13, 17, -14, 18, -15, 19, -16, 20, -17, 21, -18, 22, -19, 23, -20, 24, -21, 25, -22, 26, -23, 27, -24, 28, -25, 29, -26, 30, -27, 31, -28, 32, -29, 33
Offset: 0

Views

Author

Dave Durgin, Sep 08 2011

Keywords

Comments

Start with a(0)=2, subtract 1, add 2, subtract 3, add 4, subtract 5 and so on.
A permutation of all integers. - Ruud H.G. van Tol, Sep 21 2024

Crossrefs

Formula

From Bruno Berselli, Sep 12 2011: (Start)
G.f.: (2*x^2+3*x+2)/((1-x)*(1+x)^2).
a(n) = a(-n-1) = -((2*n+1)*a(n-1)-7*n)/(2*n-1) = -a(n-1)+a(n-2)+a(n-3).
a(n) = ((2*n+1)*(-1)^n+7)/4.
a(n) = 2 - A001057(n).
a(n)-a(n-1) = A038608(n); a(n)+a(n-1) = A010702(n-1).
Sum(n=1..n, a(i)) = ((n+1)*(-1)^n+7*n-1)/4, i.e. A016777 and A008586 (>0) alternately. (End)
a(n+2) = a(n) + (-1)^n. - Vincenzo Librandi, Sep 12 2011
E.g.f.: ((4 - x)*cosh(x) + (3 + x)*sinh(x))/2. - Stefano Spezia, Sep 22 2024

Extensions

Definition corrected by Omar E. Pol, Sep 11 2011
a(0)=2 prepended by Ruud H.G. van Tol, Sep 21 2024

A274922 a(n) = (-1)^n * n if n>0, a(0) = 1.

Original entry on oeis.org

1, -1, 2, -3, 4, -5, 6, -7, 8, -9, 10, -11, 12, -13, 14, -15, 16, -17, 18, -19, 20, -21, 22, -23, 24, -25, 26, -27, 28, -29, 30, -31, 32, -33, 34, -35, 36, -37, 38, -39, 40, -41, 42, -43, 44, -45, 46, -47, 48, -49, 50, -51, 52, -53, 54, -55, 56, -57, 58, -59
Offset: 0

Views

Author

Michael Somos, Dec 28 2016

Keywords

Comments

This is a divisibility sequence.

Examples

			G.f. = 1 - x + 2*x^2 - 3*x^3 + 4*x^4 - 5*x^5 + 6*x^6 - 7*x^7 + 8*x^8 + ...
		

Crossrefs

Programs

  • Magma
    m:=50; R:=PowerSeriesRing(Integers(), m); Coefficients(R!((1 + x+x^2)/(1+2*x+x^2))); // G. C. Greubel, Jul 29 2018
  • Mathematica
    a[ n_] := If[ n < 1, Boole[n == 0], (-1)^n n];
    a[ n_] := SeriesCoefficient[ (1 + x + x^2) / (1 + 2*x + x^2), {x, 0, n}];
    LinearRecurrence[{-2,-1},{1,-1,2},60] (* Harvey P. Dale, Mar 30 2019 *)
  • PARI
    {a(n) = if( n<1, n==0, (-1)^n * n)};
    
  • PARI
    {a(n) = if( n<0, 0, polcoeff( (1 + x + x^2) / (1 + 2*x + x^2) + x * O(x^n), n))};
    

Formula

Euler transform of length 3 sequence [-1, 2, -1].
a(n) = -b(n) where b() is multiplicative with b(2^e) = -(2^e) if e>0, b(p^e) = p^e otherwise.
E.g.f.: 1 - x * exp(-x).
G.f.: (1 + x + x^2) / (1 + 2*x + x^2).
G.f.: (1 - x) * (1 - x^3) / (1 - x^2)^2.
G.f.: 1 / (1 + x / (1 + x / (1 - x / (1 + x)))).
G.f.: 1 - x / (1 + x)^2 = 1 - x /(1 - x)^2 + 4*x^2 / (1 - x^2)^2.
a(n) = (-1)^n * A028310(n). a(2*n) = A004277(n). a(2*n + 1) = - A005408(n).
Convolution inverse of A106510.
A060576(n) = Sum_{k=0..n} binomial(n, k) * a(k).
A028310(n) = Sum_{k=0..n} binomial(n+1, k+1) * a(k).
a(n) = A038608(n), n>0. - R. J. Mathar, May 25 2020

A374894 Obverse convolution (n)**(n*(-1)^n); see Comments.

Original entry on oeis.org

0, -1, 0, -27, -256, 1875, 0, 252105, 4718592, -55801305, 0, -18415376595, -515978035200, 8479520844795, 0, 5195043369140625, 193953851139686400, -4086470036057634225, 0, -4014187339733760264075, -187280916480000000000000, 4816074142389727429287075, 0
Offset: 0

Views

Author

Clark Kimberling, Sep 14 2024

Keywords

Comments

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

Crossrefs

Programs

  • Mathematica
    s[n_] := n; t[n_] := (-1)^n n;
    u[n_] := Product[s[k] + t[n - k], {k, 0, n}]
    Table[u[n], {n, 0, 26}]

A227832 Sum of odd numbers starting with 1, alternating signs (beginning with plus).

Original entry on oeis.org

1, 4, -1, 6, -3, 8, -5, 10, -7, 12, -9, 14, -11, 16, -13, 18, -15, 20, -17, 22, -19, 24, -21, 26, -23, 28, -25, 30, -27, 32, -29, 34, -31, 36, -33, 38, -35, 40, -37, 42, -39, 44, -41, 46, -43, 48, -45, 50, -47, 52, -49
Offset: 1

Views

Author

D.Wilde, Aug 02 2013

Keywords

Comments

1st,3rd,5th (odd terms) increase by 2, 2nd,4th,6th,8th (even terms) decrease by 2 each time.

Examples

			(1+3)=4 (4-5)=-1 (-1+7)=6 (6-9)=-3 (-3+11)=8 (8-13)=-5 (-5+15)=10.
		

Crossrefs

Cf. A065164 (absolute values).

Programs

Formula

a(n) = -a(n-1) + a(n-2) + a(n-3). - Charles R Greathouse IV, Aug 02 2013
G.f.: x*(2*x^2 + 5*x + 1)/((1-x)*(1+x)^2). a(n) = n*(-1)^n + 2 = A038608(n) + 2. - Ralf Stephan, Aug 07 2013
Previous Showing 11-20 of 20 results.