Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #50 May 01 2020 12:19:25
%S 1,1,1,2,1,2,1,2,2,2,1,3,1,3,2,2,1,2,1,2,2,2,1,2,2,5,4,2,1,4,1,2,4,4,
%T 3,2,1,3,2,2,1,2,1,2,2,2,1,3,3,2,2,3,1,2,2,3,2,2,1,2,1,3,2,4,3,2,1,2,
%U 2,2,1,4,1,3,2,2,2,2,1,4,2,2,1,4,2,3,2,4,1,2,2,4,4,4,3,2,1,3,2,4
%N Length of trajectory of n under the map n -> n - 1 + n/gpf(n) or 0 if no fixed point is reached, where gpf(n) is the greatest prime factor of n.
%C The table of trajectories of n under is given in A329288.
%C All fixed points, besides 1, are prime.
%C Conjecture: every number appears in the sequence infinitely many times.
%C Conjecture: all terms are nonzero, i.e., every trajectory eventually reaches a prime.
%H Robert Israel, <a href="/A330437/b330437.txt">Table of n, a(n) for n = 1..10000</a>
%F a(p) = 1 for any prime number p.
%e For n = 26 the trajectory is (26, 27, 35, 39, 41) so a(26) = 5.
%p g:= n -> n - 1 + n/max(numtheory:-factorset(n)):
%p f:= proc(n) option remember;
%p if isprime(n) then 1 else 1+ procname(g(n)) fi
%p end proc:
%p f(1):= 1:
%p map(f, [$1..200]); # _Robert Israel_, May 01 2020
%t Clear[f,it,order,seq]; f[n_]:=f[n]=n-1+n/FactorInteger[n][[-1]][[1]]; it[k_,n_]:=it[k,n]=f[it[k,n-1]]; it[k_,1]=k; order[n_]:=order[n]=SelectFirst[Range[1,100], it[n,#]==it[n,#+1]&]; Print[order/@Range[1,100]];
%o (PARI) apply( {a(n,c=1)=n>1&&while(n<n+=n/vecmax(factor(n)[,1])-1,c++);c}, [1..99]) \\ _M. F. Hasler_, Feb 19 2020
%Y Cf. A006530 (greatest prime factor), A329288, A330704 (greedy inverse).
%Y Cf. A270807, A120685, A331410.
%K nonn
%O 1,4
%A _Elijah Beregovsky_, Feb 16 2020