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

A065423 Number of ordered length 2 compositions of n with at least one even summand.

Original entry on oeis.org

0, 0, 2, 1, 4, 2, 6, 3, 8, 4, 10, 5, 12, 6, 14, 7, 16, 8, 18, 9, 20, 10, 22, 11, 24, 12, 26, 13, 28, 14, 30, 15, 32, 16, 34, 17, 36, 18, 38, 19, 40, 20, 42, 21, 44, 22, 46, 23, 48, 24, 50, 25, 52, 26, 54, 27, 56, 28, 58, 29, 60, 30, 62, 31, 64, 32, 66, 33, 68, 34, 70, 35, 72, 36, 74
Offset: 1

Views

Author

Len Smiley, Nov 23 2001

Keywords

Examples

			a(7) = 6 because we can write 7 = 1+6 = 2+5 = 3+4 = 4+3 = 5+2 = 6+1; a(8) = 3 because we can write 8 = 2+6 = 4+4 = 6+2.
		

Crossrefs

Cf. A026741, A097140 (first differences), A030451 (absolute first differences), A210530.

Programs

  • C
    int a(int n){n--;return n>>(n&1);} // Mia Boudreau, Aug 27 2025
  • Maple
    A065423 := proc(n)
        (3*n-4-(-1)^n*n)/4 ;
    end proc:
    seq(A065423(n),n=1..40) ; # R. J. Mathar, Jan 24 2022
  • Mathematica
    LinearRecurrence[{0,2,0,-1},{0,0,2,1},100] (* Harvey P. Dale, May 14 2014 *)
  • PARI
    a(n)=n-=2;if(n%2,n+1,n/2)
    

Formula

G.f.: x^3*(x+2)/(1-x^2)^2.
a(n) = floor((n-1)/2) + (n is odd)*floor((n-1)/2).
a(n+2) = Sum_{k=0..n} (gcd(n, k) mod 2). - Paul Barry, May 02 2005
a(n) = Sum_{i=1..n-1} (-1)^i (floor(i/2) + ((i+1) mod 2)). - Olivier Gérard, Jun 21 2007
a(n) = A210530(n,4)/2 for n>2. - Boris Putievskiy, Jan 29 2013
a(n) = (3*n-4-n*(-1)^n)/4. - Boris Putievskiy, Jan 29 2013, corrected Jan 24 2022
a(n) = A026741(n)-1. - Wesley Ivan Hurt, Jun 23 2013
a(n) = floor((n-1) / 2^mod(n-1,2)). - Mia Boudreau, Aug 27 2025
E.g.f.: 1 + (x - 1)*cosh(x) + (x - 2)*sinh(x)/2. - Stefano Spezia, Dec 17 2023

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
Showing 1-2 of 2 results.