login
This site is supported by donations to The OEIS Foundation.
Logo

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A144477 The n-th prime in binary becomes a palindrome when at least a(n) bits one are changed to zero. 1
1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 2, 1, 2, 1, 1, 1, 2, 0, 2, 2, 1, 1, 2, 1, 0, 2, 2, 0, 1, 1, 2, 2, 3, 1, 2, 1, 1, 3, 1, 1, 1, 2, 1, 1, 1, 1, 1, 3, 1, 3, 1, 0, 2, 2, 3, 1, 1, 2, 2, 2, 3, 0, 1, 3, 1, 3, 1, 2, 2, 1, 1, 2, 1, 2, 3, 1, 2, 1, 3, 1, 2, 2, 0, 2, 3, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 3 (list; graph; refs; listen; history; internal format)
OFFSET

1,14

COMMENTS

We can change a(n) bits zero to bits one instead.

FORMULA

a(n) is half the Hamming distance from prime(n) to the reverse of prime(n).

EXAMPLE

a(5) = 1 since prime(5)=11=(1011)2 becomes a palindrome if we change the bit zero to one.

PROG

(PARI)

HD(p)=

{

  v=binary(p); H=0; j=#v;

  for(k=1, #v, H+=abs(v[k]-v[j]); j--);

  return(H)

};

for(n=1, 100, p=prime(n); an=HD(p)/2; print1(an, ", "))

- Washington Bomfim, Jan 15 2011

CROSSREFS

Subsequence of A037888.

Sequence in context: A165022 A030338 A159847 * A106345 A194636 A081729

Adjacent sequences:  A144474 A144475 A144476 * A144478 A144479 A144480

KEYWORD

nonn,base

AUTHOR

Washington Bomfim (webonfim(AT)gmail.com), Jan 15 2011. From a suggestion of Joerg Arndt.

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
Recent Additions | More pages | Superseeker | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .

Last modified February 14 18:47 EST 2012. Contains 205663 sequences.