A087472 Number of iterations required for the function f(n) to reach a single digit, where f(n) is the product of the two numbers formed from the alternating digits of n.
0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 1, 1, 1, 2, 2, 2, 2, 3, 2, 3, 1, 1, 2, 2, 2, 3, 2, 3, 2, 3, 1, 1, 2, 2, 2, 2, 3, 2, 3, 3, 1, 1, 2, 2, 3, 3, 2, 4, 3, 3, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 1, 1, 2, 3, 3, 3, 3, 3, 3, 2, 1, 1, 1, 1, 1, 1
Offset: 1
Examples
a(1234)= 3 since f(1234)=13*24=312, f(312)=32*1=32 and f(32)=3*2=6.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
Maple
murthy:= proc(n) local L,d; L:= convert(n,base,10); d:= nops(L); add(L[2*i+1]*10^i,i=0..(d-1)/2)*add(L[2*i+2]*10^i,i=0..(d-2)/2) end proc: A087472:= proc(n) option remember; if n < 10 then 0 else 1+procname(murthy(n)) fi end proc: map(A087472, [$1..200]); # Robert Israel, Feb 14 2017
Comments