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.

Showing 1-1 of 1 results.

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

Original entry on oeis.org

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, 7, -8, -8, -8, -8, -8, -8, -8, -8, 9, 9, 9, 9, 9, 9, 9, 9, 9, -10, -10, -10, -10, -10, -10, -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
Offset: 0

Views

Author

N. J. A. Sloane, Jun 10 2016

Keywords

Crossrefs

Partial sums of A010816.

Programs

  • Maple
    s1:=[0];
    for n from 1 to 15 do
    for i from 1 to n do
    s1:=[op(s1),(-1)^(n+1)*n]; od: od:
    s1;
  • Mathematica
    Join[{0}, Flatten[Table[(-1)^(n+1)*n, {n, 15}, {n}]]] (* Paolo Xausa, Sep 30 2024 *)
    Join[{0},Flatten[Table[PadRight[{},n,(-1)^(n+1) n],{n,15}]]] (* Harvey P. Dale, Nov 28 2024 *)
  • Python
    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
    
  • Python
    from math import isqrt
    def A274094(n): return m if (m:=isqrt(n<<3)+1>>1)&1 else -m # Chai Wah Wu, Nov 05 2024
Showing 1-1 of 1 results.