OFFSET
3,1
COMMENTS
There are no palindromes that work for a(1) and a(2), since the first positive binary palindromes are 0 and 1.
LINKS
Robert Israel, Table of n, a(n) for n = 3..10000
EXAMPLE
MAPLE
bp:= proc(n) local L; L:= convert(n, base, 2); L = ListTools:-Reverse(L) end proc:
Bp:= select(bp, [$0..10^6]): nBp:= nops(Bp):
f:= proc(n) local i;
for i from 3 to nBp do
if not bp(Bp[i]*Bp[n]) then return Bp[i] fi
od;
FAIL
end proc:
map(f, [$3..100]); # Robert Israel, Jan 09 2023
PROG
(PARI) a(n) = my(p=A006995(n), k=1); while(is_A006995(p*A006995(k)), k++); A006995(k); \\ using A006995 PARI codes; Michel Marcus, Jan 09 2023
(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 for k in bin_pals() if not is_bin_pal(k*bn))
print(list(islice(agen(), 93))) # Michael S. Branicky, Jan 09 2023
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Leroy Quet, Mar 11 2010
EXTENSIONS
Extended by Ray Chandler, Mar 13 2010
Offset 3 from Michel Marcus, Jan 09 2023
STATUS
approved