login
A183214
Least number of squared primes that add up to n; -1 if impossible.
3
0, -1, -1, -1, 1, -1, -1, -1, 2, 1, -1, -1, 3, 2, -1, -1, 4, 3, 2, -1, 5, 4, 3, -1, 6, 1, 4, 3, 7, 2, 5, 4, 8, 3, 2, 5, 4, 4, 3, 6, 5, 5, 4, 3, 6, 5, 5, 4, 7, 1, 2, 5, 4, 2, 3, 6, 5, 3, 2, 3, 6, 4, 3, 4, 7, 5, 4, 3, 4, 6, 5, 4, 5, 7, 2, 3, 4, 5, 3, 4, 5, 6, 4, 3, 4, 5, 5, 4, 5, 6, 6, 5, 4, 5, 6, 6, 5, 6, 2, 3, 4, 5, 3, 4, 5, 6, 4, 3, 4, 5, 5, 4, 5, 6, 6, 5, 4, 5, 6, 6, 5, 1, 7, 3, 4, 2, 6, 4, 5, 3, 2, 5, 4, 4, 3, 6, 5, 5, 4, 3, 6, 5, 5, 4, 7, 6, 2, 3, 4, 5, 3, 4, 5, 6, 4, 3, 4, 5, 5, 4, 5, 6, 6, 5, 4, 5, 6, 6, 5, 1, 2, 3, 4, 2, 3, 4, 5, 3, 2, 3, 4, 4, 3, 4, 5, 5, 4, 3, 4, 5, 5, 4, 5, 6
OFFSET
0,9
COMMENTS
a(n)<=8 for n<10^9, with a(n)=8 for 3703393 values <=10^9.
Conjecturally, a(n)<=8 with a(n)=8 infinitely often.
a(n)>0 for n>23. This follows from n=4j+9k for j,k>=0.
If a(n)!=-1 then a(n)>=A002828(n). - David W. Wilson, Sep 07 2016
LINKS
EXAMPLE
a(17)=3 since 17=2^2+2^2+3^2. a(29)=2 since 29=2^2+5^2.
MATHEMATICA
Table[Min[Length /@ Select[Map[DeleteCases[#, k_ /; ! PrimeQ@ Sqrt@ k] &, IntegerPartitions@ n], Total@ # == n &] /. {} -> {-1}], {n, 0, 50}] (* Michael De Vlieger, Sep 08 2016 *)
CROSSREFS
KEYWORD
sign
AUTHOR
Dmitry Kamenetsky, Jan 01 2011
EXTENSIONS
a(0) added by David W. Wilson, Sep 07 2016
STATUS
approved