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!)
A140756 Count up to k sequence with alternating signs (k always positive). 3

%I #18 Oct 22 2023 00:24:25

%S 1,-1,2,1,-2,3,-1,2,-3,4,1,-2,3,-4,5,-1,2,-3,4,-5,6,1,-2,3,-4,5,-6,7,

%T -1,2,-3,4,-5,6,-7,8,1,-2,3,-4,5,-6,7,-8,9,-1,2,-3,4,-5,6,-7,8,-9,10,

%U 1,-2,3,-4,5,-6,7,-8,9,-10,11,-1,2,-3,4,-5,6,-7,8,-9,10,-11,12,1,-2,3,-4,5,-6,7,-8,9,-10,11,-12,13

%N Count up to k sequence with alternating signs (k always positive).

%C Row sums are A004526(n+1).

%H G. C. Greubel, <a href="/A140756/b140756.txt">Table of n, a(n) for n = 1..5000</a>

%F Regarded as a triangle, T(n,k) = (-1)^{n-k} * k.

%F From _Boris Putievskiy_, Mar 14 2013: (Start)

%F a(n) = (-1)^(A004736(n) + 1) * A002260(n).

%F a(n) = (-1)^(j+1) * i, where i = n - t*(t+1)/2, j = (t^2 + 3*t + 4)/2 -n, and t = floor((-1 + sqrt(8*n-7))/2). (End)

%e Triangle begins:

%e 1;

%e -1, 2;

%e 1, -2, 3;

%e -1, 2, -3, 4;

%e 1, -2, 3, -4, 5;

%e -1, 2, -3, 4, -5, 6;

%t a[n_]:= With[{t=Floor[(-1+Sqrt[8*n-7])/2]}, (-1)^(Binomial[t+2,2] -n)*(n-Binomial[t+1,2])];

%t Table[a[n], {n,100}] (* _G. C. Greubel_, Oct 21 2023 *)

%o (Magma) [(-1)^(n+k)*k: k in [1..n], n in [1..12]]; // _G. C. Greubel_, Oct 21 2023

%o (SageMath) flatten([[(-1)^(n+k)*k for k in range(1,n+1)] for n in range(1,13)]) # _G. C. Greubel_, Oct 21 2023

%Y Cf. A002260, A004736, A140757.

%K easy,sign,tabl

%O 1,3

%A _Franklin T. Adams-Watters_, May 27 2008

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 23 22:36 EDT 2024. Contains 371917 sequences. (Running on oeis4.)