A323015 a(n) is the number of unordered partitions of 24*n + 4 into four squares of primes (A001248).
0, 0, 0, 0, 1, 1, 1, 1, 2, 1, 2, 2, 2, 2, 2, 2, 4, 3, 4, 3, 4, 4, 4, 4, 4, 3, 6, 5, 5, 4, 5, 6, 4, 6, 5, 2, 6, 6, 6, 5, 5, 7, 3, 7, 8, 3, 8, 7, 6, 6, 7, 9, 5, 6, 9, 4, 7, 7, 6, 7, 7, 10, 4, 5, 10, 5, 9, 7, 6, 7, 4, 10, 8, 6, 10, 5, 9, 7, 8, 10, 6, 11, 10, 8, 11
Offset: 0
Keywords
Examples
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. ...
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..65536
Crossrefs
See A323016 for the ordered version.
Programs
-
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 *)
-
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)
Comments