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.

This page as a plain text file.
%I A175077 #19 Jun 15 2023 04:37:20
%S A175077 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,
%T A175077 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,
%U A175077 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
%N A175077 Final number reached by iterating r -> A049711(r) starting at r = n.
%C A175077 See A175071 for starting n that reach 1, and A175072 for starting n that reach 2.
%F A175077 a(A175071(k)) = 1; a(A175072(k)) = 2, any k. - _R. J. Mathar_, Feb 19 2010
%F A175077 a(n) = A121559(n-1) + 1 for n >= 2. - _Pontus von Brömssen_, Jul 31 2022
%e A175077 Iteration procedure for n = 6: 6 mod 5 = 1 = a(6).
%e A175077 Iteration procedure for n = 7: 7 mod 5 = 2 = a(7).
%p A175077 A151799 := proc(n) prevprime(n) ; end proc:
%p A175077 A049711 := proc(n) if n <=2 then n; else n-A151799(n) ; end if; end proc:
%p A175077 A175077 := proc(n) local r ; r := n ; while r > 2 do r := A049711(r) ; end do: r ; end proc:
%p A175077 seq(A175077(n),n=1..100) ; # _R. J. Mathar_, Feb 19 2010
%t A175077 f[n_] := Switch[n, 1, 1, 2, 2, _, n - NextPrime[n, -1]];
%t A175077 a[n_] := FixedPoint[f, n];
%t A175077 Table[a[n], {n, 1, 100}] (* _Jean-François Alcover_, Jun 13 2023 *)
%Y A175077 Cf. A049711, A121559, A151799, A175071, A175072.
%K A175077 nonn
%O A175077 1,2
%A A175077 _Jaroslav Krizek_, Jan 23 2010
%E A175077 More terms from _R. J. Mathar_, Feb 19 2010