login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Sum of the next n nonnegative integers repeated (A004526).
2

%I #36 Sep 08 2022 08:46:23

%S 0,1,5,14,29,51,82,124,178,245,327,426,543,679,836,1016,1220,1449,

%T 1705,1990,2305,2651,3030,3444,3894,4381,4907,5474,6083,6735,7432,

%U 8176,8968,9809,10701,11646,12645,13699,14810,15980,17210,18501,19855,21274,22759,24311,25932

%N Sum of the next n nonnegative integers repeated (A004526).

%C After 29, all terms are composite.

%H Colin Barker, <a href="/A319007/b319007.txt">Table of n, a(n) for n = 1..1000</a>

%H <a href="/index/Rec#order_06">Index entries for linear recurrences with constant coefficients</a>, signature (4,-7,8,-7,4,-1).

%F G.f.: x^2*(1 + x + x^2)/((1 + x^2)*(1 - x)^4).

%F a(n) = -a(-n) = 4*a(n-1) - 7*a(n-2) + 8*a(n-3) - 7*a(n-4) + 4*a(n-5) - a(n-6).

%F a(n) = (2*n*(n^2 - 2) + (1 - (-1)^n)*(-1)^((n-1)/2))/8.

%F a(n) = A319006(n) - n.

%F a(n) = (n^3 - 2*n + Chi(n))/4 where Chi(n) = A101455(n). - _Peter Luschny_, Sep 09 2018

%e Next n nonnegative integers repeated: Sums:

%e 0, ...................................... 0

%e 0, 1, ................................... 1

%e 1, 2, 2, ................................ 5

%e 3, 3, 4, 4, ............................. 14

%e 5, 5, 6, 6, 7, .......................... 29

%e 7, 8, 8, 9, 9, 10, ...................... 51, etc.

%p a := n -> (n^3 - 2*n + (-(n mod 2))^binomial(n,2))/4;

%p seq(a(n), n=1..47); # _Peter Luschny_, Sep 09 2018

%t Table[(2 n (n^2 - 2) + (1 - (-1)^n) (-1)^((n-1)/2))/8, {n, 1, 50}]

%o (Magma) [Integers()! (n*(n^2-2)+(-(n mod 2))^(n*(n-1)/2))/4: n in [1..50]];

%o (PARI) concat(0, Vec(x^2*(1 + x + x^2)/((1 + x^2)*(1 - x)^4) + O(x^50))) \\ _Colin Barker_, Sep 10 2018

%Y Cf. A004526, A101455, A319006.

%Y Sum of the next n nonnegative integers: A027480.

%K nonn,easy

%O 1,3

%A _Bruno Berselli_, Sep 07 2018