[go: up one dir, main page]

login
Numbers n such that n^2 contains exactly 4 different digits.
10

%I #13 Oct 27 2023 22:00:46

%S 32,33,36,37,42,43,44,48,49,51,52,53,54,55,57,59,61,64,66,69,71,72,73,

%T 74,78,79,82,84,86,87,89,93,95,96,98,99,103,104,105,106,112,114,115,

%U 123,125,127,130,132,135,138,139,140,143,145,146,151,155,156,157,158

%N Numbers n such that n^2 contains exactly 4 different digits.

%H T. D. Noe, <a href="/A054032/b054032.txt">Table of n, a(n) for n = 1..10000</a>

%p f := []; for i from 0 to 200 do if nops({op(convert(i^2,base,10))})=4 then f := [op(f),i] fi; od; f;

%t t = {}; n = -1; While[Length[t] < 50, n++; If[Length[Union[IntegerDigits[n^2]]] == 4, AppendTo[t, n]]] (* _T. D. Noe_, Apr 26 2013 *)

%o (PARI) is(n)=#Set(digits(n^2))==4 \\ _Charles R Greathouse IV_, Feb 11 2017

%Y Cf. A016069, A054031, A054033, A054034, A054035, A054036, A054037, A054038, A054039.

%K nonn,base

%O 1,1

%A _Asher Auel_, Feb 29 2000