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!)
A306562 a(n) = 1 + 2 - 3 - 4 + 5 + 6 + 7 - 8 - 9 - 10 - 11 + 12 + 13 + 14 + 15 + ... + (+-1)*n, where, after the 1st summand there is one plus, two minuses, three plusses, etc. 1
1, 3, 0, -4, 1, 7, 14, 6, -3, -13, -24, -12, 1, 15, 30, 46, 29, 11, -8, -28, -49, -71, -48, -24, 1, 27, 54, 82, 111, 81, 50, 18, -15, -49, -84, -120, -157, -119, -80, -40, 1, 43, 86, 130, 175, 221, 174, 126, 77, 27, -24, -76, -129, -183, -238, -294, -237, -179 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,2
LINKS
FORMULA
F(n) = ((-1)^(n+1)(2n+1)(2n^2+2n+5)+21)/16 gives local extrema 3, -4, 14, -24, 46, -71, 111, -157, ... (conjectured). - Jean-François Alcover, Jun 01 2019
For n > 0, a(n) = 1 + Sum_{k=1..n} (-1)^(A002024(k)+1)*(k+1). - Jinyuan Wang, Aug 06 2019
EXAMPLE
a(0) = 1 = 1
a(1) = 1 + 2 = 3
a(2) = 1 + 2 - 3 = 0
a(3) = 1 + 2 - 3 - 4 = -4
a(4) = 1 + 2 - 3 - 4 + 5 = 1
a(5) = 1 + 2 - 3 - 4 + 5 + 6 = 7
a(6) = 1 + 2 - 3 - 4 + 5 + 6 + 7 = 14
MAPLE
a:= proc(n) option remember: `if`(n=0, 1,
a(n-1)+(n+1)*(-1)^floor(sqrt(2*n)-1/2))
end:
seq(a(n), n=0..60); # Alois P. Heinz, Feb 26 2019
MATHEMATICA
With[{nn=20}, Accumulate[Flatten[Join[{1, 2}, Times@@@Partition[Riffle[TakeList[Range[3, 3+(nn(nn+1))/2], Range[2, nn]], {-1, 1}], 2]]]]] (* Harvey P. Dale, Mar 24 2024 *)
CROSSREFS
Sequence in context: A138376 A077140 A003815 * A351190 A131486 A127445
KEYWORD
sign
AUTHOR
EXTENSIONS
New name from Michel Marcus, Apr 11 2019
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 August 20 11:01 EDT 2024. Contains 375325 sequences. (Running on oeis4.)