cp's OEIS Frontend

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.

A316490 Smallest positive number of the form 8*k + 4 that can be expressed as the sum of four distinct odd squares in exactly n ways, or 0 if no such number exists.

This page as a plain text file.
%I A316490 #21 Nov 28 2020 13:00:04
%S A316490 4,84,156,260,380,596,420,588,732,884,660,876,900,1164,924,1236,1140,
%T A316490 1452,1428,1524,1380,1260,1620,2060,1596,1764,1740,2196,2364,2628,
%U A316490 1980,3236,2244,2676,2220,2100,2460,3916,2844,2916,2580,2340,2700,4532,3396,4300
%N A316490 Smallest positive number of the form 8*k + 4 that can be expressed as the sum of four distinct odd squares in exactly n ways, or 0 if no such number exists.
%C A316490 Every odd square is a number of the form 8*k + 1, so every sum of four odd squares is a number of the form 8*k + 4.
%C A316490 A316489 lists all positive numbers of the form 8*k + 4 that cannot be expressed as the sum of four distinct odd squares.
%C A316490 A316834 lists all numbers that can be expressed in only one way as the sum of four distinct odd squares.
%C A316490 If a(571) > 0 then a(571) > 4*10^6. For 48 values of 0 <= n <= 9999 a(n) = 0 or at least 4*10^6. - _David A. Corneth_, Nov 28 2020
%H A316490 David A. Corneth, <a href="/A316490/b316490.txt">Table of n, a(n) for n = 0..570</a> (first 501 terms from Alois P. Heinz)
%H A316490 David A. Corneth, <a href="/A316490/a316490.gp.txt">a(0)..a(9999) for values <= 4*10^6</a>
%e A316490 The smallest positive number of the form 8*k + 4 is 4, which cannot be expressed as the sum of four distinct odd squares, so a(0) = 4.
%e A316490 The smallest number that can be expressed as the sum of four distinct odd squares is the sum of the first four odd squares, i.e., 1^2 + 3^2 + 5^2 + 7^2 = 84, which cannot be so expressed in any other way, so a(1) = 84.
%e A316490 a(6) = 420 because 420 is the smallest number that can be expressed as the sum of four distinct odd squares in exactly 6 ways:
%e A316490   420 =  1^2 +  3^2 +  7^2 + 19^2
%e A316490       =  1^2 +  3^2 + 11^2 + 17^2
%e A316490       =  1^2 +  5^2 + 13^2 + 15^2
%e A316490       =  1^2 +  7^2 +  9^2 + 17^2
%e A316490       =  5^2 +  7^2 + 11^2 + 15^2
%e A316490       =  7^2 +  9^2 + 11^2 + 13^2.
%e A316490 (Sums such as 3^2 + 5^2 + 5^2 + 19^2 are not counted because the four odd squares are not all distinct.)
%p A316490 b:= proc(n, i, t) option remember; `if`(n=0, `if`(t=0, 1, 0),
%p A316490       `if`(min(i, t)<1, 0, b(n, i-2, t)+
%p A316490       `if`(i^2>n, 0, b(n-i^2, i-2, t-1))))
%p A316490     end:
%p A316490 a:= proc(n) option remember; local k;
%p A316490       for k from 4 by 8 while n <> b(k, (r->
%p A316490       r+1-irem(r, 2))(isqrt(k)), 4) do od; k
%p A316490     end:
%p A316490 seq(a(n), n=0..50);  # _Alois P. Heinz_, Aug 07 2018
%t A316490 b[n_, i_, t_] := b[n, i, t] = If[n == 0, If[t == 0, 1, 0], If[Min[i, t] < 1, 0, b[n, i - 2, t] + If[i^2 > n, 0, b[n - i^2, i - 2, t - 1]]]];
%t A316490 a[n_] := a[n] = Module[{k}, For[k = 4, n != b[k, # + 1 - Mod[#, 2]& @ Floor @ Sqrt[k], 4], k += 8]; k];
%t A316490 a /@ Range[0, 50] (* _Jean-François Alcover_, Nov 27 2020, after _Alois P. Heinz_ *)
%Y A316490 Cf. A316489 (0 ways), A316834 (1 way).
%K A316490 nonn
%O A316490 0,1
%A A316490 _Jon E. Schoenfield_, Jul 28 2018