OFFSET
1,3
COMMENTS
For x =< -2 and for some k, a(3*k*(k - 1)/2 + x) = -(2*x + 4).
LINKS
John Tyler Rascoe, Table of n, a(n) for n = 1..10000
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
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Ctibor O. Zizka, Sep 06 2024
STATUS
approved