A376070 a(n) is the number of distinct terms reached by iterating the function x->2+A075860(x), starting from x=n, with n>0.
3, 2, 4, 1, 3, 4, 3, 2, 3, 4, 4, 4, 3, 4, 2, 2, 6, 4, 5, 4, 4, 3, 5, 4, 4, 2, 4, 4, 6, 4, 5, 2, 4, 5, 4, 4, 3, 4, 2, 4, 4, 4, 3, 3, 2, 4, 5, 4, 4, 4, 4, 2, 3, 4, 2, 4, 3, 5, 6, 4, 5, 4, 4, 2, 4, 2, 3, 5, 2, 4, 4, 4, 3, 2, 2, 4, 4, 4, 5, 4, 4, 3, 4, 4, 3, 2, 2, 3, 5, 4, 4, 4, 5, 4, 4, 4, 5, 4, 4, 4, 4
Offset: 1
Keywords
Examples
For n=3, 3->5->7->9->5->7->9-> ... and {5,7,9} is a cyclic component, then a(n)=number of distinct terms = 4. For n=66, 66->4->4->4-> ... and 4 is a fixed point, then a(n)= number of distinct terms = 2. For n=25, 25->7->9->5->7->9->5->7->9->... and {5,7,9} is a cyclic component, then a(n)=number of distinct terms = 4.
Crossrefs
Cf. A075860.
Programs
-
Maple
f := proc(n) option remember: if isprime(n) then n else procname(convert(numtheory:-factorset(n), `+`)) end if end proc: f(1) := 0: g := proc(n) 2 + f(n) end proc: A376070 := proc(n) local k, result: k := 1: result := n: while not (result = 4 or result = 5 or result = 7 or result = 9) do result := g(result): k := k + 1: end do: if result = 5 or result = 7 or result = 9 then return k + 2; else return k: end if end proc: map(A376070, [$1..200]);
-
Python
from sympy import primefactors def a(n, pn): if n == pn: return n else: return a(sum(primefactors(n)), n) def A376070(n): k = 1 result = n while result not in {4, 5, 7, 9}: result = 2 + a(result, None) k += 1 if result in {5, 7, 9}: return k + 2 else: return k print([A376070(i) for i in range(1, 200)])
Comments