OFFSET

0,9

COMMENTS

Also, a(n) is the number of unordered partitions of n into four terms of A024702.

a(n) > 0 for 4 <= n <= 2*10^4. Conjecture: a(n) > 0 for all n >= 4. A stronger conjecture: lim inf a(n) = +oo.

This is a quadratic analog of Goldbach's conjecture, asking for the smallest k such that any sufficiently large number congruent to k modulo 24 can be written as the sum of k squares of primes. k = 1 is trivially false. Let n = 49*t + 2 (t > 0), then 24*n + 2 = 24*49*t + 98, which is a multiple of 7^2. If p^2 + q^2 = 24*n + 2, since the squares of primes other than 7 are congruent to 1, 2, 4 modulo 7, we must have p = q = 7, but p^2 + q^2 < n. So k = 2 is false. Let n = 245*t + 103, then 24*n + 3 = 24*245*t + 2475, which is a multiple of 5. If p^2 + q^2 + r^2 = 24*n + 3, since the squares of primes other than 5 are congruent to 1, 4 modulo 5, we must have that at least one of p, q, r is 5. Suppose that p = 5, then q^2 + r^2 = 24*245*t + 2450, which is a multiple of 7^2. As is shown above, q = r = 7, but p^2 + q^2 + r^2 < n. So k = 3 is also false. On the other hand, if the case k = 4 is true, then all the cases k >= 4 are trivially true, because we can add as many 5^2 as needed. So the case k = 4 is the most interesting.

LINKS

Alois P. Heinz, Table of n, a(n) for n = 0..65536

EXAMPLE

100 = 5^2 + 5^2 + 5^2 + 5^2.

124 = 5^2 + 5^2 + 5^2 + 7^2.

148 = 5^2 + 5^2 + 7^2 + 7^2.

172 = 5^2 + 7^2 + 7^2 + 7^2.

196 = 7^2 + 7^2 + 7^2 + 7^2 = 5^2 + 5^2 + 5^2 + 11^2.

220 = 5^2 + 5^2 + 7^2 + 11^2.

244 = 5^2 + 7^2 + 7^2 + 11^2 = 5^2 + 5^2 + 5^2 + 13^2.

268 = 7^2 + 7^2 + 7^2 + 11^2 = 5^2 + 5^2 + 7^2 + 13^2.

...

MAPLE

h:= proc(n) option remember; `if`(n<1, 0, (t->

`if`((ithprime(t+2)^2-1)/24>n, t-1, t))(1+h(n-1)))

end:

b:= proc(n, i, c) option remember; `if`(n=0, `if`(c=0, 1, 0),

`if`(min(i, c)<1, 0, b(n, i-1, c)+(t-> b(n-t, min(i,

h(n-t)), c-1))((ithprime(i+2)^2-1)/24)))

end:

a:= n-> b(n, h(n), 4):

seq(a(n), n=0..120); # Alois P. Heinz, Jan 05 2019

MATHEMATICA

h[n_] := h[n] = If[n < 1, 0, Function[t, If[(Prime[t + 2]^2 - 1)/24 > n, t - 1, t]][1 + h[n - 1]]];

b[n_, i_, c_] := b[n, i, c] = If[n == 0, If[c == 0, 1, 0], If[Min[i, c] < 1, 0, b[n, i - 1, c] + Function[t, b[n - t, Min[i, h[n - t]], c - 1]][(Prime[i + 2]^2 - 1)/24]]];

a[n_] := b[n, h[n], 4];

a /@ Range[0, 120] (* Jean-François Alcover, Nov 22 2020, after Alois P. Heinz *)

PROG

(PARI) a(n) = if(n<4, 0, my(i=0, k=sqrt(24*n-71)); forprime(p=5, k, forprime(q=p, k, forprime(r=q, k, forprime(s=r, k, if(p^2+q^2+r^2+s^2==24*n+4, i++))))); i)

CROSSREFS

KEYWORD

nonn

AUTHOR

Jianing Song, Jan 05 2019

STATUS

approved