login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo

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 59th year, we have over 358,000 sequences, and we’ve crossed 10,300 citations (which often say “discovered thanks to the OEIS”).

Other ways to Give
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A205510 Binary Hamming distance between prime(n) and prime(n+1). 20
1, 2, 1, 2, 2, 3, 1, 1, 2, 1, 4, 2, 1, 1, 3, 3, 2, 6, 1, 3, 2, 3, 2, 3, 1, 1, 2, 2, 3, 3, 6, 2, 1, 4, 1, 2, 5, 1, 2, 4, 2, 2, 6, 1, 1, 2, 2, 4, 2, 2, 2, 4, 2, 7, 2, 2, 1, 3, 2, 1, 5, 3, 1, 3, 1, 5, 3, 2, 2, 4, 2, 1, 3, 3, 1, 6, 1, 3, 1, 4, 2, 2, 4, 2, 2, 5, 1, 1, 1, 3, 2, 3, 2, 2, 1, 2, 7, 1, 3, 5 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

We call "Hamming's twin primes" the pairs of consecutive primes (p,q) with Hamming distance 1. They are (2,3), (5,7), (17,19,), (19,23), (29,31), (41,43), (43,47), (67,71), (97,101), ..., (A205511,A205302). As in Twin Primes Conjecture, we conjecture that there exist infinitely many Hamming's twin pairs.

LINKS

Alois P. Heinz, Table of n, a(n) for n = 1..20000

MAPLE

a:= n-> add(i, i=Bits[GetBits](Bits[Xor](ithprime(n), ithprime(n+1)), 0..-1)):

seq(a(n), n=1..100); # Alois P. Heinz, Oct 11 2017

MATHEMATICA

Table[Count[IntegerDigits[BitXor[Prime[n], Prime[n+1]], 2], 1], {n, 100}] (* Jayanta Basu, May 26 2013 *)

PROG

(PARI) A205510(n)=norml2(binary(bitxor(prime(n), prime(n+1)))) \\ M. F. Hasler, Jan 29 2012

(PARI) a(n, p=prime(n), q=nextprime(p+1))=hammingweight(bitxor(p, q)) \\ Charles R Greathouse IV, Nov 15 2022

CROSSREFS

Cf. A205511, A205302, A205509, A001511, A345985.

Sequence in context: A140086 A037194 A326130 * A330004 A332901 A292583

Adjacent sequences: A205507 A205508 A205509 * A205511 A205512 A205513

KEYWORD

nonn,base,easy

AUTHOR

Vladimir Shevelev, Jan 28 2012

EXTENSIONS

Corrected a(24) and a(25) by M. F. Hasler, Jan 29 2012

Added "binary" to definition. - N. J. A. Sloane, Jul 09 2021

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified December 3 23:05 EST 2022. Contains 358543 sequences. (Running on oeis4.)