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

 

Logo

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 60th year, we have over 367,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Other ways to Give
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A131179 a(n) = if n mod 2 == 0 then n*(n+1)/2, otherwise (n-1)*n/2 + 1. 3
0, 1, 3, 4, 10, 11, 21, 22, 36, 37, 55, 56, 78, 79, 105, 106, 136, 137, 171, 172, 210, 211, 253, 254, 300, 301, 351, 352, 406, 407, 465, 466, 528, 529, 595, 596, 666, 667, 741, 742, 820, 821, 903, 904, 990, 991, 1081, 1082, 1176, 1177, 1275, 1276, 1378, 1379, 1485, 1486 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
LINKS
FORMULA
G.f.: -x*(1+2*x-x^2+2*x^3) / ( (1+x)^2*(x-1)^3 ). - R. J. Mathar, Sep 05 2012
a(n) = ( n^2+1+(n-1)*(-1)^n )/2. - Luce ETIENNE, Aug 19 2014
MATHEMATICA
LinearRecurrence[{1, 2, -2, -1, 1}, {0, 1, 3, 4, 10}, 60] (* Jean-François Alcover, Feb 12 2016 *)
PROG
(Haskell)
a131179 n = (n + 1 - m) * n' + m where (n', m) = divMod n 2
-- Reinhard Zumkeller, Oct 12 2013
(Magma) [(n^2+1+(n-1)*(-1)^n )/2: n in [0..60]]; // Vincenzo Librandi, Feb 12 2016
(Python)
def A131179(n): return n*(n+1)//2 + (1-n)*(n % 2) # Chai Wah Wu, May 24 2022
CROSSREFS
Cf. A128918.
Sequence in context: A327300 A047341 A091910 * A079353 A242654 A243681
KEYWORD
nonn,easy
AUTHOR
Philippe LALLOUET, Sep 16 2007
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 December 8 10:53 EST 2023. Contains 367678 sequences. (Running on oeis4.)