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.

A372748 a(1) = 3; for n > 1, a(n) = a(n - 1) if GCD(n - 1, a(n - 1)) = 1, otherwise a(n) = n - 1 - a(n - 1) / GCD(n - 1, a(n - 1)).

Original entry on oeis.org

3, 3, 3, 2, 3, 3, 5, 5, 5, 5, 9, 9, 9, 9, 9, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 25, 25, 25, 25, 25, 25, 25, 25, 25, 30, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 61, 61, 61, 61, 61, 61, 61, 61
Offset: 1

Views

Author

Ctibor O. Zizka, May 12 2024

Keywords

Comments

a(n) = n/2 for n from {4,6,10,26,62,122,298,626,1094,2186,...}.

Examples

			a(1) = 3.
a(2) = 3 because GCD(1,3) = 1.
a(3) = 3 because GCD(2,3) = 1.
a(4) = 3 - 3/GCD(3,3) = 2.
and so on.
		

Crossrefs

Programs

  • Mathematica
    nxt[{n_,a_}]:={n+1,If[GCD[n,a]==1,a,n-a/GCD[n,a]]}; NestList[nxt,{1,3},70][[;;,2]] (* Harvey P. Dale, Feb 11 2025 *)
    FoldList[If[CoprimeQ[#, #2], #, #2 - #/GCD[#, #2]] &, 3, Range[100]] (* Paolo Xausa, Feb 12 2025 *)