cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A016070 Numbers k such that k^2 contains exactly 2 different digits, excluding 10^m, 2*10^m, 3*10^m.

This page as a plain text file.
%I A016070 #40 May 22 2025 10:19:12
%S A016070 4,5,6,7,8,9,11,12,15,21,22,26,38,88,109,173,212,235,264,3114,81619
%N A016070 Numbers k such that k^2 contains exactly 2 different digits, excluding 10^m, 2*10^m, 3*10^m.
%C A016070 No other terms below 3.16*10^20 (derived from A018884).
%D A016070 J.-M. De Koninck, Ces nombres qui nous fascinent, Entry 109, p. 38, Ellipses, Paris 2008.
%D A016070 R. K. Guy, Unsolved Problems in Number Theory, F24.
%H A016070 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 A016070 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/SquareNumber.html">Square Number</a>.
%F A016070 A043537(a(n)) = 2. [_Reinhard Zumkeller_, Aug 05 2010]
%t A016070 Select[Range[100000],Length[DeleteCases[DigitCount[#^2],0]]==2 && !Divisible[ #,10]&] (* _Harvey P. Dale_, Aug 15 2013 *)
%t A016070 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 A016070 (Python)
%o A016070 from gmpy2 import is_square, isqrt
%o A016070 from itertools import combinations, product
%o A016070 A016070_list = []
%o A016070 for g in range(2,20):
%o A016070     n = 2**g-1
%o A016070     for x in combinations('0123456789',2):
%o A016070         if not x in [('0','1'), ('0','4'), ('0','9')]:
%o A016070             for i,y in enumerate(product(x,repeat=g)):
%o A016070                 if i > 0 and i < n and y[0] != '0':
%o A016070                     z = int(''.join(y))
%o A016070                     if is_square(z):
%o A016070                         A016070_list.append(isqrt(z))
%o A016070 A016070_list = sorted(A016070_list) # _Chai Wah Wu_, Nov 03 2014
%Y A016070 Cf. A016069, A043537, A018884, A018885.
%K A016070 nonn,nice,base,more,hard
%O A016070 1,1
%A A016070 _Robert G. Wilson v_