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.

A366940 a(n) is the number of positive squares with n digits, all distinct.

This page as a plain text file.
%I A366940 #20 Dec 31 2023 00:21:01
%S A366940 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,
%T A366940 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,
%U A366940 0,0,0,0,0,0
%N A366940 a(n) is the number of positive squares with n digits, all distinct.
%C A366940 a(n) = 0, for n > 10.
%H A366940 <a href="/index/Rec#order_01">Index entries for linear recurrences with constant coefficients</a>, signature (1).
%e A366940 a(1)=3 because all three 1-digit squares, 1, 4, and 9, have trivially distinct digits.
%e A366940 a(2)=6 because all six 2-digit squares, 16, 25, 36, 49, 64, and 81, have distinct digits.
%e A366940 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.
%t A366940 Table[Length[Select[Range[100000], Length[Union[IntegerDigits[#^2]]] == k &&  Length[IntegerDigits[#^2]] == k &]], {k, 10}]
%o A366940 (Python)
%o A366940 from math import isqrt
%o A366940 from itertools import permutations
%o A366940 def sqr(n): return isqrt(n)**2 == n
%o A366940 def a(n):
%o A366940     if n > 10: return 0
%o A366940     return sum(1 for p in permutations("0123456789", n) if p[0] != '0' and sqr(int("".join(p))))
%o A366940 print([a(n) for n in range(1, 31)]) # _Michael S. Branicky_, Oct 29 2023
%Y A366940 Cf. A000290, A045540, A049415, A073532, A078255.
%K A366940 nonn,base,easy
%O A366940 1,1
%A A366940 _Tanya Khovanova_, Oct 29 2023