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 A025357 #34 Feb 16 2025 08:32:35 %S A025357 4,7,10,12,13,15,16,18,19,20,21,22,23,25,26,27,30,33,35,38,40,44,46, %T A025357 48,51,53,59,62,64,65,72,80,88,89,101,104,120,152,160,176,184,192,248, %U A025357 256,288,320,352,416,480,608,640,704,736,768,992,1024,1152,1280,1408,1664 %N A025357 Numbers that are the sum of 4 nonzero squares in exactly 1 way. %H A025357 Michael S. Branicky, <a href="/A025357/b025357.txt">Table of n, a(n) for n = 1..138</a> (terms 1..95 from Robert Price) %H A025357 Michael S. Branicky, <a href="/A025357/a025357.py.txt">Python program</a> %H A025357 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/SquareNumber.html">Square Number.</a> %H A025357 <a href="/index/Su#ssq">Index entries for sequences related to sums of squares</a> %F A025357 {n: A025428(n) = 1}. - _R. J. Mathar_, Jun 15 2018 %F A025357 A243148(a(n),4) = 1. - _Alois P. Heinz_, Feb 25 2019 %t A025357 selQ[n_] := Length[ Select[ PowersRepresentations[n, 4, 2], Times @@ # != 0 &]] == 1; Reap[Do[If[selQ[n], Print[n]; Sow[n]], {n, 1, 2000}]][[2, 1]] (* _Jean-François Alcover_, Oct 03 2013 *) %t A025357 b[n_, i_, k_, t_] := b[n, i, k, t] = If[n == 0, If[t == 0, 1, 0], If[i<1 || t<1, 0, b[n, i - 1, k, t] + If[i^2 > n, 0, b[n - i^2, i, k, t - 1]]]]; %t A025357 T[n_, k_] := b[n, Sqrt[n] // Floor, k, k]; %t A025357 Position[Table[T[n, 4], {n, 0, 2000}], 1] - 1 // Flatten (* _Jean-François Alcover_, Nov 06 2020, after _Alois P. Heinz_ in A243148 *) %o A025357 (Python) # see link for faster version %o A025357 limit = 1664 %o A025357 from functools import lru_cache %o A025357 sq = [k*k for k in range(1, int(limit**.5)+2) if k*k + 3 <= limit] %o A025357 sqs = set(sq) %o A025357 @lru_cache(maxsize=None) %o A025357 def findsums(n, m): %o A025357 if m == 1: return {(n,)} if n in sqs else set() %o A025357 return set(tuple(sorted(t+(s, ))) for s in sq for t in findsums(n-s, m-1)) %o A025357 print([n for n in range(4, limit+1) if len(findsums(n, 4)) == 1]) # _Michael S. Branicky_, Apr 07 2021 %Y A025357 Cf. A025428, A243148. %K A025357 nonn %O A025357 1,1 %A A025357 _David W. Wilson_