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.

A039823 a(n) = ceiling( (n^2 + n + 2)/4 ).

Original entry on oeis.org

1, 2, 4, 6, 8, 11, 15, 19, 23, 28, 34, 40, 46, 53, 61, 69, 77, 86, 96, 106, 116, 127, 139, 151, 163, 176, 190, 204, 218, 233, 249, 265, 281, 298, 316, 334, 352, 371, 391, 411, 431, 452, 474, 496, 518, 541, 565, 589, 613, 638, 664, 690, 716, 743, 771, 799, 827
Offset: 1

Views

Author

Keywords

Comments

Equals the number of different coefficient values in the expansion of Product_{i=1..n} (1 + q^1 + ... + q^i). Proof by Lawrence Sze: The Gaussian polynomial Prod_{k=1..n} Sum_{j=0..k} q^j is the q-version of n! and strictly unimodal with constant term 1. It has degree Sum_{k=1..n} k = n(n+1)/2, and thus n(n+1)/2+1 nonzero terms.
a(n) is equivalently the number of different absolute values obtained when summing the first n integers with all possible 2^n sign combinations. - Olivier Gérard, Mar 22 2010
Numbers in ascending order on the central axes (starting with 1) of Ulam's Spiral. - Bob Selcoe, Sep 25 2015

Examples

			Possible absolute values of sums of consecutive integers with any sign combination for n = 4 and n=5 are {0, 2, 4, 6, 8, 10} and {1, 3, 5, 7, 9, 11, 13, 15} respectively. - _Olivier Gérard_, Mar 22 2010
		

Crossrefs

Programs

  • Magma
    [Ceiling((n^2+n+2)/4) : n in [1..80]]; // Wesley Ivan Hurt, Sep 25 2015
    
  • Magma
    I:=[1,2,4,6,8]; [n le 5 select I[n] else 3*Self(n-1)-4*Self(n-2)+4*Self(n-3)-3*Self(n-4)+Self(n-5): n in [1..60]]; // Vincenzo Librandi, Sep 26 2015
  • Maple
    A039823:=n->ceil((n^2+n+2)/4): seq(A039823(n), n=1..100); # Wesley Ivan Hurt, Sep 25 2015
  • Mathematica
    Table[Floor[((n*(n+1)+2)/2+1)/2],{n,5!}] (* Vladimir Joseph Stephan Orlovsky, Apr 26 2010 *)
    LinearRecurrence[{3, -4, 4, -3, 1}, {1, 2, 4, 6, 8}, 70] (* Vincenzo Librandi, Sep 26 2015 *)
  • Maxima
    makelist((n*(n+1)+%i^(n*(n+1))+3)/4,n,1,57); /* Bruno Berselli, Jul 25 2012 */
    
  • PARI
    a(n) = ceil((n^2+n+2)/4);
    vector(80, n, a(n)) \\ Altug Alkan, Sep 25 2015
    

Formula

a(n) = floor(binomial(n+1, 2)/2) + 1 = A011848(n+1) + 1.
G.f.: x*(x^4-2*x^3+2*x^2-x+1)/((1+x^2)*(1-x)^3).
a(n) = (n*(n+1)+i^(n*(n+1))+3)/4, where i=sqrt(-1). - Bruno Berselli, Jul 25 2012
a(n) = a(n-1) + A004524(n+1). - Bob Selcoe, Sep 25 2015
a(n) = 3*a(n-1)-4*a(n-2)+4*a(n-3)-3*a(n-4)+a(n-5) for n>5. - Wesley Ivan Hurt, Sep 25 2015
a(n) = ceiling( (n^2+n+1)/4 ). - Bob Selcoe, Sep 26 2015

Extensions

Edited by Ralf Stephan, Nov 15 2004