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 A281229 #60 Aug 11 2025 01:13:30 %S A281229 1,2,5,10,13,26,29,34,41,58,61,74,89,106,113,146,149,194,181,202,233, %T A281229 274,269,386,313,346,389,394,421,458,521,514,557,586,613,698,709,794, %U A281229 761,802,853,914,929,1018,1013,1186,1109,1154,1201,1282,1301,1354,1409 %N A281229 Smallest number k of the form x^2 + y^2 with 0 <= x <= y such that gcd(x, y) = 1, x + y = n, and k has no other decompositions into a sum of two squares. %C A281229 Conjecture: for each n there exists such a number k. %C A281229 Note: a(2m+1) > 1 is a prime p and a(2m) > 2 is a double prime 2q, where p and q are primes == 1 (mod 4). %C A281229 For odd n > 1, a(n) is the smallest prime of the form x^2 + (n - x)^2. %C A281229 For even n > 2, a(n) is the smallest double prime of the above form. %H A281229 Robert Israel, <a href="/A281229/b281229.txt">Table of n, a(n) for n = 1..10000</a> %F A281229 For m > 0, a(2m+1) = A159351(m). %F A281229 For m > 1, a(2m) = 2 * A068486(m). %p A281229 f:= proc(n) local k,v; %p A281229 for k from ceil(n/2) to n do %p A281229 v:= k^2+(n-k)^2; %p A281229 if n::odd then if isprime(v) then return v fi %p A281229 elif isprime(v/2) then return v %p A281229 fi %p A281229 od; %p A281229 FAIL %p A281229 end proc: %p A281229 f(1):=1: f(2):= 2: %p A281229 map(f, [$1..100]); # _Robert Israel_, Dec 30 2020 %o A281229 (PARI) isok(k, n) = {nba = 0; nbb = 0; for (x=0, k, if (issquare(x) && issquare(k-x), if (x <= k - x, nba++; if (nba > 1, return (0)); rx = sqrtint(x); ry = sqrtint(k-x); if ((gcd(rx,ry)==1) && (rx+ry == n), nbb++;);););); if (nbb, return (k), return(0));} %o A281229 a(n) = {k = 1; while (! (s = isok(k, n)), k++; ); s;} \\ _Michel Marcus_, Jan 20 2017 %Y A281229 Cf. A002144, A068486, A159351. %K A281229 nonn %O A281229 1,2 %A A281229 _Thomas Ordowski_, Jan 18 2017 %E A281229 More terms from _Altug Alkan_, Jan 18 2017 %E A281229 More terms from _Jon E. Schoenfield_, Jan 18 2017