%I #24 Dec 01 2022 17:21:03
%S 345918672,351987624,359841267,394675182,429715863,439516278,
%T 487256193,527394816,527498163,528714396,572493816,592681437,
%U 729564183,746318529,749258163,754932681,759142683,759823641,762491835,783942561,784196235,845691372,891357624,914863275,915786423,923165487,928163754,976825431
%N Zeroless pandigital numbers whose square has each digit 1 to 9 twice.
%e 345918672 is a term since its square 119659727638243584 contains all digits 1..9 twice each.
%p R:= NULL:
%p for t in combinat:-permute([$1..9]) do
%p x:= add(t[i]*10^(i-1),i=1..9);
%p if sort(convert(x^2,base,10)) = [seq(i$2,i=1..9)] then
%p R:= R, x
%p fi
%p od:
%p sort([R]); # _Robert Israel_, Nov 27 2022
%o (Python)
%o from itertools import permutations as per
%o a=[]
%o for n in [int(''.join(d)) for d in per('123456789', 9)]:
%o if all(str(n**2).count(d) ==2 for d in '123456789'):
%o a.append(n)
%o print(a)
%Y Cf. A050289, A199630.
%K nonn,base,fini,full
%O 1,1
%A _Zhining Yang_, Nov 27 2022
|