A014716 Incomplete version of A016070.
38, 88, 109, 173, 212, 235, 3114
Offset: 0
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.
import Data.List (nub) a043537 = length . nub . show -- Reinhard Zumkeller, Apr 16 2011
A043537 := proc(n) convert(convert(n,base,10),set) ; nops(%) ; end proc: # R. J. Mathar, Dec 22 2012
Count[DigitCount@ #, n_ /; n > 0] & /@ Range@ 120 (* Michael De Vlieger, Aug 29 2015 *)
a(n)=#vecsort(digits(n),,8) \\ Charles R Greathouse IV, Oct 02 2013
def A043537(n): return len(set(str(n))) # Dimiter Skordev, Oct 02 2021
26 is in the sequence because 26^2 = 676 contains exactly 2 distinct digits.
import Data.List (nub) a016069 n = a016069_list !! (n-1) a016069_list = filter ((== 2) . length . nub . show . (^ 2)) [0..] -- Reinhard Zumkeller, Apr 14 2011
[n: n in [0..20000000] | #Set(Intseq(n^2)) eq 2]; // Vincenzo Librandi, Nov 04 2014
Join[Select[Range[90000],Count[DigitCount[#^2],?(#!=0&)]==2&],Flatten[ NestList[ 10#&,{100000,200000,300000},5]]] (* _Harvey P. Dale, Mar 09 2013 *) Select[Range[20000000], Length[Union[IntegerDigits[#^2]]]==2&] (* Vincenzo Librandi, Nov 04 2014 *)
/* needs version >= 2.6 */ for (n=1, 10^9, if ( #Set(digits(n^2))==2, print1(n,", ") ) ); /* Joerg Arndt, Mar 09 2013 */
from gmpy2 import is_square, isqrt from itertools import combinations, product A016069_list = [] for g in range(2,10): n = 2**g-1 for x in combinations('0123456789',2): for i,y in enumerate(product(x,repeat=g)): if i > 0 and i < n and y[0] != '0': z = int(''.join(y)) if is_square(z): A016069_list.append(int(isqrt(z))) A016069_list = sorted(A016069_list) # Chai Wah Wu, Nov 03 2014
F:= proc(r, a, b, m) # get all squares starting with r, with at most m further digits, all from {a,b} where a < b local res,Ls,Us,L,U,looking; if issqr(r) then res:= r else res:= NULL fi; if m = 0 then return res fi; Ls:= r*10^m + a*(10^m-1)/9; Us:= r*10^m + b*(10^m-1)/9; L:= isqrt(Ls); if L^2 > Ls then L:= L-1 fi; U:= isqrt(Us); if U^2 < Us then U:= U+1 fi; if L > U then res else res, procname(10*r+a,a,b,m-1), procname(10*r+b,a,b,m-1) fi end proc: S2:= {seq(i^2 mod 100, i=0..99)}: prs:= map(t -> `if`(t < 10, {0,t},{(t mod 10),(t - (t mod 10))/10}), S2): prs:= map(p -> `if`(nops(p)=1, seq(p union {s},s={$0..9} minus p), p), prs): Res:= NULL: for p in prs do a:= min(p); b:= max(p); if a > 0 then Res:= Res, F(a,a,b,14); fi; Res:= Res, F(b,a,b,14); od: sort(convert({0,Res},list)); # Robert Israel, Dec 03 2015
Select[Range[0, 10^5]^2, Length@ Union@ IntegerDigits@ # <= 2 &] (* Michael De Vlieger, Dec 03 2015 *) Select[Range[0,100000]^2,Count[DigitCount[#],0]>7&] (* Harvey P. Dale, Jul 25 2020 *)
for (n=0, 10^6, if ( #Set(digits(n^2))<=2, print1(n^2, ", ") ) ); \\ Michel Marcus, May 21 2015
Flatten[Table[Select[Flatten[Table[FromDigits/@Tuples[{a,b},n],{n,10}]], IntegerQ[ Sqrt[#]]&],{a,9},{b,9}]]//Union (* Harvey P. Dale, Sep 21 2018 *)
Comments