login
A334143
a(n) = bitwise NOR of prime(n) and prime(n+1).
2
0, 0, 0, 0, 0, 2, 12, 8, 0, 0, 0, 18, 20, 16, 0, 0, 0, 0, 56, 48, 48, 32, 36, 6, 26, 24, 16, 16, 2, 0, 0, 116, 116, 96, 104, 96, 64, 88, 80, 64, 72, 64, 0, 58, 56, 40, 32, 0, 24, 18, 16, 0, 4, 4, 248, 240, 240, 224, 226, 228, 192, 200, 200, 192, 194, 128, 164
OFFSET
1,6
LINKS
FORMULA
a(n) = A035327(A175329(n)).
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