# Finding Not-Quite-Prime Numbers

Your challenge, should you chose to accept it, is to code-golf a function that returns true or false (or some similar meaningful representation of yes and no) if a number meets the following criteria:

1. The integer itself is a prime number OR
2. Either of its neighbor integers are prime

For example:
An input of 7 would return True.
An input of 8 would also return True.
An input of 15 would return False. (Neither 14, 15, or 16 are prime)

The input must be able to return correctly for numbers between 2^0 and 2^20 inclusive, so there's no need to worry about sign issues or integer overflows.

• 32-bit number overflows, not buffer overflows, I guess. – user unknown Jan 14 '12 at 1:29
• Whoops, meant "integer overflow". Brain went on autopilot. – Mr. Llama Jan 16 '12 at 14:57

# APL(NARS) 13 chars, 26 bytes

{∨/0π⍵+¯1..1}


Here {0π⍵} is the function says if its argument it is a prime (return 1[true], else it return 0[false]), that function can have argument both one scalar integer or one list of integers as the above case... test:

  f←{∨/0π⍵+¯1..1}
f¨1 2 7 8 14 15 16 (2*20)
1 1 1 1 1 0 1 0