login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A359735
Let f(s,n) = 2^n + s*n, with s in {-1, 1}. Let c be the number of primes out of the pair f(-1,n), f(1,n). If only f(-1,n) is prime, a(n) = -1, otherwise a(n) = c.
0
0, 1, -1, 2, 0, 1, 0, 0, 0, 2, 0, 0, 0, -1, 0, 1, 0, 0, 0, -1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
OFFSET
0,4
FORMULA
a(n) can be = 2 only if n = 6*m + 3 for m >= 0 and m is not congruent to {0, 4} mod 5, not congruent to {2, 4} mod 7, not congruent to {6, 7} mod 11 and not congruent to {3, 9} mod 13. Does a(n) = 2 for n > 9 exist? - Thomas Scheuerle, Jan 12 2023
EXAMPLE
f(-1,1) = 2^1 - 1 = 1, is not prime and f(1,1) = 2^1 + 1 = 3 is prime, so a(1) = 1.
f(-1,2) = 2^2 - 2 = 2, is prime and f(1,2) = 2^2 + 2 = 6 = 2 * 3 is not prime, so a(2) = -1.
f(-1,3) = 2^3 - 3 = 5, is prime and f(1,3) = 2^3 + 3 = 11 is prime, so a(3) = 2.
PROG
(PARI) f(s, n)=2^n+s*n
a(n)=my(a=isprime(f(-1, n)), b=isprime(f(1, n)), c=a+b); if(c==1&&a==1, return(-1), return(c))
CROSSREFS
KEYWORD
sign
AUTHOR
Jean-Marc Rebert, Jan 12 2023
STATUS
approved