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.
%I A308725 #67 Jul 29 2019 13:56:24 %S A308725 3,3,2,2,1,0,0,1,1,2,4,1,3,3,2,2,7,2,6,2,5,4,6,2,5,3,2,5,5,3,4,3,3,3, %T A308725 4,3,9,5,8,5,7,2,6,3,5,4,4,5,3,2,6,8,9,2,8,4,7,4,6,2,5,4,4,2,7,3,4,6, %U A308725 3,4,6,4,5,6,4,7,7,3,4,4,3,4,8,4,7,5,4,8,7,4,6,3,5,3,6,4,9,3,8,4 %N A308725 Number of steps to reach 6 or 7 when iterating x -> A227215(x) starting at x=n, where A227215(n) gives the smallest such sum a+b+c of three positive integers for which a*b*c = n. %C A308725 Starting from n, choose factorization n = m1*m2*m3 so that the sum x = m1+m2+m3 is minimal, then set n = x and repeat. a(n) gives the number of steps needed to reach either 6 or 7. The process is guaranteed to reach either term, because we only use factorization n = n*1*1 when n is either 1 or a prime number, that are the only cases (apart from A227215(4)=5) for which A227215(n) > n as then A227215(n) = n+2. Moreover, for n > 3, at least one of n, n+2, n+4 is composite, leading to a further significant drop in the trajectory after at most two consecutive +2 steps. - Comment clarified by _Antti Karttunen_, Jul 12 2019 %C A308725 Records: 3, 4, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, ..., occur at: n = 1, 11, 17, 37, 107, 233, 307, 1289, 3986, 6637, 14347, 69029, .... - _Antti Karttunen_, Jul 12 2019 %H A308725 Antti Karttunen, <a href="/A308725/b308725.txt">Table of n, a(n) for n = 1..10000</a> %F A308725 If n is 6 or 7, a(n) = 0, otherwise a(n) = 1 + a(A227215(n)). - _Antti Karttunen_, Jul 11 2019 %e A308725 1 = 1*1*1 --> 1 + 1 + 1 = 3 %e A308725 3 = 1*1*3 --> 1 + 1 + 3 = 5 %e A308725 5 = 1*1*5 --> 1 + 1 + 5 = 7, thus a(1) = 3. %e A308725 . %e A308725 4 = 1*2*2 --> 1 + 2 + 2 = 5, %e A308725 5 = 1*1*5 --> 1 + 1 + 5 = 7, thus a(4) = 2. %e A308725 . %e A308725 560 = 7*8*10 --> 7 + 8 + 10 = 25 %e A308725 25 = 1*5*5 --> 1 + 5 + 5 = 11 %e A308725 11 = 1*1*11 --> 1 + 1 + 11 = 13 %e A308725 13 = 1*1*13 --> 1 + 1 + 13 = 15 %e A308725 15 = 1*3*5 --> 1 + 3 + 5 = 9 %e A308725 9 = 1*3*3 --> 3 + 3 + 1 = 7, thus a(560) = 6. %e A308725 . %e A308725 84 = 3*4*7 --> 3 + 4 + 7 = 14 %e A308725 14 = 1*2*7 --> 1 + 2 + 7 = 10 %e A308725 10 = 1*2*5 --> 1 + 2 + 5 = 8 %e A308725 8 = 2*2*2 --> 2 + 2 + 2 = 6, thus a(84) = 4. %t A308725 maxTerm = 99 (* Should be increased if output -1 appears. *); %t A308725 f[m_] := Module[{m1, m2, m3, factors}, factors = {m1, m2, m3} /. {ToRules[ Reduce[1 <= m1 <= m2 <= m3 && m == m1 m2 m3, {m1, m2, m3}, Integers]]}; SortBy[factors, Total] // First]; %t A308725 a[n_] := Module[{cnt = 0, m = n, fm, step}, While[!(m == 6 || m == 7), step = {fm = f[m], m = Total[fm]}; (* Print[n," ",step]; *) cnt++; If[cnt > maxTerm, Return[-1]]]; cnt]; %t A308725 Array[a, 100] (* _Jean-François Alcover_, Jul 03 2019 *) %o A308725 (PARI) %o A308725 A227215(n) = { my(ms=3*n); fordiv(n, i, for(j=i, (n/i), if(!(n%j),for(k=j, n/(i*j), if(i*j*k==n, ms = min(ms,(i+j+k))))))); (ms); }; \\ Like code in A227215. %o A308725 A308725(n) = if((6==n)||(7==n),0,1+A308725(A227215(n))); %o A308725 \\ Memoized implementation: %o A308725 memoA308725 = Map(); %o A308725 A308725(n) = if((6==n)||(7==n), 0, my(v); if(mapisdefined(memoA308725,n,&v), v, v = 1+A308725(A227215(n)); mapput(memoA308725,n,v); (v))); \\ _Antti Karttunen_, Jul 12 2019 %Y A308725 Cf. A227215, A308190. %K A308725 nonn %O A308725 1,1 %A A308725 _Ali Sada_, Jun 20 2019