A340967 a(n) is the number of iterations of the map x -> n mod sopfr(x) starting with n to reach 0 or 1, where sopfr = A001414.
0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 3, 1, 4, 2, 1, 1, 2, 1, 2, 1, 4, 1, 3, 2, 4, 1, 3, 1, 1, 1, 2, 3, 3, 3, 2, 1, 4, 4, 3, 1, 3, 1, 4, 1, 3, 1, 2, 2, 2, 4, 1, 1, 5, 3, 2, 4, 4, 1, 1, 1, 4, 4, 2, 4, 2, 1, 4, 2, 1, 1, 1, 1, 3, 3, 3, 3, 3, 1, 2, 3, 3, 1, 1, 3, 4, 5, 2, 1, 3, 3, 3, 3, 5, 4, 2, 1, 2, 2
Offset: 1
Keywords
Examples
a(12) = 3 because 12 mod (2+2+3) = 5, 12 mod 5 = 2 and 12 mod 2 = 0 (3 iterations). a(54) = 5 because 54 mod (2+3+3+3) = 10, 54 mod (2+5) = 6, 54 mod 5 = 4, 54 mod (2+2) = 2, and 54 mod 2 = 0 (5 iterations).
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
Maple
sopfr:= proc(n) local t; add(t[1]*t[2], t = ifactors(n)[2]) end proc: f:= proc(n) local x,k; x:= n; for k from 1 do x:= n mod sopfr(x); if x <= 1 then return k fi od; end proc: f(1):= 0: map(f, [$1..200]);
-
Python
from sympy import factorint def A340967(n): c, x = 0, n while x > 1: c += 1 x = n % sum(p*e for p, e in factorint(x).items()) return c # Chai Wah Wu, Feb 01 2021
Comments