OFFSET
1,1
EXAMPLE
If n = 38754, starting from the least significant digit, let us cut the number into the set 4, 54, 754, 8754. We have:
phi(4) = 2;
phi(54) = 18;
phi(754) = 336;
phi(8754) = 2916.
Then, starting from the most significant digit, let us cut the number into the set 3, 38, 387, 3875. We have:
phi(3) = 2;
phi(38) = 18;
phi(387) = 252;
phi(3875) = 3000.
Finally, 2 + 18 + 336 + 2916 = 2 + 18 + 252 + 3000 = 3272.
MAPLE
with(numtheory); P:=proc(q) local a, b, k, n; for n from 2 to q do
a:=0; k:=1; while trunc(n/10^k)>0 do a:=a+phi(trunc(n/10^k)); k:=k+1; od;
b:=0; k:=1; while (n mod 10^k)<n do b:=b+phi(n mod 10^k); k:=k+1; od;
if a=b then a:=0; b:=n; while b>0 do a:=10*a+(b mod 10); b:=trunc(b/10); od;
if a<>n then print(n); fi; fi; od; end: P(10^9);
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Paolo P. Lava, Apr 24 2014
STATUS
approved