A121559 Final result (0 or 1) under iterations of {r mod (max prime p <= r)} starting at r = n.
1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0
Offset: 1
Examples
a(9) = 0 because 7 is the largest prime not larger than 9, 9 mod 7 = 2, 2 is the largest prime not greater than 2 and 2 mod 2 = 0.
Links
- Kerry Mitchell, Table of n, a(n) for n = 1..7919
Crossrefs
Programs
-
Mathematica
Abs[Table[FixedPoint[Mod[#,NextPrime[#+1,-1]]&,n],{n,110}]] (* Harvey P. Dale, Mar 17 2023 *)
-
PARI
a(n) = if (n==1, return (1)); na = n; while((nb = (na % precprime(na))) > 1, na = nb); return(nb); \\ Michel Marcus, Aug 22 2014
Formula
a(p) = 0 when p is prime. - Michel Marcus, Aug 22 2014
a(n) = A175077(n+1) - 1. - Pontus von Brömssen, Jul 31 2022
a(n) = A200947(n) mod 2. - Alois P. Heinz, Jun 12 2023
Extensions
New name from Michel Marcus, Aug 22 2014
Comments