OFFSET
1,1
EXAMPLE
a(2)=60 because 60 is the minimal 2-digit number which can be the length of a side of an integer-sided right triangle in 14 distinct ways, (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), (60, 899, 901), and 14 is the maximum number of such ways for a 2-digit number.
PROG
(Python)
from sympy import factorint
def s(n):
f=factorint(n)
d, q=(list(f.keys()), list(f.values()))
(a, b, c, x)=(0, 1, 1, 0)
if(d[0]==2):
a, x=(0, 1)
if q[0]>1:
a=q[0]-1
for p in range(x, len(d)):
b*=(1+2*q[p])
if d[p]%4==1:
c*=(1+2*q[p])
return((b-1)//2+a*b+(c-1)//2)
def a(n):
max=0
for i in range(1+10**(n-1), 10**n):
if s(i)>max:
k, max=(i, s(i))
return(n, [k, max])
for i in range(1, 6):
print (a(i))
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Zhining Yang, Jun 26 2022
STATUS
approved