cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A175330 a(n) = bitwise AND of prime(n) and prime(n+1).

This page as a plain text file.
%I A175330 #41 Oct 16 2023 02:49:28
%S A175330 2,1,5,3,9,1,17,19,21,29,5,33,41,43,37,49,57,1,67,65,73,67,81,65,97,
%T A175330 101,99,105,97,113,3,129,137,129,149,149,129,163,165,161,177,181,129,
%U A175330 193,197,195,211,195,225,225,233,225,241,1,257,261,269,261,273,281
%N A175330 a(n) = bitwise AND of prime(n) and prime(n+1).
%C A175330 Read each binary representation of the primes from right to left and then AND respective digits to form the binary equivalent of each term of this sequence.
%C A175330 Indices of 1's: 2, 6, 18, 54, 564, 3512, 6542, 564163, 2063689, 54400028, ... - _Alex Ratushnyak_, Apr 22 2012
%H A175330 Rémy Sigrist, <a href="/A175330/b175330.txt">Table of n, a(n) for n = 1..10000</a>
%H A175330 Wikipedia, <a href="https://en.wikipedia.org/wiki/Bitwise operation">Bitwise operation</a>
%e A175330 For n = 15, a(15) = 37 because the 15th prime is 47 and the 16th is 53, which have binary representations of 101111 and 110101 respectively; the bitwise AND of these values is 100101 which is the binary representation of 37:
%e A175330   101111
%e A175330 & 110101
%e A175330 --------
%e A175330   100101
%p A175330 read("transforms") ; A175330 := proc(n) ANDnos(ithprime(n),ithprime(n+1)) ; end proc: seq(A175330(n),n=1..60) ; # _R. J. Mathar_, Apr 15 2010
%p A175330 # second Maple program:
%p A175330 a:= n-> Bits[And](ithprime(n), ithprime(n+1)):
%p A175330 seq(a(n), n=1..70);  # _Alois P. Heinz_, Apr 15 2020
%t A175330 a[n_] := Prime[n]~BitAnd~Prime[n+1];
%t A175330 Array[a, 60] (* _Jean-François Alcover_, Jan 11 2021 *)
%o A175330 (PARI) a(n) = bitand(prime(n), prime(n+1)); \\ _Michel Marcus_, Apr 16 2020
%o A175330 (Scala) val prime: LazyList[Int] = 2 #:: LazyList.from(3).filter(i => prime.takeWhile {
%o A175330    j => j * j <= i
%o A175330 }.forall {
%o A175330    k => i % k != 0
%o A175330 })
%o A175330 (0 to 63).map(n => prime(n) & prime(n + 1)) // _Alonso del Arte_, Apr 18 2020
%Y A175330 Cf. A000040, A175329 (bitwise OR).
%Y A175330 Cf. A129760 (bitwise AND of n and n-1).
%Y A175330 Cf. A366550 (indices of ones).
%K A175330 base,nonn
%O A175330 1,1
%A A175330 _Leroy Quet_, Apr 07 2010
%E A175330 More terms from _R. J. Mathar_, Apr 15 2010