login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A366940 a(n) is the number of positive squares with n digits, all distinct. 0
3, 6, 13, 36, 66, 96, 123, 97, 83, 87, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
a(n) = 0, for n > 10.
LINKS
EXAMPLE
a(1)=3 because all three 1-digit squares, 1, 4, and 9, have trivially distinct digits.
a(2)=6 because all six 2-digit squares, 16, 25, 36, 49, 64, and 81, have distinct digits.
158407396 = 12586^2: has 9 distinct digits. Thus, this number contributes to a(9). On the other hand, 158382225 = 12585^2 has repeated digits. Thus, it doesn't contribute.
MATHEMATICA
Table[Length[Select[Range[100000], Length[Union[IntegerDigits[#^2]]] == k && Length[IntegerDigits[#^2]] == k &]], {k, 10}]
PROG
(Python)
from math import isqrt
from itertools import permutations
def sqr(n): return isqrt(n)**2 == n
def a(n):
if n > 10: return 0
return sum(1 for p in permutations("0123456789", n) if p[0] != '0' and sqr(int("".join(p))))
print([a(n) for n in range(1, 31)]) # Michael S. Branicky, Oct 29 2023
CROSSREFS
Sequence in context: A104448 A352864 A062466 * A053564 A264236 A216999
KEYWORD
nonn,base,easy
AUTHOR
Tanya Khovanova, Oct 29 2023
STATUS
approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 1 05:31 EDT 2024. Contains 372148 sequences. (Running on oeis4.)