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.

A175078 Number of iterations of {r mod (max prime p < r)} needed to reach 1 or 2 starting at r = n.

This page as a plain text file.
%I A175078 #16 Aug 04 2022 05:52:57
%S A175078 0,0,1,1,1,1,1,1,1,2,2,1,1,1,1,2,2,1,1,1,1,2,2,1,1,2,2,2,2,1,1,1,1,2,
%T A175078 2,2,2,1,1,2,2,1,1,1,1,2,2,1,1,2,2,2,2,1,1,2,2,2,2,1,1,1,1,2,2,2,2,1,
%U A175078 1,2,2,1,1,1,1,2,2,2,2,1,1,2,2,1,1,2,2,2,2,1,1,2,2,2,2,2,2,1,1,2
%N A175078 Number of iterations of {r mod (max prime p < r)} needed to reach 1 or 2 starting at r = n.
%C A175078 a(123) = 3 (first occurrence of value 3), a(1357324) = 4 (first occurrence of value 4). I offer a prize of 100 liters of Pilsner Urquell to the discoverer of value of first occurrence of value 5. See A175071 (natural numbers m with result 1) and A175072 (natural numbers m with result 2). See A175077 = results 1 or 2 under iterations of {r mod (max prime p < r)} starting at r = n.
%C A175078 Essentially the same as A121561. [_R. J. Mathar_, Jan 28 2010]
%C A175078 The function r mod (max prime p < r), which appears in the definition, equals r - (max prime p < r) = A049711(r), because p < r < 2*p by Bertrand's postulate, where p is the largest prime less than r. - _Pontus von Brömssen_, Jul 31 2022
%H A175078 Antti Karttunen, <a href="/A175078/b175078.txt">Table of n, a(n) for n = 1..16384</a>
%F A175078 a(n) = A121561(n-1) for n >= 2, because the functions that are iterated (A049711 here, A064722 in A121561) satisfies A049711(r) = A064722(r-1) + 1. - _Pontus von Brömssen_, Jul 31 2022
%e A175078 a(123) = 3; iteration procedure for n = 123: 123 mod 113 = 10, 10 mod 7 = 3, 3 mod 2 = 1.
%t A175078 Array[-1 + Length@ NestWhileList[Mod[#, NextPrime[#, -1]] &, #, Not[1 <= # <= 2] &, 1, 120] &, 105] (* _Michael De Vlieger_, Oct 30 2017 *)
%o A175078 (PARI) A175078(n) = if(n<=2,0,1+A175078(n%precprime(n-1))); \\ _Antti Karttunen_, Oct 30 2017
%Y A175078 Cf. A049711, A064722, A121559, A121561, A175071, A175072, A175077.
%K A175078 nonn
%O A175078 1,10
%A A175078 _Jaroslav Krizek_, Jan 23 2010
%E A175078 Name shortened by _Antti Karttunen_, Oct 30 2017