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.

Previous Showing 11-12 of 12 results.

A095734 Asymmetricity-index for Zeckendorf-expansion A014417(n) of n.

Original entry on oeis.org

0, 0, 1, 1, 0, 1, 0, 2, 1, 0, 2, 1, 0, 1, 0, 2, 2, 1, 2, 1, 3, 1, 0, 2, 2, 1, 1, 0, 2, 2, 1, 3, 1, 0, 1, 0, 2, 2, 1, 2, 1, 3, 2, 1, 3, 3, 2, 2, 1, 3, 1, 0, 3, 2, 4, 1, 0, 2, 2, 1, 2, 1, 3, 1, 0, 2, 2, 1, 2, 1, 3, 3, 2, 1, 0, 2, 2, 1, 3, 1, 0, 3, 2, 4, 2, 1, 3, 1, 0, 1, 0, 2, 2, 1, 2, 1, 3, 2, 1, 3, 3, 2, 2, 1, 3
Offset: 0

Views

Author

Antti Karttunen, Jun 05 2004

Keywords

Comments

Least number of flips of "fibits" (changing either 0 to 1 or 1 to 0 in Zeckendorf-expansion A014417(n)) so that a palindrome is produced.

Examples

			The integers 0 and 1 look as '0' and '1' also in Fibonacci-representation,
and being palindromes, a(0) and a(1) = 0.
2 has Fibonacci-representation '10', which needs a flip of other 'fibit',
that it would become a palindrome, thus a(2) = 1. Similarly 3 has representation
'100', so flipping for example the least significant fibit, we get '101',
thus a(3)=1 as well. 7 (= F(3)+F(5)) has representation '1010', which needs
two flips to produce a palindrome, thus a(7)=2. Here F(n) = A000045(n).
		

Crossrefs

a(n) = A037888(A003714(n)). A094202 gives the positions of zeros. Cf. also A095732.

A144477 a(n) = minimal number of 0's that must be changed to 1's in the binary expansion of the n-th prime in order to make it into a palindrome.

Original entry on oeis.org

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
Offset: 1

Views

Author

Washington Bomfim, Jan 15 2011, following a suggestion from Joerg Arndt

Keywords

Examples

			a(5) = 1 since prime(5) = 11 = 1011_2 becomes a palindrome if we change the third bit to 0.
		

Crossrefs

Subsequence of A037888.

Programs

  • Mathematica
    A144477[n_]:=With[{p=IntegerDigits[Prime[n],2]},HammingDistance[p,Reverse[p]]/2];Array[A144477,100] (* Paolo Xausa, Nov 13 2023 *)
  • 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,", "))

Formula

a(n) is half the Hamming distance between the binary expansion of prime(n) and its reversal.

Extensions

Edited by N. J. A. Sloane, Apr 23 2020 at the suggestion of Harvey P. Dale
Previous Showing 11-12 of 12 results.