login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A305409
Positive numbers that can be expressed as the product of 1 or more binary palindromes (elements of A006995).
1
1, 3, 5, 7, 9, 15, 17, 21, 25, 27, 31, 33, 35, 45, 49, 51, 63, 65, 73, 75, 81, 85, 93, 99, 105, 107, 119, 125, 127, 129, 135, 147, 153, 155, 165, 175, 189, 195, 217, 219, 225, 231, 243, 245, 255, 257, 273, 279, 289, 297, 313, 315, 321, 325, 341, 343, 357, 365
OFFSET
1,2
LINKS
EXAMPLE
155 is in the sequence because it is 5*31, and both 5 and 31 are palindromic numbers (with binary representations 101 and 11111, respectively).
MAPLE
dmax:= 10: N:= 2^dmax: # to get all terms < N
revdigs:= proc(n)
local L, Ln, i;
L:= convert(n, base, 2);
Ln:= nops(L);
add(L[i]*2^(Ln-i), i=1..Ln);
end proc:
A:= {}:
for d from 2 to dmax do
if d::even then
A:= A union {seq(2^(d/2)*x + revdigs(x), x=2^(d/2-1)..2^(d/2)-1)}
else
m:= (d-1)/2;
B:={seq(2^(m+1)*x + revdigs(x), x=2^(m-1)..2^m-1)};
A:= A union B union map(`+`, B, 2^m)
fi
od:
R:= {1}:
for b in A do
R:= map(t -> seq(t*b^j, j=0..floor(log[b](N/t))), R)
od:
sort(convert(R, list)); # Robert Israel, Jun 01 2018
CROSSREFS
Cf. A006995.
Sequence in context: A351462 A258159 A238257 * A376857 A342572 A374199
KEYWORD
nonn,base
AUTHOR
Jeffrey Shallit, May 31 2018
STATUS
approved