OFFSET
1,6
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..10000
Wikipedia, Bitwise operation
EXAMPLE
a(6) = prime(6) NOR prime(7) = 13 NOR 17 = 2.
MAPLE
a:= n-> Bits[Nor](ithprime(n), ithprime(n+1)):
seq(a(n), n=1..70); # Alois P. Heinz, Apr 15 2020
MATHEMATICA
A334143[n_]:=With[{b=BitOr[Prime[n], Prime[n+1]]}, 2^BitLength[b]-b-1]; Array[A334143, 100] (* Paolo Xausa, Oct 13 2023 *)
PROG
(Python)
def NORprime(n):
s = str(bin(primes[n]))[2:]
t = str(bin(primes[n-1]))[2:]
k = (len(s) - len(t))
t = k*'0' + t
r = ''
for i in range(len(s)):
if s[i] == t[i] and s[i] == '0':
r += '1'
else:
r += '0'
return int(r, 2)
(PARI) a(n) = my(x=bitor(prime(n), prime(n+1))); bitneg(x, #binary(x)); \\ Michel Marcus, Apr 16 2020
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Christoph Schreier, Apr 15 2020
STATUS
approved