login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A016069 Numbers n such that n^2 contains exactly 2 different digits. 16
4, 5, 6, 7, 8, 9, 10, 11, 12, 15, 20, 21, 22, 26, 30, 38, 88, 100, 109, 173, 200, 212, 235, 264, 300, 1000, 2000, 3000, 3114, 10000, 20000, 30000, 81619, 100000, 200000, 300000, 1000000, 2000000, 3000000, 10000000, 20000000 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

REFERENCES

R. K. Guy, Unsolved Problems in Number Theory, F24.

LINKS

Robert G. Wilson v, Table of n, a(n) for n = 1..81

Eric Weisstein's World of Mathematics, Square Number

EXAMPLE

26 is in the sequence because 26^2 = 676 contains exactly 2 different digits.

MATHEMATICA

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 *)

PROG

(Haskell)

import Data.List (nub)

a016069 n = a016069_list !! (n-1)

a016069_list = filter ((== 2) . length . nub . show . (^ 2)) [0..]

-- Reinhard Zumkeller, Apr 14 2011

(PARI) /* needs version >= 2.6 */

for (n=1, 10^9, if ( #Set(digits(n^2))==2, print1(n, ", ") ) );

/* Joerg Arndt, Mar 09 2013 */

(Python)

from gmpy2 import is_square, isqrt

from itertools import combinations, product

A016069_list = []

for g in range(2, 20):

....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(isqrt(z))

A016069_list = sorted(A016069_list) # Chai Wah Wu, Nov 03 2014

(MAGMA) [n: n in [0..20000000] | #Set(Intseq(n^2)) eq 2]; // Vincenzo Librandi, Nov 04 2014

CROSSREFS

Cf. A016070, A018884, A018885.

Sequence in context: A037357 A191842 A039174 * A194283 A039128 A214421

Adjacent sequences:  A016066 A016067 A016068 * A016070 A016071 A016072

KEYWORD

nonn,base,nice

AUTHOR

Robert G. Wilson v

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy .

Last modified September 24 04:27 EDT 2017. Contains 292403 sequences.