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.

A045621 a(n) = 2^n - binomial(n, floor(n/2)).

Original entry on oeis.org

0, 1, 2, 5, 10, 22, 44, 93, 186, 386, 772, 1586, 3172, 6476, 12952, 26333, 52666, 106762, 213524, 431910, 863820, 1744436, 3488872, 7036530, 14073060, 28354132, 56708264, 114159428, 228318856, 459312152, 918624304, 1846943453, 3693886906
Offset: 0

Views

Author

David M Bloom, Brooklyn College

Keywords

Comments

p(n) = a(n)/2^n is the probability that a majority of heads had occurred at some point after n flips of a fair coin. For example, after 3 flips of a coin, the probability is 5/8 that a majority of heads had occurred at some point. (First flip is heads, p=1/2, or sequence THH, p=1/8.) - Brian Galebach, May 14 2001
Hankel transform is (-1)^n*n. - Paul Barry, Jan 11 2007
Hankel transform of a(n+1) is A127630. - Paul Barry, Sep 01 2009
a(n) is the number of n-step walks on the number line that are positive at some point along the walk. - Benjamin Phillabaum, Mar 06 2011

Crossrefs

Programs

  • GAP
    List([0..35], n-> 2^n - Binomial(n, Int(n/2)) ); # G. C. Greubel, Jan 13 2020
  • Magma
    [2^n - Binomial(n, Floor(n/2)): n in [0..35]]; // Bruno Berselli, Mar 08 2011
    
  • Maple
    seq( 2^n -binomial(n,floor(n/2)), n=0..35); # G. C. Greubel, Jan 13 2020
  • Mathematica
    Table[2^n - Binomial[n, Floor[n/2]], {n, 0, 35}] (* Roger L. Bagula, Aug 26 2006 *)
  • PARI
    {a(n)=if(n<0, 0, 2^n -binomial(n, n\2))} /* Michael Somos, Oct 31 2006 */
    
  • Sage
    [2^n -binomial(n,floor(n/2)) for n in (0..35)] # G. C. Greubel, Jan 13 2020
    

Formula

a(n) = 2^n - A001405(n).
a(2*k) = 2*a(2*k-1), a(2*k+1) = 2*a(2*k) + Catalan(k).
a(n+1) = b(0)*b(n)+b(1)*b(n-1)+...+b(n)*b(0), b(k)=C(k, [ k/2 ]).
G.f.: c(x^2)*x/(1-2*x) where c(x) = g.f. for Catalan numbers A000108.
a(n) = A054336(n, 1) (second column of triangle).
E.g.f.: exp(2*x) - I_0(2*x) - I_1(2*x) where I_n(x) is n-th modified Bessel function as a function of x. - Benjamin Phillabaum, Mar 06 2011
a(2*n+1) = A000346(n); a(2*n) = A068551(n). - Emeric Deutsch, Nov 16 2003
a(n) = Sum_{k=0..n-1} binomial(n, floor(k/2)). - Paul Barry, Aug 05 2004
a(n+1) = 2*a(n) + Catalan(n/2)*(1+(-1)^n)/2. - Paul Barry, Aug 05 2004
a(n+1) = Sum_{k=0..floor(n/2)} 2^(n-2*k)*A000108(k). - Paul Barry, Sep 01 2009
(n+1)*a(n) +2*(-n-1)*a(n-1) +4*(-n+2)*a(n-2) +8*(n-2)*a(n-3) = 0. - R. J. Mathar, Dec 02 2012

Extensions

Edited by N. J. A. Sloane, Oct 08 2006
Adjustments to formulas (correcting offsets) from Michael Somos, Oct 31 2006

A296064 a(1) = 0; thereafter a(n) is the smallest number (in absolute value) not yet in the sequence such that the arithmetic mean of the first n terms a(1), a(2), ..., a(n) is an integer. Preference is given to positive values of a(n).

Original entry on oeis.org

0, 2, 1, -3, 5, -5, 7, -7, 9, -9, 11, -11, 13, -13, 15, -15, 17, -17, 19, -19, 21, -21, 23, -23, 25, -25, 27, -27, 29, -29, 31, -31, 33, -33, 35, -35, 37, -37, 39, -39, 41, -41, 43, -43, 45, -45, 47, -47, 49, -49, 51, -51
Offset: 1

Views

Author

Enrique Navarrete, Dec 04 2017

Keywords

Crossrefs

Cf. A296065 (partial sums), A127630.
Essentially the same as A296063.

Programs

  • Maple
    0, 2, 1, -3, seq(seq(s*i,s=[1,-1]),i=5..100,2); # Robert Israel, Dec 26 2017
  • Mathematica
    Nest[Append[#, Block[{k = 1, s = 1}, While[Nand[FreeQ[#, s k], IntegerQ@ Mean[Append[#, s k]]], If[s == 1, s = -1, k++; s = 1]]; s k]] &, {0}, 51] (* Michael De Vlieger, Dec 12 2017 *)

Formula

From Robert Israel, Dec 26 2017: (Start)
a(n) = a(n-3)+a(n-2)-a(n-1) for n >= 7.
G.f.: (2+3*x-4*x^2-x^3+2*x^4)*x^2/((1-x)*(x+1)^2). (End)
a(n) = 1/2+(-1)^n*(1/2-n), n>=4. - R. J. Mathar, May 14 2024

A236377 Real part of Sum_{k=0..n} (k + i^k)^2, where i=sqrt(-1).

Original entry on oeis.org

1, 1, 2, 10, 35, 59, 84, 132, 213, 293, 374, 494, 663, 831, 1000, 1224, 1513, 1801, 2090, 2450, 2891, 3331, 3772, 4300, 4925, 5549, 6174, 6902, 7743, 8583, 9424, 10384, 11473, 12561, 13650, 14874, 16243, 17611, 18980, 20500, 22181, 23861, 25542, 27390
Offset: 0

Views

Author

Bruno Berselli, Jan 24 2014

Keywords

Comments

Corresponding imaginary parts: -i^(n*(n+1))*A052928(n+1).

Examples

			For n=6, sum_(k=0)^6 (k + i^k)^2 = 84 + 6*i, therefore a(6) = 84.
		

Crossrefs

Cf. A058373: real part of Sum_{k=0..n} (k + i)^2.

Programs

  • Magma
    m:=50; R:=PowerSeriesRing(Integers(), m); Coefficients(R!((1-2*x+3*x^2+4*x^3+11*x^4-10*x^5+9*x^6)/((1+x)*(1+x^2)^2*(1-x)^4)));
  • Mathematica
    LinearRecurrence[{3, -4, 4, -2, -2, 4, -4, 3, -1}, {1, 1, 2, 10, 35, 59, 84, 132, 213}, 50]

Formula

G.f.: (1 - 2*x + 3*x^2 + 4*x^3 + 11*x^4 - 10*x^5 + 9*x^6)/((1 + x)*(1 + x^2)^2*(1 - x)^4).
a(n) = 3*a(n-1) -4*a(n-2) +4*a(n-3) -2*a(n-4) -2*a(n-5) +4*a(n-6) -4*a(n-7) +3*a(n-8) -a(n-9).
a(n) = A000330(n) + A127630(n) - A000035(n).
Showing 1-3 of 3 results.