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.

A342679 Number of steps for n to reach 1 or n by repeated application of A037916, or -1 if they are never reached.

This page as a plain text file.
%I A342679 #67 May 26 2021 02:48:02
%S A342679 1,1,2,1,2,1,2,2,2,1,3,1,2,2,3,1,4,1,3,2,2,1,2,2,2,2,3,1,3,1,2,2,2,2,
%T A342679 3,1,2,2,2,1,3,1,3,3,2,1,2,2,4,2,3,1,2,2,2,2,2,1,2,1,2,3,3,2,3,1,3,2,
%U A342679 3,1,3,1,2,4,3,2,3,1,2,3,2,1,2,2,2,2,2,1
%N A342679 Number of steps for n to reach 1 or n by repeated application of A037916, or -1 if they are never reached.
%C A342679 Let n = (p1^a1)*(p2^a2)*...*(pk^aj) be the prime-factorization of n >= 2, where primes are in ascending order and ai >= 1 for all i >= 1 and <= k, then form n' = a1 a2 a3 ... ak = A037916(n), the concatenation of the exponents. Repeat this process if n' != 1 and != n, otherwise stop.
%C A342679 When n is prime, a(n) = 1; when n is semiprime, a(n) = 2.
%C A342679 Does every n reach 1 by this process, or does there exist some n whose trajectory enters a cycle, i.e., we reach n again instead of 1?
%C A342679 No cycles for n <= 10^9. - _Michael S. Branicky_, Mar 21 2021
%e A342679 3 = 3^1 -> 1, so a(3) = 1;
%e A342679 6 = 2^1 * 3^1 -> 11 = 11^1 -> 1, so a(6) = 2;
%e A342679 16 = 2^4 -> 4 = 2^2 -> 2 = 2^1 -> 1, so a(16) = 3;
%e A342679 50 = 2^1 * 5^2 -> 12 = 2^2 * 3^1 -> 21 = 3^1 * 7^1 -> 11 -> 1, so a(50) = 4.
%t A342679 Table[Length@Rest@Most@FixedPointList[FromDigits[Last/@FactorInteger@#]&,k],{k,2,100}] (* _Giorgos Kalogeropoulos_, Apr 01 2021 *)
%o A342679 (Python)
%o A342679 import sympy
%o A342679 N=int(input())
%o A342679 A342679_n=[]
%o A342679 for n in range(2,N+1):
%o A342679     n_0=n
%o A342679     steps=0
%o A342679     while not sympy.isprime(n) :
%o A342679         exponents=list(sympy.factorint(n).values())
%o A342679         m=""
%o A342679         for i in exponents:
%o A342679             m=m+str(i)
%o A342679         n=int(m)
%o A342679         if n==n_0:
%o A342679             break
%o A342679         steps+=1
%o A342679     A342679_n.append(steps+1)
%o A342679 print(A342679_n)
%o A342679 (Python)
%o A342679 def a(n):
%o A342679   c, iter = 1, A037916(n)
%o A342679   while iter != 1 and iter != n: c, iter = c+1, A037916(iter)
%o A342679   return c
%o A342679 print([a(n) for n in range(2, 89)]) # _Michael S. Branicky_, Mar 20 2021
%o A342679 (PARI) f(n) = my(f=factor(n)[,2], s=""); for(i=1, #f~, s=concat(s,Str(f[i]))); eval(s); \\ A037916
%o A342679 a(n) = my(k=n, nb=0); while (k != 1, k = f(k); nb++); nb; \\ _Michel Marcus_, Mar 18 2021
%Y A342679 Cf. A000040, A037916.
%K A342679 nonn,base
%O A342679 2,3
%A A342679 _Devansh Singh_, Mar 18 2021