[go: up one dir, main page]

login
Numbers that are the sum of 5 distinct nonzero squares.
9

%I #27 Oct 26 2023 00:12:36

%S 55,66,75,79,82,87,88,90,94,95,99,100,103,106,110,111,114,115,118,120,

%T 121,123,126,127,129,130,131,132,134,135,138,139,142,143,144,145,146,

%U 147,148,150,151,152,154,155,156,157,158,159,160,162,163

%N Numbers that are the sum of 5 distinct nonzero squares.

%H Reinhard Zumkeller, <a href="/A004434/b004434.txt">Table of n, a(n) for n = 1..1000</a>

%H Paul T. Bateman, Adolf J. Hildebrand, and George B. Purdy, <a href="http://matwbn.icm.edu.pl/ksiazki/aa/aa67/aa6745.pdf">Sums of distinct squares</a>, Acta Arithmetica 67 (1994), pp. 349-380.

%H Franz Halter-Koch, <a href="http://matwbn.icm.edu.pl/ksiazki/aa/aa42/aa4212.pdf">Darstellung natürlicher Zahlen als Summe von Quadraten</a>, Acta Arithmetica 42 (1982), pp. 11-20.

%H <a href="/index/Su#ssq">Index entries for sequences related to sums of squares</a>

%H <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (2,-1).

%F a(n) = n + 124 for n > 121. [_Charles R Greathouse IV_, Jul 17 2011]

%o (PARI) upto(lim)=my(v=List(), tb, tc, td, te); for(a=5, sqrt(lim), for(b=4, min(a-1, sqrt(lim-a^2)), tb=a^2+b^2; for(c=3, min(b-1, sqrt(lim-tb)), tc=tb+c^2; for(d=2, min(c-1, sqrt(lim-tc)), td=tc+d^2; for(e=1, d-1, te=td+e^2; if(te>lim, break,listput(v, te))))))); vecsort(Vec(v), , 8) \\ _Charles R Greathouse IV_, Jul 17 2011

%o (Haskell)

%o a004434 n = a004434_list !! (n-1)

%o a004434_list = filter (p 5 $ tail a000290_list) [1..] where

%o p k (q:qs) m = k == 0 && m == 0 ||

%o q <= m && k >= 0 && (p (k - 1) qs (m - q) || p k qs m)

%o -- _Reinhard Zumkeller_, Apr 22 2013

%Y Cf. A003995, A004431, A004432, A004433, A224981, A224982, A224983, A000290.

%K nonn,easy

%O 1,1

%A _N. J. A. Sloane_