%I #22 Nov 05 2024 12:19:03
%S 0,1,-2,-2,3,3,3,-4,-4,-4,-4,5,5,5,5,5,-6,-6,-6,-6,-6,-6,7,7,7,7,7,7,
%T 7,-8,-8,-8,-8,-8,-8,-8,-8,9,9,9,9,9,9,9,9,9,-10,-10,-10,-10,-10,-10,
%U -10,-10,-10,-10,11,11,11,11,11,11,11,11,11,11,11,-12,-12,-12,-12,-12,-12,-12,-12,-12,-12
%N a(0)=0; thereafter (-1)^(n+1)*n appears n times.
%H Chai Wah Wu, <a href="/A274094/b274094.txt">Table of n, a(n) for n = 0..10011</a>
%p s1:=[0];
%p for n from 1 to 15 do
%p for i from 1 to n do
%p s1:=[op(s1),(-1)^(n+1)*n]; od: od:
%p s1;
%t Join[{0}, Flatten[Table[(-1)^(n+1)*n, {n, 15}, {n}]]] (* _Paolo Xausa_, Sep 30 2024 *)
%o (Python)
%o A274094_list = [0]+ [i for n in range(1,142) for i in [n if n % 2 else -n]*n] # _Chai Wah Wu_, Jun 11 2016
%o (Python)
%o from math import isqrt
%o def A274094(n): return m if (m:=isqrt(n<<3)+1>>1)&1 else -m # _Chai Wah Wu_, Nov 05 2024
%Y Cf. A002024, A274093.
%Y Partial sums of A010816.
%K sign
%O 0,3
%A _N. J. A. Sloane_, Jun 10 2016