login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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 (list; graph; refs; listen; history; text; internal format)
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
Sequence in context: A284345 A347463 A337619 * A346009 A344756 A101221
KEYWORD
sign
AUTHOR
Dmitry Kamenetsky, Jan 01 2011
EXTENSIONS
a(0) added by David W. Wilson, Sep 07 2016
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 2 12:34 EST 2024. Contains 370467 sequences. (Running on oeis4.)