%I #23 Apr 24 2024 08:55:10
%S 1,2,11,12,21,111,1111
%N Numbers k such that k and k^2 use only the digits 1, 2, 3 and 4.
%C Generated with DrScheme.
%C No further terms up to 444444444444. Conjecture: these are all the terms. - _Robert Israel_, Mar 01 2017
%C From _Pontus von Brömssen_, Apr 23 2024: (Start)
%C a(8) > 10^52 (if it exists).
%C If k = x*10^m is a term where 1 < x < 10 and k > 1111, then 1.1141114132411144244121413311312223343222114323114131 < x < 1.1141424242144423132424212124444121442241144431212312.
%C (End)
%H Jonathan Wellons, <a href="https://web.archive.org/web/20090206165028/http://jonathanwellons.com/shared-digits/">Tables of Shared Digits</a> [archived].
%e 21^2 = 441, so 21 is a term.
%p dmax:= 8: # to get all terms of up to dmax digits
%p f:= proc(n) local L; L:= convert(n^2,base,10); min(L) >= 1 and max(L) <= 4 end proc:
%p A:= NULL:
%p for d from 1 to dmax do
%p for i from 0 to 4^d-1 do
%p R:= convert(i+4^d,base,4);
%p n:= add((R[i]+1)*10^(i-1),i=1..d);
%p if filter(n) then A:= A, n fi
%p od
%p od:
%p A; # _Robert Israel_, Mar 01 2017
%o (PARI) isok(n) = {vno = [0,5,6,7,8,9]; !#setintersect(Set(digits(n)), vno) && !#setintersect(Set(digits(n^2)), vno);} \\ _Michel Marcus_, Mar 01 2017
%K base,nonn,more
%O 1,2
%A Jonathan Wellons (wellons(AT)gmail.com), Jan 22 2008