A107393 a(n) = -1 if n is a prime, else a(n) = 1 if n is the sum of three odd primes, else a(n) = 2 if n is the sum of two primes, else a(n) = 0.
0, 0, -1, -1, 2, -1, 2, -1, 2, 1, 2, -1, 2, -1, 2, 1, 2, -1, 2, -1, 2, 1, 2, -1, 2, 1, 2, 1, 2, -1, 2, -1, 2, 1, 2, 1, 2, -1, 2, 1, 2, -1, 2, -1, 2, 1, 2, -1, 2, 1, 2, 1, 2, -1, 2, 1, 2, 1, 2, -1, 2, -1, 2, 1, 2, 1, 2, -1, 2, 1, 2, -1, 2, -1, 2, 1, 2, 1, 2, -1, 2, 1, 2, -1, 2, 1, 2, 1, 2, -1, 2, 1, 2, 1, 2, 1, 2, -1, 2, 1, 2
Offset: 0
Examples
a(9) = 1 because 9 is not a prime but it is the sum of three odd primes, 9 = 3 + 3 + 3.
Links
- Antti Karttunen, Table of n, a(n) for n = 0..65537
Crossrefs
Cf. A051034.
Programs
-
PARI
a(n)={isprime(n)&&return(-1);forprime(p=3,n\3,forprime(q=p,(n-p)\2,isprime(n-p-q)&&return(1)));(n>1)*2}
Extensions
Edited, definition and a(9) corrected (following discussion and observations from several other Editors) by M. F. Hasler, Jan 08 2018
Comments