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.

A309103 a(n) = Sum_{k >= 0} (-1)^k * floor(n^k / k!).

Original entry on oeis.org

1, 0, 0, 0, 0, -1, -1, -2, -1, -3, 0, 1, 0, -2, -1, -2, 2, 1, 1, 2, -2, 2, 0, -2, -3, 0, -1, -2, 0, -2, 3, -8, 1, -4, -3, -4, 1, -2, 1, -3, -2, -2, 2, 2, 3, 3, 2, 0, -5, -2, -3, -5, -2, -4, 3, 4, -2, -2, 4, -7, 3, 5, 3, 5, 0, -1, 1, -8, 6, -3, -1, 8, -5, 0, -6
Offset: 0

Views

Author

Rémy Sigrist, Jul 12 2019

Keywords

Comments

This sequence mimics the Maclaurin series for the function x -> exp(-x).
The series in the name is well defined; for any n > 0, only the first A065027(n) terms are different from zero.

Examples

			For n = 3:
- we have:
  k  floor(3^k / k!)
  -  ---------------
  0                1
  1                3
  2                4
  3                4
  4                3
  5                2
  6                1
  >=7              0
- hence a(3) = 1 - 3 + 4 - 4 + 3 - 2 + 1 = 0.
		

Crossrefs

See A309087 for similar sequences.
Cf. A065027.

Programs

  • PARI
    a(n) = { my (v=0, d=1, s=+1); for (k=1, oo, if (d<1, return (v), v += s*floor(d); d *= n/k; s = -s)) }