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.
%I A354048 #36 Mar 22 2025 19:02:46 %S A354048 2,14,68,203,476,1421,3293,7910,20060,39509,89324,206711,442907, %T A354048 803924,1722464,3198608,6820523,13434254,27901259,50222267 %N A354048 a(n) is the largest number of distinct integer-sided right triangles in which some n-digit number can appear as the length of a side. %H A354048 Zhihu, <a href="https://www.zhihu.com/question/531237744">For integers from 1 to 100, which one can compose the most Pythagorean triangle?</a> %e A354048 a(2)=14 because there exist 14 distinct integer-sided right triangles with the 2-digit number 60 as the length of a side, i.e., (11,60,61), (25,60,65), (32,60,68), (36,48,60), (45,60,75), (60,63,87), (60,80,100), (60,91,109), (60,144,156), (60,175,185), (60,221,229), (60,297,303), (60,448,452), and (60,899,901), and no 2-digit number is the length of a side of more than 14 distinct integer-sided right triangles. %o A354048 (Python) %o A354048 from sympy import factorint %o A354048 def s(n): %o A354048 f=factorint(n) %o A354048 d, q=(list(f.keys()), list(f.values())) %o A354048 (a, b, c, x)=(0, 1, 1, 0) %o A354048 if(d[0]==2): %o A354048 a, x=(0, 1) %o A354048 if q[0]>1: %o A354048 a=q[0]-1 %o A354048 for p in range(x, len(d)): %o A354048 b*=(1+2*q[p]) %o A354048 if d[p]%4==1: %o A354048 c*=(1+2*q[p]) %o A354048 return((b-1)//2+a*b+(c-1)//2) %o A354048 def a(n): %o A354048 max=0 %o A354048 for i in range(1+10**(n-1), 10**n): %o A354048 if s(i)>max: %o A354048 k,max=(i,s(i)) %o A354048 return(n,[k,max]) %o A354048 for i in range(1,6): %o A354048 print (a(i)) %o A354048 # (thanks to _Zhao Hui Du_ for help in the derivation of this function) %Y A354048 Cf. A046081, A269929, A353875. %K A354048 nonn,more %O A354048 1,1 %A A354048 _Zhining Yang_, Jun 26 2022