|
%I
%S 2,3,4,7,8,9,17,18,24,29,53,54,57,59,72,79,84,209,259,567,807,854
%N Numbers n such that n and n^2 combined use different digits.
%C There are exactly 22 solutions in base 10.
%D M. Kraitchik, Mathematical Recreations, p. 48, Problem 12. - From _N. J. A. Sloane_, Mar 15 2013
%p # Maple program from _N. J. A. Sloane_, Mar 15 2013:
%p M:=1000;
%p a1:=[]; a2:=[];
%p for n from 1 to M do
%p # are digits of n and n^2 distinct?
%p t1:=convert(n,base,10);
%p t2:=convert(n^2,base,10);
%p s3:={op(t1),op(t2)};
%p if nops(t1)+nops(t2) = nops(s3) then a1:=[op(a1),n]; a2:=[op(a2),n^2]; fi;
%p od:
%p a1; a2;
%t Select[Range[10000], Intersection[IntegerDigits[ # ], IntegerDigits[ #^2]] == {} && Length[Union[IntegerDigits[ # ], IntegerDigits[ #^2]]] == Length[IntegerDigits[ # ]] + Length[IntegerDigits[ #^2]] &] - _Tanya Khovanova_, Dec 25 2006
%Y Cf. A059931, A029783.
%Y Cf. A029783 = Digits of n are not present in n^2, A112736 = numbers whose squares are exclusionary.
%K nonn,base,fini,full
%O 1,1
%A _Patrick De Geest_, Feb 15 2001.
|