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.

A175077 Final number reached by iterating r -> A049711(r) starting at r = n.

Original entry on oeis.org

1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1
Offset: 1

Views

Author

Jaroslav Krizek, Jan 23 2010

Keywords

Comments

See A175071 for starting n that reach 1, and A175072 for starting n that reach 2.

Examples

			Iteration procedure for n = 6: 6 mod 5 = 1 = a(6).
Iteration procedure for n = 7: 7 mod 5 = 2 = a(7).
		

Crossrefs

Programs

  • Maple
    A151799 := proc(n) prevprime(n) ; end proc:
    A049711 := proc(n) if n <=2 then n; else n-A151799(n) ; end if; end proc:
    A175077 := proc(n) local r ; r := n ; while r > 2 do r := A049711(r) ; end do: r ; end proc:
    seq(A175077(n),n=1..100) ; # R. J. Mathar, Feb 19 2010
  • Mathematica
    f[n_] := Switch[n, 1, 1, 2, 2, _, n - NextPrime[n, -1]];
    a[n_] := FixedPoint[f, n];
    Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Jun 13 2023 *)

Formula

a(A175071(k)) = 1; a(A175072(k)) = 2, any k. - R. J. Mathar, Feb 19 2010
a(n) = A121559(n-1) + 1 for n >= 2. - Pontus von Brömssen, Jul 31 2022

Extensions

More terms from R. J. Mathar, Feb 19 2010