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.

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

Original entry on oeis.org

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, 55, 41, 21, 15, 21, 57, 85, 48, 19, 15, 28, 70, 93, 52, 24, 22, 38, 74, 84, 51, 30, 28, 44, 79, 88, 56, 33, 34, 55, 89, 144, 91, 39, 25, 38, 96, 155, 102, 42, 28, 44, 105, 160, 104
Offset: 1

Views

Author

Ctibor O. Zizka, Feb 20 2025

Keywords

Comments

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 ?

Examples

			a(1) = 1
a(2) = 1
a(3) = floor(1*1/1) + GCD(1,1) = 2
a(4) = floor(2*2/1) + GCD(2,1) = 5
a(5) = floor(3*5/2) + GCD(3,2) = 8
and so on.
		

Crossrefs

Programs

  • Mathematica
    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 *)

Formula

For n >= 499:
if n mod 6 = 0, a(n) = 2*n - 1 + 2*((n/2) mod 2).
if n mod 6 = 1, a(n) = n + 2.
if n mod 6 = 2, a(n) = (n + 2)/2.
if n mod 6 = 3, a(n) = (n - 1)/2.
if n mod 6 = 4, a(n) = n - 2 - (n/2) mod 2.
if n mod 6 = 5, a(n) = 2*n - 6 + 3*((n + 1)/2 mod 2).