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.

A175298 Smallest number >=n whose binary representation is palindromic and has a 1 whenever the binary representation of n has a 1.

This page as a plain text file.
%I A175298 #22 Dec 30 2017 11:38:07
%S A175298 0,1,3,3,5,5,7,7,9,9,15,15,15,15,15,15,17,17,27,27,21,21,31,31,27,27,
%T A175298 27,27,31,31,31,31,33,33,51,51,45,45,63,63,45,45,63,63,45,45,63,63,51,
%U A175298 51,51,51,63,63,63,63,63,63,63,63,63,63,63,63,65,65,99,99,85,85,119,119,73
%N A175298 Smallest number >=n whose binary representation is palindromic and has a 1 whenever the binary representation of n has a 1.
%C A175298 Old name: "Convert n to binary. OR each respective digit of binary n and binary A030101(n), where A030101(n) is the reversal of the order of the digits in the binary representation of n (given in decimal). a(n) is the decimal value of the result."
%C A175298 By "respective" digits of binary n and binary A030101(n), the rightmost digit of A030101(n) ( which is a 1) is OR'ed with the rightmost digit of n. A030101(n) is represented with the appropriate number of leading 0's.
%C A175298 This is the binary next-palindrome function, the base-2 analog of A262038. - _N. J. A. Sloane_, Dec 08 2015
%H A175298 Alois P. Heinz, <a href="/A175298/b175298.txt">Table of n, a(n) for n = 0..16383</a>
%e A175298 20 in binary is 10100. The reversal of the binary digits is 00101. So, from leftmost to rightmost respective digits, we OR 10100 and 00101: 1 OR 0 = 1. 0 OR 0 = 0. 1 OR 1 = 1. 0 OR 0 = 0. And 0 OR 1 = 1. So, 10100 OR 00101 is 10101, which is 21 in decimal. So a(20) = 21.
%t A175298 Table[f = IntegerDigits[x, 2]; f = f + Reverse[f]; FromDigits[ Table[If[Positive[f[[r]]], 1, 0], {r, 1, Length[f]}], 2], {x, STARTPOINT, ENDPOINT}] (* _Dylan Hamilton_, Oct 15 2010 *)
%t A175298 f[n_] := Block[{id = IntegerDigits[n, 2]}, FromDigits[ BitOr[ id, Reverse@id], 2]]; Array[f, 72] (* _Robert G. Wilson v_, Nov 07 2010 *)
%Y A175298 Cf. A006995, A030101, A175297, A262038.
%Y A175298 Sequences related to palindromic floor and ceiling: A175298, A206913, A206914, A261423, A262038, and the large block of consecutive sequences beginning at A265509.
%K A175298 base,nonn
%O A175298 0,3
%A A175298 _Leroy Quet_, Mar 24 2010
%E A175298 Extended, with redundant initial entries included, by _Dylan Hamilton_, Oct 15 2010
%E A175298 Edited with new name and offset by _N. J. A. Sloane_, Dec 08 2015