A166460 Numbers k such that k + (-1)^k is not prime.
0, 1, 5, 7, 8, 9, 11, 13, 14, 15, 17, 19, 20, 21, 23, 24, 25, 26, 27, 29, 31, 32, 33, 34, 35, 37, 38, 39, 41, 43, 44, 45, 47, 48, 49, 50, 51, 53, 54, 55, 56, 57, 59, 61, 62, 63, 64, 65, 67, 68, 69, 71, 73, 74, 75, 76, 77, 79, 80, 81, 83, 84, 85, 86, 87, 89, 90, 91, 92, 93, 94
Offset: 1
Examples
0 + (-1)^0 = 1 is not prime, which adds 0 to the sequence. 5 + (-1)^5 = 4 is not prime, which adds 5 to the sequence.
Links
- Michael De Vlieger, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
Select[Range[0, 94], ! PrimeQ[# + (-1)^#] &] (* Michael De Vlieger, Sep 08 2021 *)
-
Python
from sympy import composite def A166460(n): return composite(n-1)-1 if n>2 else n-1 # Chai Wah Wu, Aug 27 2024
Formula
a(n) = A002808(n-1)-1 for n>2. - Chai Wah Wu, Aug 27 2024
Extensions
0 added by R. J. Mathar, Oct 21 2009
Comments