login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A331213 a(n) = 1 + Sum_{i=1..n} (-1)^i * Product_{j=1..i} floor(n/j). 1
1, 0, 1, -2, 5, -4, 13, -27, 89, -80, 191, -450, 2365, -1182, 3221, -13034, 40433, -22320, 96373, -193761, 772981, -728930, 1599357, -3428425, 21411337, -13595724, 31407273, -110011850, 377746853, -198079308, 1096983421, -2241234465, 7565512161, -6472208192 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,4
COMMENTS
Compare to the exponential series: exp(-n) = 1 - n + n*(n/2) - n*(n/2)*(n/3) + n*(n/2)*(n/3)*(n/4) - ...
LINKS
EXAMPLE
a(4) = 1 - 4 + 4*floor(4/2) - 4*floor(4/2)*floor(4/3) + 4*floor(4/2)*floor(4/3)*floor(4/4) = 1 - 4 + 4*2 - 4*2*1 + 4*2*1*1 = 5.
MATHEMATICA
a[n_] := 1 + Sum[(-1)^i * Product[Floor[n/j], {j, 1, i}], {i, 1, n}]; Array[a, 34, 0] (* Amiram Eldar, Jan 13 2020 *)
PROG
(PARI) {a(n) = 1+sum(i=1, n, (-1)^i*prod(j=1, i, floor(n/j)))}
(Magma) [1] cat [1+&+[(-1)^i*(&*[Floor(n/j):j in [1..i]]):i in [1..n]]:n in [1..33]]; // Marius A. Burtea, Jan 13 2020
CROSSREFS
Cf. similar sequences: A075885 (b=1), A208060 (b=2).
Cf. A010786.
Sequence in context: A122212 A264071 A212188 * A298585 A102468 A252668
KEYWORD
sign
AUTHOR
Seiichi Manyama, Jan 12 2020
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 10 18:31 EDT 2024. Contains 372388 sequences. (Running on oeis4.)