# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/ Search: id:a328803 Showing 1-1 of 1 %I A328803 #21 Sep 09 2022 11:07:26 %S A328803 0,1,2,2,3,4,3,4,5,4,5,6,6,5,6,7,8,8,6,7,8,9,9,7,8,10,9,10,11,8,9,10, %T A328803 12,11,12,12,9,10,11,13,12,13,14,10,11,12,14,13,15,14,15,11,12,13,16, %U A328803 14,16,15,12,13,16,14,17,15,17,16,18,18,13,14,15,16 %N A328803 The minimum value of j + k where j and k are positive integers with j^2 + k^2 = A001481(n). %H A328803 Peter Kagey, Table of n, a(n) for n = 1..10000 %e A328803 For n = 14, A001481(14) = 25 = 0^2 + 5^2 = 3^2 + 4^2, so a(14) = min{0+5, 3+4} = 5. %p A328803 N:= 1000: # for terms where A001481(n)<=N %p A328803 for s from 0 to isqrt(N) do %p A328803 for i from 0 to s/2 do %p A328803 t:= i^2 + (s-i)^2; %p A328803 if t > N then break fi; %p A328803 if not assigned(R[t]) then R[t]:= s fi; %p A328803 od od: %p A328803 A1481:= sort(map(op, [indices(R)])): %p A328803 seq(R[i],i=A1481); # _Robert Israel_, Oct 28 2019 %o A328803 (Python) %o A328803 from itertools import count, islice %o A328803 from sympy.solvers.diophantine.diophantine import diop_DN %o A328803 from sympy import factorint %o A328803 def A328803_gen(): # generator of terms %o A328803 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))) %o A328803 A328803_list = list(islice(A328803_gen(),30)) # _Chai Wah Wu_, Sep 09 2022 %Y A328803 Cf. A000161, A001481. %K A328803 nonn,look %O A328803 1,3 %A A328803 _Peter Kagey_, Oct 27 2019 # Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE