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.

A274093 a(0)=0; thereafter (-1)^n*n appears n times.

This page as a plain text file.
%I A274093 #19 Dec 06 2024 18:16:48
%S A274093 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,
%T A274093 -7,-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 A274093 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,12
%N A274093 a(0)=0; thereafter (-1)^n*n appears n times.
%H A274093 Chai Wah Wu, <a href="/A274093/b274093.txt">Table of n, a(n) for n = 0..10011</a>
%p A274093 s1:=[0];
%p A274093 for n from 1 to 15 do
%p A274093    for i from 1 to n do
%p A274093      s1:=[op(s1),(-1)^n*n]; od: od:
%p A274093 s1;
%t A274093 Join[{0}, Flatten[Table[(-1)^n*n, {n, 15}, {n}]]] (* _Paolo Xausa_, Sep 30 2024 *)
%t A274093 Join[{0},Table[PadRight[{},n,If[EvenQ[n],n,-n]],{n,15}]]//Flatten (* _Harvey P. Dale_, Dec 06 2024 *)
%o A274093 (Python)
%o A274093 A274093_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 A274093 (Python)
%o A274093 from math import isqrt
%o A274093 def A274093(n): return -m if (m:=isqrt(n<<3)+1>>1)&1 else m # _Chai Wah Wu_, Nov 05 2024
%Y A274093 Cf. A002024, A274094.
%K A274093 sign
%O A274093 0,3
%A A274093 _N. J. A. Sloane_, Jun 10 2016