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 A351871 #74 Mar 26 2025 13:29:12 %S A351871 1,2,4,5,10,8,11,20,32,17,50,68,61,130,192,163,356,520,223,744,968, %T A351871 222,597,276,294,101,396,498,155,654,810,250,116,185,302,488,397,886, %U A351871 1284,1087,2372,3460,1462,2463,3926,6390,5160,415,1120,312,187,500,688,301,66,368,219,588,272,219,492,240,73,314,388 %N A351871 a(1) = 1, a(2) = 2; a(n) = gcd(a(n-1), a(n-2)) + (a(n-1) + a(n-2))/gcd(a(n-1), a(n-2)). %C A351871 After the first 277 terms, the sequence values repeat periodically with a period of 2901. The maximum value of a(n) is 2269429312765395470820, whose first occurrence appears at n = 2006. %C A351871 Changing the initial terms a(1) and a(2) generates other periodic sequences. The periods found empirically are 3, 9, 155, 2901. It is not known whether the number of possible periods is finite. %C A351871 _Manuel Valdivia_ informs me that the possible periods 53 and 84 mentioned earlier are in fact impossible. - _N. J. A. Sloane_, Sep 08 2022 %C A351871 From _Robert Gerbicz_, Sep 18 2022: (Start) %C A351871 Let a(1), a(2) be the first two (positive) integers, and for n>2 define a(n)=g+(a(n-1)+(a-2))/g, where g=gcd(a(n-1),a(n-2)). %C A351871 If a(1) and a(2) are odd then it is easy to see that all numbers in the sequence are odd. %C A351871 If a(1) or a(2) is even, then by induction out of every two consecutive numbers in the sequence at least one of them is even. %C A351871 This partitions the sequences into two groups. %C A351871 Conjecture: In the first group the sequence always goes to infinity (as in A355898), and in the second group it always goes to a cycle (as in the present sequence). %C A351871 Here are three more cycle lengths: %C A351871 For a(1)=52, a(2)=378 the sequence starts with: 52, 378, 217, 92, 310, 203, 514, 718, 618, 670, 646, 660, 655, 268, 924, 302, 615, 918, 514, 718, ... and has a cycle length of 12, starting at 514. %C A351871 For a(1)=264, a(2)=1037 the sequence starts with: 264, 1037, 1302, 2340, 613, 2954, 3568, 3263, 6832, 10096, 1074, 5587, 6662, 12250, 9458, 10856, 10159, 21016, 31176, 6532, 9431, 15964, 25396, 10344, 8939, 19284, 28224, 3971, 32196, 36168, 5709, 1302, 2340, ... and has a cycle length of 29, starting at 1302. %C A351871 For a(1)=542, a(2)=6017 the cycle has length 802 and the maximum term is 557981456058. (End) %H A351871 Augusto Santi, <a href="/A351871/b351871.txt">Table of n, a(n) for n = 1..10000</a> %H A351871 Michael De Vlieger, <a href="/A351871/a351871.png">Log-log scatterplot of a(n)</a>, n = 1..2^15, with red showing records, demonstrating periodicity. %H A351871 Augusto Santi, <a href="https://math.stackexchange.com/questions/4387881/a-singular-variant-of-the-oeis-sequence-a349576">A singular variant of the OEIS sequence A349576</a>, Mathematics Stack Exchange, 2022. %H A351871 <a href="/index/Rec#order_2901">Index entries for linear recurrences with constant coefficients</a>, order 2901. %F A351871 For n >= 278, a(2901 + n) = a(n). %e A351871 a(3) = gcd(1,2) + (1+2)/gcd(1,2) = 1 + 3/1 = 4. %e A351871 a(4) = gcd(2,4) + (2+4)/gcd(2,4) = 2 + 6/2 = 5. %e A351871 a(5) = gcd(4,5) + (4+5)/gcd(4,5) = 1 + 9/1 = 10. %e A351871 a(6) = gcd(5,10) + (5+10)/gcd(5,10) = 5 + 15/5 = 8. %e A351871 ... %e A351871 a(3179) = a(2901 + 278) = a(278) = 40. %p A351871 A351871 := proc(u,v,M) local n,r,s,g,t,a; %p A351871 a:=[u,v]; r:=u; s:=v; %p A351871 for n from 1 to M do g:=gcd(r,s); t:=g+(r+s)/g; a:=[op(a),t]; %p A351871 r:=s; s:=t; od; %p A351871 a; %p A351871 end proc; %p A351871 A351871(1,2,100); # _N. J. A. Sloane_, Sep 01 2022 %t A351871 a[1] = 1; a[2] = 2; a[n_] := a[n] = GCD[a[n - 1], a[n - 2]] + (a[n - 1] + a[n - 2])/GCD[a[n - 1], a[n - 2]]; Array[a, 50] (* _Amiram Eldar_, Feb 24 2022 *) %o A351871 (Python) %o A351871 from math import gcd %o A351871 a, terms = [1, 2], 65 %o A351871 [a.append(gcd(a[-1], a[-2]) + (a[-1] + a[-2])//gcd(a[-1], a[-2])) for n in range(3, terms+1)] %o A351871 print(a) # _Michael S. Branicky_, Sep 01 2022 %o A351871 (PARI) {a351871(N=65,A1=1,A2=2)= my(a=vector(N)); a[1]=A1; a[2]=A2; for(n=1,N,if(n>2,my(g=gcd(a[n-1],a[n-2])); a[n]=g+(a[n-1]+a[n-2])/g); print1(a[n],",")) } \\ _Ruud H.G. van Tol_, Sep 19 2022 %Y A351871 Cf. A349576, A349982, A355898, A355914 (the successive gcds). %K A351871 nonn,easy %O A351871 1,2 %A A351871 _Augusto Santi_, Feb 22 2022