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.

A326501 a(n) = Sum_{k=0..n} (-k)^k.

Original entry on oeis.org

1, 0, 4, -23, 233, -2892, 43764, -779779, 15997437, -371423052, 9628576948, -275683093663, 8640417354593, -294234689237660, 10817772136320356, -427076118244539019, 18019667955465012597, -809220593930871751580, 38537187481365665823844
Offset: 0

Views

Author

Seiichi Manyama, Sep 12 2019

Keywords

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<0, 0, (-n)^n+a(n-1)) end:
    seq(a(n), n=0..23);  # Alois P. Heinz, Sep 12 2019
  • Mathematica
    RecurrenceTable[{a[0] == 1, a[n] == a[n-1] + (-n)^n}, a, {n, 0, 23}] (* Jean-François Alcover, Nov 27 2020 *)
  • PARI
    {a(n) = sum(k=0, n, (-k)^k)}
    
  • Python
    from itertools import accumulate, count, islice
    def A326501_gen(): # generator of terms
        yield from accumulate((-k)**k for k in count(0))
    A326501_list = list(islice(A326501_gen(),10)) # Chai Wah Wu, Jun 18 2022

Formula

a(n) = 1 + (-1)^n * A001099(n).