OFFSET
1,1
COMMENTS
The sequence has another definition: a(n)= The number of distinct elements in the set A(n)={f^{k}(n);k>=0}, where f^{k} is the k-th iteration of the function f defined by f(n)=2+A075860(n), f^{0}(n)=n and n>0.
For all n>0, the set A(n) contains either the fixed point 4 or a cyclic component {5,7,9}.
For all n>1 and h in A(n)\{n}, h-2 is a prime number.
a(n)=1 if and only if n=4.
If (p,p+2) is a twin prime pair with p>7, then a(p+2)=a(p)-1.
EXAMPLE
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.
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]);
PROG
(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)])
CROSSREFS
KEYWORD
nonn
AUTHOR
Rafik Khalfi, Sep 08 2024
STATUS
approved