A058411 Numbers k such that k^2 contains only digits {0,1,2}, not ending with zero.
1, 11, 101, 149, 1001, 1011, 1101, 10001, 10011, 11001, 14499, 100001, 100011, 100101, 101001, 110001, 316261, 1000001, 1000011, 1000101, 1010001, 1010011, 1100001, 1100101, 10000001, 10000011, 10000101, 10001001, 10001011, 10001101, 10010001, 10100001, 10100011, 10110001
Offset: 1
Links
- Zhao Hui Du, Table of n, a(n) for n = 1..4000 (first 1000 terms from Chai Wah Wu; 1001..1269 from M. F. Hasler)
- Patrick De Geest, Index to related sequences.
- Hisanori Mishima, Sporadic tridigital solutions.
- OEIS Wiki, Index to sequences related to squares having only given digits.
Crossrefs
Programs
-
Magma
[n: n in [1..2*10^8 by 2] | Set(Intseq(n^2)) subset [0,1,2]]; // Vincenzo Librandi, Feb 24 2016
-
Maple
R[1]:= {1,9}; for m from 2 to 10 do R[m]:= select(t -> max(convert(t^2 mod 10^m, base, 10)) <= 2, map(s -> seq(s + i*10^(m-1),i=0..9), R[m-1])) od: Res:= {seq(op(select(t -> t >= 10^(m-1) and max(convert(t^2,base,10)) <= 2, R[m])),m=1..10)}: sort(convert(Res,list)); # Robert Israel, Feb 23 2016
-
Mathematica
Select[Range[10^6], And[Total@ Take[RotateRight@ DigitCount@ #, -7] == 0, Mod[#, 10] != 0] &[#^2] &] (* Michael De Vlieger, Nov 14 2017 *)
-
PARI
isok(n)={ n%10 && vecmax(digits(n^2)) < 3 } \\ Michel Marcus, Feb 24 2016, edited by M. F. Hasler, Nov 14 2017
-
Python
A058411_list = [i for i in range(10**6) if i % 10 and max(str(i**2)) < '3'] # Chai Wah Wu, Feb 23 2016
Formula
a(n) = sqrt(A058412(n)). - Zak Seidov, Jul 01 2013
Extensions
b-file corrected by Zhao Hui Du, Mar 07 2024
Comments