login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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, 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 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,5

COMMENTS

A less natural variant of A051034, which counts the minimal number of primes that add up to n. The Goldbach conjecture implies that a(n) is nonzero for all n > 1.

The original definition was: "a(n) = -1 iff n is a prime, a(n) = 1 iff n is equal to the sum of three primes, a(n) = 2 iff n is equal to the sum of two primes, else a(n) = 0." However, the "iff"s do not make sense since all conditions can hold simultaneously. a(9) = 0 was obviously erroneous. More of the original data requires correction if "odd" is omitted in the second and/or added in the third condition, or if the conditions are tested in a different order.

LINKS

Table of n, a(n) for n=0..100.

EXAMPLE

a(9) = 1 because 9 is not a prime but it is the sum of three odd primes, 9 = 3 + 3 + 3.

PROG

(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}

CROSSREFS

Cf. A051034.

Sequence in context: A228826 A288699 A168361 * A000034 A040001 A134451

Adjacent sequences:  A107390 A107391 A107392 * A107394 A107395 A107396

KEYWORD

sign,less

AUTHOR

Giovanni Teofilatto, May 25 2005

EXTENSIONS

Edited, definition and a(9) corrected (following discussion and observations from several other Editors) by M. F. Hasler, Jan 08 2018

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy .

Last modified February 23 17:39 EST 2018. Contains 299584 sequences. (Running on oeis4.)