%I #6 Jul 05 2021 10:46:12
%S 2,7,27,49777,4994777,49994777,499979277
%N Numbers k such that k and k^2 use only the digits 2, 4, 7 and 9.
%C Generated with DrScheme.
%H J. Wellons, <a href="http://jonathanwellons.com/shared-digits/">Tables of Shared Digits</a>
%e 499979277^2 = 249979277429442729.
%t okQ[n_]:=Module[{id=Union[IntegerDigits[n^2]]},And@@Table[MemberQ[ {2,4,7,9}, id[[i]]],{i,Length[id]}]]; Flatten[Table[Select[ FromDigits/@ Tuples[{2,4,7,9},d],okQ],{d,10}]] (* _Harvey P. Dale_, Jun 26 2012 *)
%K base,nonn
%O 1,1
%A Jonathan Wellons (wellons(AT)gmail.com), Jan 22 2008
|