%I #10 May 10 2024 11:28:49
%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 Jonathan Wellons, <a href="https://web.archive.org/web/20090206165028/http://jonathanwellons.com/shared-digits/">Tables of Shared Digits</a> [archived]
%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,more
%O 1,1
%A Jonathan Wellons (wellons(AT)gmail.com), Jan 22 2008
|