login
Number of iterations of the mapping k -> abs(reverse(lpd(k))-reverse(gpf(k))) to reach zero, or -1 if zero is never reached. lpd(k) is the largest proper divisor and gpf(k) is the greatest prime factor of k.
4

%I #5 May 30 2014 09:21:18

%S 1,2,3,1,2,1,2,3,1,1,2,4,3,1,1,2,3,2,3,2,1,1,6,3,1,1,2,2,2,2,5,3,1,1,

%T 1,3,5,1,1,4,4,3,2,3,2,1,5,2,1,6,1,6,2,2,1,7,1,1,2,3,2,1,3,2,1,2,7,3,

%U 1,2,3,4,4,1,6,4,1,2,4,2,2,1,6,4,1,1,1,2,4,2,1,4,1,1,1,3,3,2,2,1,2,8,3,2,2

%N Number of iterations of the mapping k -> abs(reverse(lpd(k))-reverse(gpf(k))) to reach zero, or -1 if zero is never reached. lpd(k) is the largest proper divisor and gpf(k) is the greatest prime factor of k.

%C See A076424 for numbers such that zero is never reached, A076425 for the smallest numbers that need n iterations to reach zero, A076426 for fixed points of the mapping.

%e For n = 13: lpd(13) = 1, gpf(13)=13, abs(reverse(1)-reverse(13)) = 30; lpd(30) = 15, gpf(30) = 5, abs(reverse(15)-reverse(5)) = 46; lpd(46) = 23, gpf(46)=23, abs(reverse(23)-reverse(23)) = 0. Three iterations to reach zero, so a(13) = 3.

%o (PARI) {stop=20; for(n=1,105,c=1; b=1; k=n; while(b&&c<=stop,w=divisors(k); s=matsize(w)[2]-1; z=if(s>0,w[s],1); p=0; while(z>0,d=divrem(z,10); z=d[1]; p=10*p+d[2]); z=if(k==1,1,vecmax(component(factor(k),1))); q=0; while(z>0,d=divrem(z,10); z=d[1]; q=10*q+d[2]); k=abs(p-q); if(k>0,c++,b=0)); print1(if(c>stop,-1,c),","))}

%Y Cf. A032742, A006530, A075660, A076424, A076425, A076426.

%K base,nonn

%O 1,2

%A _Klaus Brockhaus_, Oct 11 2002