cp's OEIS Frontend

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.

Showing 1-1 of 1 results.

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

Original entry on oeis.org

1, 2, 4, 5, 10, 8, 11, 20, 32, 17, 50, 68, 61, 130, 192, 163, 356, 520, 223, 744, 968, 222, 597, 276, 294, 101, 396, 498, 155, 654, 810, 250, 116, 185, 302, 488, 397, 886, 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
Offset: 1

Views

Author

Augusto Santi, Feb 22 2022

Keywords

Comments

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.
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.
Manuel Valdivia informs me that the possible periods 53 and 84 mentioned earlier are in fact impossible. - N. J. A. Sloane, Sep 08 2022
From Robert Gerbicz, Sep 18 2022: (Start)
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)).
If a(1) and a(2) are odd then it is easy to see that all numbers in the sequence are odd.
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.
This partitions the sequences into two groups.
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).
Here are three more cycle lengths:
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.
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.
For a(1)=542, a(2)=6017 the cycle has length 802 and the maximum term is 557981456058. (End)

Examples

			a(3) = gcd(1,2) + (1+2)/gcd(1,2) = 1 + 3/1 = 4.
a(4) = gcd(2,4) + (2+4)/gcd(2,4) = 2 + 6/2 = 5.
a(5) = gcd(4,5) + (4+5)/gcd(4,5) = 1 + 9/1 = 10.
a(6) = gcd(5,10) + (5+10)/gcd(5,10) = 5 + 15/5 = 8.
...
a(3179) = a(2901 + 278) = a(278) = 40.
		

Crossrefs

Cf. A349576, A349982, A355898, A355914 (the successive gcds).

Programs

  • Maple
    A351871 := proc(u,v,M) local n,r,s,g,t,a;
    a:=[u,v]; r:=u; s:=v;
    for n from 1 to M do g:=gcd(r,s); t:=g+(r+s)/g; a:=[op(a),t];
       r:=s; s:=t; od;
    a;
    end proc;
    A351871(1,2,100); # N. J. A. Sloane, Sep 01 2022
  • Mathematica
    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 *)
  • 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
  • Python
    from math import gcd
    a, terms = [1, 2], 65
    [a.append(gcd(a[-1], a[-2]) + (a[-1] + a[-2])//gcd(a[-1], a[-2])) for n in range(3, terms+1)]
    print(a) # Michael S. Branicky, Sep 01 2022
    

Formula

For n >= 278, a(2901 + n) = a(n).
Showing 1-1 of 1 results.