cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

This page as a plain text file.
%I A376070 #6 Sep 30 2024 13:06:03
%S A376070 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,
%T A376070 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,
%U A376070 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
%N 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.
%C A376070 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.
%C A376070 For all n>0, the set A(n) contains either the fixed point 4 or a cyclic component {5,7,9}.
%C A376070 For all n>1 and h in A(n)\{n}, h-2 is a prime number.
%C A376070 a(n)=1 if and only if n=4.
%C A376070 If (p,p+2) is a twin prime pair with p>7, then a(p+2)=a(p)-1.
%e A376070 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.
%e A376070 For n=66, 66->4->4->4-> ... and 4 is a fixed point, then a(n)= number of distinct terms = 2.
%e A376070 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.
%p A376070 f := proc(n) option remember:
%p A376070     if isprime(n) then
%p A376070         n
%p A376070     else
%p A376070         procname(convert(numtheory:-factorset(n), `+`))
%p A376070     end if
%p A376070 end proc:
%p A376070 f(1) := 0:
%p A376070 g := proc(n)
%p A376070     2 + f(n)
%p A376070 end proc:
%p A376070 A376070 := proc(n)
%p A376070     local k, result:
%p A376070     k := 1:
%p A376070     result := n:
%p A376070     while not (result = 4 or result = 5 or result = 7 or result = 9) do
%p A376070         result := g(result):
%p A376070         k := k + 1:
%p A376070     end do:
%p A376070     if result = 5 or result = 7 or result = 9 then
%p A376070         return k + 2;
%p A376070     else
%p A376070         return k:
%p A376070     end if
%p A376070 end proc:
%p A376070 map(A376070, [$1..200]);
%o A376070 (Python)
%o A376070 from sympy import  primefactors
%o A376070 def a(n, pn):
%o A376070     if n == pn:
%o A376070         return n
%o A376070     else:
%o A376070         return a(sum(primefactors(n)), n)
%o A376070 def A376070(n):
%o A376070     k = 1
%o A376070     result = n
%o A376070     while result not in {4, 5, 7, 9}:
%o A376070         result = 2 + a(result, None)
%o A376070         k += 1
%o A376070     if result in {5, 7, 9}:
%o A376070         return k + 2
%o A376070     else:
%o A376070         return k
%o A376070 print([A376070(i) for i in range(1, 200)])
%Y A376070 Cf. A075860.
%K A376070 nonn
%O A376070 1,1
%A A376070 _Rafik Khalfi_, Sep 08 2024