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!)
A171769 Partial sums of A042964 (numbers congruent to 2 or 3 mod 4). 3
2, 5, 11, 18, 28, 39, 53, 68, 86, 105, 127, 150, 176, 203, 233, 264, 298, 333, 371, 410, 452, 495, 541, 588, 638, 689, 743, 798, 856, 915, 977, 1040, 1106, 1173, 1243, 1314, 1388, 1463, 1541, 1620, 1702, 1785, 1871, 1958, 2048, 2139, 2233, 2328, 2426, 2525 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
If we insert an initial 0, and alternate the signs: 0,2,-5,11,-18,28,..., we get a sequence where the average of the first n terms is an integer, with no repeats: specifically A001057(n-1). The sum of the first n terms is (-1)^(n-1)*A093353(n-1). - Franklin T. Adams-Watters, May 20 2010
Suppose that n cards have the numbers 1..2n written on them randomly, one number to a side, and are set out on a table randomly. You have the task of maximizing the sum of the visible numbers by flipping cards. If you have no information other than the numbers on the upper faces, and may not flip any particular card more than once, a(n) is the largest sum you can guarantee in the worst case. - Andrew Woods, Jun 06 2013
LINKS
FORMULA
a(n) = Sum_{i=1..n} A042964(i).
a(n) = 2*a(n-1) - 2*a(n-3) + a(n-4). - R. H. Hardin, Nov 13 2011
a(n) = ceiling((2*n+1)*n/2). - Andrew Woods, Jun 06 2013
G.f.: x*(2+x+x^2) / ((1-x)^3*(x+1)). - Colin Barker, Jun 04 2014
a(n) = round(n/(1-exp(-1/n))). - Richard R. Forberg, Jan 28 2015
MATHEMATICA
a[n_]:=Ceiling[((2n+1)n/2)]; Array[a, 60] (* Vincenzo Librandi, Jul 02 2019 *)
LinearRecurrence[{2, 0, -2, 1}, {2, 5, 11, 18}, 60] (* G. C. Greubel, Jul 02 2019 *)
PROG
(PARI) Vec(x*(x^2+x+2)/((1-x)^3*(x+1)) + O(x^60)) \\ Colin Barker, Jun 04 2014
(Magma) [Ceiling((2*n+1)*n/2): n in [1..60]]; // Vincenzo Librandi, Jul 02 2019
(Sage) [ceiling(n*(1+2*n)/2) for n in (1..60)] # G. C. Greubel, Jul 02 2019
(GAP) a:=[2, 5, 11, 18];; for n in [5..60] do a[n]:=2*a[n-1]-2*a[n-3] + a[n-4]; od; a; # G. C. Greubel, Jul 02 2019
CROSSREFS
Sequence in context: A117877 A226215 A169745 * A025200 A264724 A298375
KEYWORD
nonn,easy
AUTHOR
Jaroslav Krizek, Dec 18 2009
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 April 18 21:51 EDT 2024. Contains 371781 sequences. (Running on oeis4.)