login
Numbers n such that the decimal expansions of both n and n^2 have 1 as smallest digit and 9 as largest digit.
13

%I #21 Apr 20 2015 21:07:28

%S 139,219,519,591,719,891,911,961,971,981,1139,1193,1219,1292,1293,

%T 1296,1319,1339,1389,1391,1392,1394,1396,1469,1579,1589,1691,1719,

%U 1729,1769,1793,1839,1869,1896,1911,1927,1937,1939,1944,1946,1969,1978,1979,1981,1986

%N Numbers n such that the decimal expansions of both n and n^2 have 1 as smallest digit and 9 as largest digit.

%H Felix Fröhlich, <a href="/A256601/b256601.txt">Table of n, a(n) for n = 1..10000</a>

%t fQ[n_] := Block[{d = DigitCount@ n}, Last@ d == 0 && d[[1]] > 0 && d[[9]] > 0]; Select[Range@ 2000, fQ@ # && fQ[#^2] &] (* _Michael De Vlieger_, Apr 20 2015 *)

%o (PARI) is(n) = vecmin(digits(n))==1 && vecmin(digits(n^2))==1 && vecmax(digits(n))==9 && vecmax(digits(n^2))==9

%Y Cf. A256630, A256631, A256633, A256634, A256708, A256709, A256889, A257197, A257210, A257211.

%K nonn,base

%O 1,1

%A _Felix Fröhlich_, Apr 20 2015