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

A076118 a(n) = Sum_{k=n/2..n} k * (-1)^(n-k) * C(k,n-k).

Original entry on oeis.org

0, 1, 1, -1, -3, -2, 2, 5, 3, -3, -7, -4, 4, 9, 5, -5, -11, -6, 6, 13, 7, -7, -15, -8, 8, 17, 9, -9, -19, -10, 10, 21, 11, -11, -23, -12, 12, 25, 13, -13, -27, -14, 14, 29, 15, -15, -31, -16, 16, 33, 17, -17, -35, -18, 18, 37, 19, -19, -39, -20, 20, 41, 21, -21, -43, -22, 22, 45, 23, -23, -47, -24, 24, 49, 25, -25, -51, -26, 26
Offset: 0

Views

Author

Henry Bottomley, Oct 31 2002

Keywords

Comments

Piecewise linear depending on residue modulo 6. Might be described as an inverse Catalan transform of the nonnegative integers.
Number of compositions of n consisting of at most two parts, all congruent to {0,2} mod 3 (offset 1). - Vladeta Jovovic, Mar 10 2005

Examples

			a(10) = -5*1 + 6*15 - 7*35 + 8*28 - 9*9 + 10*1 = -5 + 90 -245 + 224 - 81 + 10 = -7.
		

Crossrefs

Cf. A003881, A038608, A078028, A099254 (partial sums).
See A151842 for a version without signs.

Programs

  • Maple
    A076118:=n->add(k*(-1)^(n-k)*binomial(k,n-k), k=floor(n/2)..n); seq(A076118(n), n=0..50); # Wesley Ivan Hurt, May 08 2014
    f:= gfun:-rectoproc({a(n+4) = 2*a(n+3)-3*a(n+2)+2*a(n+1)-a(n), a(0)=0,a(1)=1,a(2)=1,a(3)=-1}, a(n), remember):
    map(f, [$0..100]); # Robert Israel, Aug 07 2015
  • Mathematica
    Table[Sum[k*(-1)^(n - k)*Binomial[k, n - k], {k, Floor[n/2], n}], {n,
    0, 50}] (* Wesley Ivan Hurt, May 08 2014 *)
  • PARI
    {a(n)=local(k=n%3); n=n\3; (-1)^n*((k>0)+n+(k==1)*n)} /* Michael Somos, Jul 14 2006 */
    
  • PARI
    {a(n)=if(n<0, n=-1-n); polcoeff(x*(1-x)/(1-x+x^2)^2+x*O(x^n),n)} /* Michael Somos, Jul 14 2006 */

Formula

a(3n) = -a(3n-1) = A038608(n).
a(n) = ( 2n*sin((n+1/2)*Pi/3) + sin(n*Pi/3)/sin(Pi/3) )/3.
a(3n) = n*(-1)^n; a(3n+1) = (2n+1)*(-1)^n; a(3n+2) = (n+1)*(-1)^n.
a(n) = Sum{k=0..floor(n/2)} binomial(n-k, k)(-1)^k*(n-k). - Paul Barry, Nov 12 2004
From Michael Somos, Jul 14 2006: (Start)
Euler transform of length 6 sequence [ 1, -2, -2, 0, 0, 2].
G.f.: x(1-x)/(1-x+x^2)^2 = x*(1-x^2)^2*(1-x^3)^2/((1-x)*(1-x^6)^2).
a(-1-n)=a(n). (End)
a(n+4) = 2*a(n+3)-3*a(n+2)+2*a(n+1)-a(n). - Robert Israel, Aug 07 2015
a(n) = A099254(n-1)-A099254(n-2). - R. J. Mathar, Apr 01 2018
Sum_{n>=1} 1/a(n) = Pi/4 (A003881). - Amiram Eldar, May 10 2025

A082667 a(n) = floor(2n/3) * ceiling(2n/3) / 2.

Original entry on oeis.org

0, 1, 2, 3, 6, 8, 10, 15, 18, 21, 28, 32, 36, 45, 50, 55, 66, 72, 78, 91, 98, 105, 120, 128, 136, 153, 162, 171, 190, 200, 210, 231, 242, 253, 276, 288, 300, 325, 338, 351, 378, 392, 406, 435, 450, 465, 496, 512, 528, 561, 578, 595, 630, 648, 666, 703, 722, 741
Offset: 1

Views

Author

Reinhard Zumkeller, May 18 2003

Keywords

Comments

Prefixing with 0,0,0 gives the sequence c(n) defined as the number of (x,y,z) satisfying 2w = 3x-3y where w,x,y are all in {1,...,n}, for n>=0; see the Formula section.
For n >= 2, numbers k such that floor(sqrt(2k)+1/2) | 2k. - Wesley Ivan Hurt, Dec 01 2020

Crossrefs

Cf. A008130, A151842 (first differences).

Programs

  • Mathematica
    n2[n_]:=Module[{c=2*n/3},(Floor[c]Ceiling[c])/2]; Array[n2,60] (* Harvey P. Dale, Feb 03 2012 *)
    LinearRecurrence[{1,0,2,-2,0,-1,1},{0,1,2,3,6,8,10},60] (* Robert G. Wilson v, Jun 06 2014 *)
  • PARI
    a(n) = (2*n\3) * ceil(2*n/3) / 2; \\ Amiram Eldar, May 10 2025

Formula

a(n) = a(n-1) + 2a(n-3) - 2a(n-4) - a(n-6) + a(n-7), (with 0,0,0 prefixed as in the Comments section). - Clark Kimberling, Apr 15 2012
a(n) = floor((n + 1)/3)*(n - floor((n + 1)/3)). - Wesley Ivan Hurt, Jun 06 2014
G.f.: -x^2*(1+x)*(1+x^2) / ( (1+x+x^2)^2*(x-1)^3 ). - R. J. Mathar, Jun 07 2014
From Amiram Eldar, May 10 2025: (Start)
Sum_{n>=2} 1/a(n) = 2 + Pi^2/12.
Sum_{n>=2} (-1)^n/a(n) = Pi - Pi^2/24 - 2. (End)
E.g.f.: exp(-x/2)*(2*exp(3*x/2)*(3*x^2 + 3*x - 1) - (3*x - 2)*cos(sqrt(3)*x/2) + sqrt(3)*x*sin(sqrt(3)*x/2))/27. - Stefano Spezia, May 11 2025

A383549 Number of rises in all compositions of n with parts in {1,2,3} and adjacent differences in {-1,1}.

Original entry on oeis.org

0, 0, 0, 1, 1, 2, 5, 3, 9, 11, 10, 24, 21, 30, 50, 43, 75, 93, 96, 161, 170, 215, 312, 323, 456, 574, 639, 906, 1046, 1276, 1710, 1935, 2501, 3135, 3642, 4760, 5699, 6893, 8823, 10401, 12952, 16079, 19104, 24002, 29097, 35165, 43865, 52628, 64503, 79363, 95329
Offset: 0

Views

Author

John Tyler Rascoe, Apr 29 2025

Keywords

Comments

A rise is any pair of parts (p_{i-1},p_i) with p_{i-1} < p_i.
By reversal a(n) is also the number of descents in all compositions of n of this kind.

Examples

			For n = 6 the following compositions have 5 rises: (1,2,1,2), (1,2,3), (2,1,2,1), (3,2,1).
		

Crossrefs

Programs

  • PARI
    A_x(N) = {my(x='x+O('x^N)); concat([0,0,0], Vec(x^3*(1 + x^2)^2*(1 + x + x^3)/(1 - x^3 - x^5)^2))}
    A_x(40)

Formula

G.f.: x^3*(1 + x^2)^2*(1 + x + x^3)/(1 - x^3 - x^5)^2.
Showing 1-3 of 3 results.