OFFSET
1,1
EXAMPLE
a(2) = 221 because 221 = 5^2 + 14^2 = 10^2 + 11^2.
MATHEMATICA
nR[n_] := (SquaresR[2, n] + Plus @@ Pick[{-4, 4}, IntegerQ /@ Sqrt[{n, n/2}]])/8; qn[w_] := Block[{z = Floor[(1/2) Times @@ (w + 1)]}, If[And @@ (EvenQ /@ w), z + {0, 1}, {z}]]; ric[w_, t_] := Block[{u = qn[w]}, If[ MemberQ[u, t], Sow@w]; If[ Min[u] < t, ric[Append[w, 1], t]; u = w; u[[-1]]++; If[Length[u] == 1 || u[[-1]] <= u[[-2]], ric[u, t]]]]; val[w_] := {1, 2} Times @@ (Take[{13, 17, 29, 37, 41, 53}, Length@w]^w); a[1] =2; a[n_] := Min@ Select[ Flatten[ val /@ Reap[ric[{1}, n]][[2, 1]]], nR[#] == n &]; Array[a, 25] (* Giovanni Resta, Jun 27 2016 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Altug Alkan, Jun 24 2016
EXTENSIONS
a(7)-a(25) from Giovanni Resta, Jun 27 2016
STATUS
approved