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.
%I A381331 #18 Feb 25 2025 11:28:26 %S A381331 1,1,2,5,8,7,5,5,8,13,15,12,9,21,31,27,14,9,11,31,54,35,16,11,16,35, %T A381331 55,41,21,15,21,57,85,48,19,15,28,70,93,52,24,22,38,74,84,51,30,28,44, %U A381331 79,88,56,33,34,55,89,144,91,39,25,38,96,155,102,42,28,44,105,160,104 %N A381331 a(1) = a(2) = 1; for n > 2, a(n) = floor((n - 2)*a(n - 1)/a(n - 2)) + GCD(n - 2, a(n - 2)). %C A381331 At n = 499 the sequence settles down and becomes quasi-periodic with a 6-loop. Empiricaly 3 >= a(n + 1)/a(n) >= 1/3. The system is sensitive to the choice of initial terms [a(1),a(2)]. Only some values of initial terms results in a 6-loop like this sequence, the vast majority of initial terms show a "noisy quasiperiodic" like structures in the plot. Trials made for [a(1), a(2)] from [1, 1] to [100, 100] and for n up to 70000. May it be the sequence converges to a 6-loop for some large enough n, independent on the choice of initial terms ? %H A381331 Ray Chandler, <a href="/A381331/b381331.txt">Table of n, a(n) for n = 1..1000</a> %H A381331 <a href="/index/Rec#order_17">Index entries for linear recurrences with constant coefficients</a>, signature (1,-1,1,-1,1,0,0,0,0,0,0,1,-1,1,-1,1,-1). %F A381331 For n >= 499: %F A381331 if n mod 6 = 0, a(n) = 2*n - 1 + 2*((n/2) mod 2). %F A381331 if n mod 6 = 1, a(n) = n + 2. %F A381331 if n mod 6 = 2, a(n) = (n + 2)/2. %F A381331 if n mod 6 = 3, a(n) = (n - 1)/2. %F A381331 if n mod 6 = 4, a(n) = n - 2 - (n/2) mod 2. %F A381331 if n mod 6 = 5, a(n) = 2*n - 6 + 3*((n + 1)/2 mod 2). %e A381331 a(1) = 1 %e A381331 a(2) = 1 %e A381331 a(3) = floor(1*1/1) + GCD(1,1) = 2 %e A381331 a(4) = floor(2*2/1) + GCD(2,1) = 5 %e A381331 a(5) = floor(3*5/2) + GCD(3,2) = 8 %e A381331 and so on. %t A381331 a[n_] := a[n] = If[n < 3, 1, Floor[(n-2)*a[n-1]/a[n-2]] + GCD[n-2, a[n-2]]]; Array[a, 70] (* _Amiram Eldar_, Feb 20 2025 *) %Y A381331 Cf. A133058, A145102. %K A381331 nonn,easy %O A381331 1,3 %A A381331 _Ctibor O. Zizka_, Feb 20 2025