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-5 of 5 results.

A355899 The successive gcd's arising in A355898.

Original entry on oeis.org

1, 1, 1, 1, 3, 1, 1, 3, 1, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 1, 5, 1, 1, 1, 1, 1, 11, 1, 3, 3, 3, 3, 3, 3, 1, 1, 3, 3, 1, 1, 1, 1, 1, 7, 17, 3, 1, 1, 3, 3, 3, 5, 1, 3, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 3, 3, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 71, 71, 5, 1, 1, 5, 1, 3, 1, 13, 3, 1, 5, 15, 1, 1, 5
Offset: 1

Views

Author

N. J. A. Sloane, Sep 03 2022

Keywords

Comments

A proof that this does not grow too rapidly would prove that A355898 diverges.

Crossrefs

Programs

  • Mathematica
    GCD @@@ Partition[Nest[Append[#1, #3 + Total[#2]/#3] & @@ {#1, #2, GCD @@ #2} & @@ {#, #[[-2 ;; -1]], GCD[#[[-2 ;; -1]]]} &, {1, 1}, 100], 2, 1] (* Michael De Vlieger, Sep 03 2022 *)

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

A355900 Indices of records in A355899.

Original entry on oeis.org

1, 5, 10, 33, 51, 84, 107, 849
Offset: 1

Views

Author

N. J. A. Sloane, Sep 03 2022

Keywords

Crossrefs

A355901 Records in A355899.

Original entry on oeis.org

1, 3, 5, 11, 17, 71, 579, 2705
Offset: 1

Views

Author

N. J. A. Sloane, Sep 03 2022

Keywords

Crossrefs

Programs

  • Mathematica
    nn = 2^16; j = k = r = 1; {1}~Join~Reap[Do[m = # + (j + k)/# &@ GCD[j, k]; If[# > r, r = #; Sow[r]] &[GCD[k, m]]; j = k; k = m, {n, 3, nn}]][[-1, -1]] (* Michael De Vlieger, Sep 03 2022 *)

A355914 a(n) = gcd(b(n-1),b(n)), where b(n) = A351871(n).

Original entry on oeis.org

1, 2, 1, 5, 2, 1, 1, 4, 1, 1, 2, 1, 1, 2, 1, 1, 4, 1, 1, 8, 2, 3, 3, 6, 1, 1, 6, 1, 1, 6, 10, 2, 1, 1, 2, 1, 1, 2, 1, 1, 4, 2, 1, 1, 2, 30, 5, 5, 8, 1, 1, 4, 43, 1, 2, 1, 3, 4, 1, 3, 12, 1, 1, 2, 1, 1, 2, 1, 1, 2, 3, 1, 2, 1, 1, 2, 25, 1, 4, 1, 1, 6, 1, 1, 6
Offset: 2

Views

Author

N. J. A. Sloane, Sep 19 2022

Keywords

Comments

In order to understand the difference between A351871 (which cycles) and A355898 (which appears to diverge), it would be helpful to understand the difference between the respective gcd sequences (this and A355899 - the latter has a very interesting graph!).

Crossrefs

Programs

  • Python
    from math import gcd
    from itertools import islice
    def agen():
        a = [1, 2]
        while True: g = gcd(*a); yield g; a = [a[-1], g + sum(a)//g]
    print(list(islice(agen(), 85))) # Michael S. Branicky, Sep 19 2022

Extensions

a(66) and beyond from Michael S. Branicky, Sep 19 2022
Showing 1-5 of 5 results.