login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A178946 a(n) = n*(n+1)*(2*n+1)/6 - n*floor(n/2). 1
1, 3, 11, 22, 45, 73, 119, 172, 249, 335, 451, 578, 741, 917, 1135, 1368, 1649, 1947, 2299, 2670, 3101, 3553, 4071, 4612, 5225, 5863, 6579, 7322, 8149, 9005, 9951, 10928, 12001, 13107, 14315, 15558, 16909, 18297, 19799, 21340, 23001 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
Previous name was: A modified variant of A005900.
Let S(x) = (1, 3, 5, 7,...); then A178946 = (1/2) * ((S(x)^2 + S(x^2)).
If n is even, a(n) is the sum of the first n squares minus n^2/2. If n is odd, a(n) is the sum of the first n squares minus n(n-1)/2. - Wesley Ivan Hurt, Sep 17 2013
LINKS
FORMULA
a(2n) = A005900(2n)/2. a(2n+1) = (A005900(2n+1)+2n+1)/2.
a(n) = +2*a(n-1) +a(n-2) -4*a(n-3) +a(n-4) +2*a(n-5) -a(n-6). G.f.: x*(1+x+4*x^2+x^4+x^3) / ( (1+x)^2*(x-1)^4 ). - R. J. Mathar, Jan 03 2011
a(n) = A000330(n+1) - A093353(n), n>0. - Wesley Ivan Hurt, Sep 17 2013
EXAMPLE
(1/2) *((1, 6, 19, 44, 85, 146, 231,...) + (1, 0, 3, 0, 5, 0, 7, 0, 9,...)) =
(1, 3, 11, 22, 45, 73, 119,...).
MAPLE
A005900 := proc(n) n*(2*n^2+1)/3 ; end proc:
A178946 := proc(n) if type(n, 'even') then A005900(n)/2 ; else (A005900(n)+n)/2 ; end if; end proc:
seq(A178946(n), n=1..60) ; # R. J. Mathar, Jan 03 2011
seq(k*(k+1)*(2*k+1)/6 - k*floor(k/2), k=1..100); # Wesley Ivan Hurt, Sep 17 2013
MATHEMATICA
Table[n(n+1)(2n+1)/6-n*Floor[n/2], {n, 100}] (* Wesley Ivan Hurt, Sep 17 2013 *)
LinearRecurrence[{2, 1, -4, 1, 2, -1}, {1, 3, 11, 22, 45, 73}, 50] (* Harvey P. Dale, Mar 20 2018 *)
PROG
(Magma) [n*(n+1)*(2*n+1)/6 - n*Floor(n/2): n in [1..50]]; // Vincenzo Librandi, Sep 17 2013
CROSSREFS
Sequence in context: A139593 A121471 A293766 * A087078 A177789 A289526
KEYWORD
nonn
AUTHOR
Gary W. Adamson, Dec 30 2010
EXTENSIONS
Better name using formula from Wesley Ivan Hurt, Joerg Arndt, Sep 17 2013
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 9 04:02 EDT 2024. Contains 372341 sequences. (Running on oeis4.)