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.

Showing 1-2 of 2 results.

A331893 Positive numbers k such that both k and -k are a palindromes in negabinary representation.

Original entry on oeis.org

1, 5, 7, 17, 21, 31, 57, 65, 85, 127, 155, 217, 257, 273, 325, 341, 455, 511, 635, 857, 889, 993, 1025, 1105, 1253, 1285, 1365, 1799, 2047, 2159, 2555, 2667, 3417, 3577, 3641, 3937, 4097, 4161, 4369, 4433, 4965, 5125, 5189, 5397, 5461, 6951, 7175, 7967, 8191
Offset: 1

Views

Author

Amiram Eldar, Jan 30 2020

Keywords

Comments

Numbers of the form 2^(2*m-1) - 1 (A083420) and 2^(2*m) + 1 (A052539) are terms.

Examples

			5 is a term since the negabinary representation of 5, 101, and the negabinary representation of -5, 1111, are both palindromic.
		

Crossrefs

Intersection of A331891 and A331892.

Programs

  • Mathematica
    negabin[n_] := negabin[n] = If[n==0, 0, negabin[Quotient[n-1, -2]]*10 + Mod[n, 2]]; nbPalinQ[n_] := And @@ (PalindromeQ @ negabin[#] & /@ {n, -n}); Select[Range[2^13], nbPalinQ]

A331895 Positive numbers k such that the binary and negabinary representations of k and the negabinary representation of -k are all palindromic.

Original entry on oeis.org

1, 5, 7, 17, 21, 31, 65, 85, 127, 257, 273, 325, 341, 455, 511, 1025, 1105, 1285, 1365, 1799, 2047, 4097, 4161, 4369, 4433, 5125, 5189, 5397, 5461, 7175, 7967, 8191, 16385, 16705, 17425, 17745, 20485, 20805, 21525, 21845, 28679, 29127, 31775, 32767, 65537, 65793
Offset: 1

Views

Author

Amiram Eldar, Jan 30 2020

Keywords

Comments

Numbers of the form 2^(2*m-1) - 1 (A083420) and 2^(2*m) + 1 (A052539) are terms.

Examples

			7 is a term since the binary representation of 7, 111, the negabinary representation of 7, 11011, and the negabinary representation of -7, 1001, are all palindromic.
		

Crossrefs

Intersection of A006995 and A331893.
Intersection of A331892 and A331894.

Programs

  • Mathematica
    binPalinQ[n_] := PalindromeQ @ IntegerDigits[n, 2]; negabin[n_] := negabin[n] = If[n==0, 0, negabin[Quotient[n-1, -2]]*10 + Mod[n, 2]]; nbPalinQ[n_] := And @@(PalindromeQ @ negabin[#] & /@ {n, -n}); Select[Range[2^16], binPalinQ[#] && nbPalinQ[#] &]
Showing 1-2 of 2 results.