login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A376022
a(1) = 1, for n >= 2, a(n) = -1 + floor((n*a(n - 1)) / (n + a(n - 1))).
2
1, -1, -3, -13, 7, 2, 0, -1, -3, -6, -15, 59, 9, 4, 2, 0, -1, -3, -5, -8, -14, -40, 53, 15, 8, 5, 3, 1, -1, -3, -5, -7, -10, -16, -31, -225, 43, 19, 11, 7, 4, 2, 0, -1, -3, -5, -7, -10, -14, -21, -37, -130, 88, 32, 19, 13, 9, 6, 4, 2, 0, -1, -3, -5, -7, -9, -12, -16, -22
OFFSET
1,3
COMMENTS
For x =< -2 and for some k, a(3*k*(k - 1)/2 + x) = -(2*x + 4).
LINKS
FORMULA
For x >= 0, k >= 2*x + 3 - floor((sqrt(9 + 8*x) - 1) / 2), a(3*k*(k-1)/2 + x) = -(2*x + 3).
For k >= 2, a(3*k*(k - 1)/2 - 1) = -1.
EXAMPLE
a(1) = 1.
a(2) = -1 + floor(2*a(1) / (2 + a(1))) = -1 + floor(2/3) = -1.
a(3) = -1 + floor(-3/2) = -3.
a(4) = -1 + floor(-12/1) = -13.
a(5) = -1 + floor(-65/-8) = 7.
and so on.
MATHEMATICA
a[1] = 1; a[n_] := a[n] = -1 + Floor[n*a[n-1]/(n + a[n-1])]; Array[a, 100] (* Amiram Eldar, Sep 06 2024 *)
PROG
(Python)
from itertools import count, islice
def a_gen():
a = 1
for n in count(2):
yield a
b = -1+(n*a)//(n+a)
a = b
A376022_list = list(islice(a_gen(), 100)) # John Tyler Rascoe, Sep 17 2024
(PARI) lista(nn)= my(a=-2); vector(nn, n, a=-1+floor(n*a/(n+a))); \\ Ruud H.G. van Tol, Nov 28 2024
KEYWORD
sign,easy
AUTHOR
Ctibor O. Zizka, Sep 06 2024
STATUS
approved