|
|
A175241
|
|
Call any positive integer that is a palindrome when written in binary a "binary palindrome". a(n) = the smallest product (the n-th binary palindrome)*(any binary palindrome) that is not a binary palindrome.
|
|
2
|
|
|
81, 25, 35, 81, 75, 289, 105, 81, 155, 1089, 135, 357, 315, 4225, 657, 425, 279, 1485, 321, 357, 635, 16641, 459, 825, 567, 5265, 657, 1155, 1275, 66049, 4641, 1485, 939, 1625, 1705, 1095, 1143, 10449, 1209, 1281, 1329, 2275, 1413, 1485, 2555, 263169
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
3,1
|
|
COMMENTS
|
a(1) and a(2) are undefined, because the two first terms of A006995 are 0 and 1; and 0 times and 1 times any binary palindrome are binary palindromes, obviously.
|
|
LINKS
|
|
|
FORMULA
|
|
|
PROG
|
(Python)
from itertools import count, islice, product
def is_bin_pal(n): return (b:=bin(n)[2:]) == b[::-1]
def bin_pals(): # generator of positive binary palindromes in base 10
yield 1
digits, midrange = 2, [[""], ["0", "1"]]
for digits in count(2):
for p in product("01", repeat=digits//2-1):
left = "1"+"".join(p)
for middle in midrange[digits%2]:
yield int(left + middle + left[::-1], 2)
def agen(): # generator of terms
g = bin_pals(); next(g)
for n in count(3):
bn = next(g)
yield next(k*bn for k in bin_pals() if not is_bin_pal(k*bn))
|
|
CROSSREFS
|
|
|
KEYWORD
|
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|