login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A175078 Number of iterations of {r mod (max prime p < r)} needed to reach 1 or 2 starting at r = n. 3

%I #16 Aug 04 2022 05:52:57

%S 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 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 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 Number of iterations of {r mod (max prime p < r)} needed to reach 1 or 2 starting at r = n.

%C 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 Essentially the same as A121561. [_R. J. Mathar_, Jan 28 2010]

%C 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 Antti Karttunen, <a href="/A175078/b175078.txt">Table of n, a(n) for n = 1..16384</a>

%F 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 a(123) = 3; iteration procedure for n = 123: 123 mod 113 = 10, 10 mod 7 = 3, 3 mod 2 = 1.

%t Array[-1 + Length@ NestWhileList[Mod[#, NextPrime[#, -1]] &, #, Not[1 <= # <= 2] &, 1, 120] &, 105] (* _Michael De Vlieger_, Oct 30 2017 *)

%o (PARI) A175078(n) = if(n<=2,0,1+A175078(n%precprime(n-1))); \\ _Antti Karttunen_, Oct 30 2017

%Y Cf. A049711, A064722, A121559, A121561, A175071, A175072, A175077.

%K nonn

%O 1,10

%A _Jaroslav Krizek_, Jan 23 2010

%E Name shortened by _Antti Karttunen_, Oct 30 2017

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 18 11:29 EDT 2024. Contains 371779 sequences. (Running on oeis4.)