Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #35 Dec 02 2021 09:25:42
%S 4,5,6,7,8,9,11,12,15,21,22,26,38,88,109,173,212,235,264,3114,81619
%N Numbers k such that k^2 contains exactly 2 different digits, excluding 10^m, 2*10^m, 3*10^m.
%C No other terms below 3.16*10^20 (derived from A018884).
%D J.-M. De Koninck, Ces nombres qui nous fascinent, Entry 109, p. 38, Ellipses, Paris 2008.
%D R. K. Guy, Unsolved Problems in Number Theory, F24.
%H Michael Geißer, Theresa Körner, Sascha Kurz, and Anne Zahn, <a href="https://arxiv.org/abs/2112.00444">Squares with three digits</a>, arXiv:2112.00444 [math.NT], 2021.
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/SquareNumber.html">Square Number</a>.
%F A043537(a(n)) = 2. [_Reinhard Zumkeller_, Aug 05 2010]
%t Select[Range[100000],Length[DeleteCases[DigitCount[#^2],0]]==2 && !Divisible[ #,10]&] (* _Harvey P. Dale_, Aug 15 2013 *)
%t Reap[For[n = 4, n < 10^5, n++, id = IntegerDigits[n^2]; If[FreeQ[id, {_, 0 ...}], If[Length[Union[id]] == 2, Sow[n]]]]][[2, 1]] (* _Jean-François Alcover_, Sep 30 2016 *)
%o (Python)
%o from gmpy2 import is_square, isqrt
%o from itertools import combinations, product
%o A016070_list = []
%o for g in range(2,20):
%o ....n = 2**g-1
%o ....for x in combinations('0123456789',2):
%o ........if not x in [('0','1'), ('0','4'), ('0','9')]:
%o ............for i,y in enumerate(product(x,repeat=g)):
%o ................if i > 0 and i < n and y[0] != '0':
%o ....................z = int(''.join(y))
%o ....................if is_square(z):
%o ........................A016070_list.append(isqrt(z))
%o A016070_list = sorted(A016070_list) # _Chai Wah Wu_, Nov 03 2014
%Y Cf. A016069, A043537, A018884, A018885.
%K nonn,nice,base,more,hard
%O 1,1
%A _Robert G. Wilson v_