A257534 Numbers n such that the decimal expansions of both n and n^2 have 4 as the digit with the smallest value and 7 as the digit with the largest value.
74, 74476, 74474476
Offset: 1
Crossrefs
Programs
-
Mathematica
fQ[n_] := Block[{c = DigitCount@ n}, And[Plus @@ Take[c, {1, 3}] == 0, Plus @@ Take[c, {8, 10}] == 0, c[[4]] > 0, c[[7]] > 0]]; Select[Range@ 1000000, fQ@ # && fQ[#^2] &] (* Michael De Vlieger, May 05 2015 *)
-
PARI
is(n) = vecmin(digits(n))==4 && vecmin(digits(n^2))==4 && vecmax(digits(n))==7 && vecmax(digits(n^2))==7
Comments