cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A319006 Sum of the next n positive integers repeated (A008619).

This page as a plain text file.
%I A319006 #35 Sep 08 2022 08:46:23
%S A319006 1,3,8,18,34,57,89,132,187,255,338,438,556,693,851,1032,1237,1467,
%T A319006 1724,2010,2326,2673,3053,3468,3919,4407,4934,5502,6112,6765,7463,
%U A319006 8208,9001,9843,10736,11682,12682,13737,14849,16020,17251,18543,19898,21318,22804,24357,25979
%N A319006 Sum of the next n positive integers repeated (A008619).
%H A319006 Colin Barker, <a href="/A319006/b319006.txt">Table of n, a(n) for n = 1..1000</a>
%H A319006 <a href="/index/Rec#order_06">Index entries for linear recurrences with constant coefficients</a>, signature (4,-7,8,-7,4,-1).
%F A319006 G.f.: x*(1 - x + 3*x^2 - x^3 + x^4)/((1 + x^2)*(1 - x)^4).
%F A319006 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 A319006 a(n) = (2*n*(n^2 + 2) + (1 - (-1)^n)*(-1)^((n-1)/2))/8.
%F A319006 a(n) = A319007(n) + n.
%F A319006 a(n) = (n^3 + 2*n + Chi(n))/4 where Chi(n) = A101455(n). - _Peter Luschny_, Sep 09 2018
%e A319006 Next n positive integers repeated:       Sums:
%e A319006 1,  ......................................   1
%e A319006 1, 2,  ...................................   3
%e A319006 2, 3, 3,  ................................   8
%e A319006 4, 4, 5,  5,  ............................  18
%e A319006 6, 6, 7,  7,  8,  ........................  34
%e A319006 8, 9, 9, 10, 10, 11,  ....................  57, etc.
%p A319006 a := n -> (n^3 + 2*n + (-(n mod 2))^binomial(n, 2))/4:
%p A319006 seq(a(n), n=1..47); # _Peter Luschny_, Sep 09 2018
%t A319006 Table[(2 n (n^2 + 2) + (1 - (-1)^n) (-1)^((n-1)/2))/8, {n, 1, 50}]
%t A319006 Module[{nn=50,lst},lst=Flatten[Table[{n,n},{n,(nn(nn+1))/2}]];Total/@ TakeList[lst,Range[nn]]] (* Requires Mathematica version 11 or later *) (* or *) LinearRecurrence[{4,-7,8,-7,4,-1},{1,3,8,18,34,57},50] (* _Harvey P. Dale_, Jul 10 2021 *)
%o A319006 (Magma) [Integers()! (n*(n^2+2)+(-(n mod 2))^(n*(n-1)/2))/4: n in [1..50]];
%o A319006 (PARI) Vec(x*(1 - x + 3*x^2 - x^3 + x^4)/((1 + x^2)*(1 - x)^4) + O(x^50)) \\ _Colin Barker_, Sep 10 2018
%Y A319006 Cf. A008619, A101455, A319007.
%Y A319006 Sum of the next n positive integers: A006003 (after 0).
%K A319006 nonn,easy
%O A319006 1,2
%A A319006 _Bruno Berselli_, Sep 07 2018