OFFSET
1,3
LINKS
Peter Kagey, Table of n, a(n) for n = 1..10000
EXAMPLE
For n = 14, A001481(14) = 25 = 0^2 + 5^2 = 3^2 + 4^2, so a(14) = min{0+5, 3+4} = 5.
MAPLE
N:= 1000: # for terms where A001481(n)<=N
for s from 0 to isqrt(N) do
for i from 0 to s/2 do
t:= i^2 + (s-i)^2;
if t > N then break fi;
if not assigned(R[t]) then R[t]:= s fi;
od od:
A1481:= sort(map(op, [indices(R)])):
seq(R[i], i=A1481); # Robert Israel, Oct 28 2019
PROG
(Python)
from itertools import count, islice
from sympy.solvers.diophantine.diophantine import diop_DN
from sympy import factorint
def A328803_gen(): # generator of terms
return map(lambda n: min((a+b for a, b in diop_DN(-1, n))), filter(lambda n:(lambda m:all(d&3!=3 or m[d]&1==0 for d in m))(factorint(n)), count(0)))
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Peter Kagey, Oct 27 2019
STATUS
approved