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”).

a(1) = 1, for n >= 2, a(n) = -1 + floor((n*a(n - 1)) / (n + a(n - 1))).
2

%I #21 Nov 29 2024 05:12:25

%S 1,-1,-3,-13,7,2,0,-1,-3,-6,-15,59,9,4,2,0,-1,-3,-5,-8,-14,-40,53,15,

%T 8,5,3,1,-1,-3,-5,-7,-10,-16,-31,-225,43,19,11,7,4,2,0,-1,-3,-5,-7,

%U -10,-14,-21,-37,-130,88,32,19,13,9,6,4,2,0,-1,-3,-5,-7,-9,-12,-16,-22

%N a(1) = 1, for n >= 2, a(n) = -1 + floor((n*a(n - 1)) / (n + a(n - 1))).

%C For x =< -2 and for some k, a(3*k*(k - 1)/2 + x) = -(2*x + 4).

%H John Tyler Rascoe, <a href="/A376022/b376022.txt">Table of n, a(n) for n = 1..10000</a>

%F For x >= 0, k >= 2*x + 3 - floor((sqrt(9 + 8*x) - 1) / 2), a(3*k*(k-1)/2 + x) = -(2*x + 3).

%F For k >= 2, a(3*k*(k - 1)/2 - 1) = -1.

%e a(1) = 1.

%e a(2) = -1 + floor(2*a(1) / (2 + a(1))) = -1 + floor(2/3) = -1.

%e a(3) = -1 + floor(-3/2) = -3.

%e a(4) = -1 + floor(-12/1) = -13.

%e a(5) = -1 + floor(-65/-8) = 7.

%e and so on.

%t 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 *)

%o (Python)

%o from itertools import count, islice

%o def a_gen():

%o a = 1

%o for n in count(2):

%o yield a

%o b = -1+(n*a)//(n+a)

%o a = b

%o A376022_list = list(islice(a_gen(), 100)) # _John Tyler Rascoe_, Sep 17 2024

%o (PARI) lista(nn)= my(a=-2); vector(nn, n, a=-1+floor(n*a/(n+a))); \\ _Ruud H.G. van Tol_, Nov 28 2024

%Y Cf. A000217, A003056, A005408, A005448, A045943, A124011, A139482, A143208, A290768.

%K sign,easy

%O 1,3

%A _Ctibor O. Zizka_, Sep 06 2024