login
When squared gives number composed just of the digits 1, 2, 3, 4.
1

%I #14 Mar 01 2016 22:56:38

%S 1,2,11,12,18,21,38,111,182,338,462,482,1111,1188,1488,1521,2079,3338,

%T 3368,3482,3512,3639,4818,5868,10688,11011,12018,17639,17979,18012,

%U 20521,20771,20838,21079,33338,33368,33632,34962,36361,37739,37962

%N When squared gives number composed just of the digits 1, 2, 3, 4.

%H Chai Wah Wu, <a href="/A061677/b061677.txt">Table of n, a(n) for n = 1..10001</a>

%p filter:= t -> convert(convert(t^2,base,10),set) subset {1,2,3,4}:

%p select(filter, [seq(seq(x, x=ceil(sqrt((10^i-1)/9)) .. floor(sqrt(4*(10^i-1)/9))),i=1..10)]); # _Robert Israel_, Mar 01 2016

%t Do[ If[ Union[ Join[ {1, 2, 3, 4}, IntegerDigits[n^2] ] ] == {1, 2, 3, 4}, Print[n] ], {n, 0, 200000} ]

%o (PARI) isok(n) = my(d = digits(n^2)); vecmin(d) && (vecmax(d) <= 4); \\ _Michel Marcus_, Feb 29 2016

%K base,nonn

%O 1,2

%A _Robert G. Wilson v_, Jun 23 2001