login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A161400 Positive integers that are palindromes (of even length) in binary, each made by concatenating two identical binary palindromes. 1
3, 15, 45, 63, 153, 255, 561, 693, 891, 1023, 2145, 2925, 3315, 4095, 8385, 9417, 10965, 11997, 12771, 13803, 15351, 16383, 33153, 39321, 42405, 48573, 50115, 56283, 59367, 65535, 131841, 140049, 152361, 160569, 166725, 174933, 187245 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

COMMENTS

If m is the n-th positive integer that is a binary palindrome, and m written in binary is k digits long, then a(n) = m*(2^k +1).

LINKS

Harvey P. Dale, Table of n, a(n) for n = 1..10000

FORMULA

a(n) = (2^A070939(p)+1)*p where p = A006995(n+1). [From R. J. Mathar, Sep 27 2009]

EXAMPLE

The first eight terms of this sequence written in binary: 11, 1111, 101101, 111111, 10011001, 11111111, 1000110001, 1010110101.

MATHEMATICA

Union[Flatten[Table[FromDigits[Join[#, #], 2]&/@Select[Tuples[ {1, 0}, n], First[ #]!=0&&Last[#]!=0&&#==Reverse[#]&], {n, 10}]]] (* Harvey P. Dale, Jul 15 2014 *)

PROG

(Python)

from itertools import product

def bin_pals():

  yield "1"

  digits, midrange = 2, [[""], ["0", "1"]]

  while True:

    for p in product("01", repeat=digits//2-1):

      left = "1"+"".join(p)

      for middle in midrange[digits%2]:

        yield left+middle+left[::-1]

    digits += 1

def aupton(terms):

  alst, bgen = [], bin_pals()

  while len(alst) < terms: b = next(bgen); alst.append(int(b+b, 2))

  return alst

print(aupton(37)) # Michael S. Branicky, Mar 15 2021

CROSSREFS

Cf. A006995.

Sequence in context: A127407 A196237 A177146 * A112810 A334078 A094191

Adjacent sequences:  A161397 A161398 A161399 * A161401 A161402 A161403

KEYWORD

base,nonn

AUTHOR

Leroy Quet, Jun 09 2009

EXTENSIONS

Extended beyond 693 by R. J. Mathar, Sep 27 2009

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 26 10:35 EDT 2021. Contains 346294 sequences. (Running on oeis4.)