login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A175330 a(n) = bitwise AND of prime(n) and prime(n+1). 7
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, 101, 99, 105, 97, 113, 3, 129, 137, 129, 149, 149, 129, 163, 165, 161, 177, 181, 129, 193, 197, 195, 211, 195, 225, 225, 233, 225, 241, 1, 257, 261, 269, 261, 273, 281 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

COMMENTS

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.

Indices of 1's: 2, 6, 18, 54, 564, 3512, 6542, 564163, 2063689, 54400028, ... - Alex Ratushnyak, Apr 22 2012

LINKS

Table of n, a(n) for n=1..60.

Wikipedia, Bitwise operation

EXAMPLE

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:

  101111

& 110101

--------

  100101

MAPLE

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

# second Maple program:

a:= n-> Bits[And](ithprime(n), ithprime(n+1)):

seq(a(n), n=1..70);  # Alois P. Heinz, Apr 15 2020

MATHEMATICA

a[n_] := Prime[n]~BitAnd~Prime[n+1];

Array[a, 60] (* Jean-Fran├žois Alcover, Jan 11 2021 *)

PROG

(PARI) a(n) = bitand(prime(n), prime(n+1)); \\ Michel Marcus, Apr 16 2020

(Scala) val prime: LazyList[Int] = 2 #:: LazyList.from(3).filter(i => prime.takeWhile {

   j => j * j <= i

}.forall {

   k => i % k != 0

})

(0 to 63).map(n => prime(n) & prime(n + 1)) // Alonso del Arte, Apr 18 2020

CROSSREFS

Cf. A000040, A175329 (bitwise OR).

Cf. A129760 (bitwise AND of n and n-1).

Sequence in context: A082748 A342131 A327691 * A333259 A334172 A085261

Adjacent sequences:  A175327 A175328 A175329 * A175331 A175332 A175333

KEYWORD

base,nonn

AUTHOR

Leroy Quet, Apr 07 2010

EXTENSIONS

More terms from R. J. Mathar, Apr 15 2010

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 11 12:46 EDT 2021. Contains 343791 sequences. (Running on oeis4.)