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.

A305409 Positive numbers that can be expressed as the product of 1 or more binary palindromes (elements of A006995).

This page as a plain text file.
%I A305409 #13 Jun 02 2018 13:09:09
%S A305409 1,3,5,7,9,15,17,21,25,27,31,33,35,45,49,51,63,65,73,75,81,85,93,99,
%T A305409 105,107,119,125,127,129,135,147,153,155,165,175,189,195,217,219,225,
%U A305409 231,243,245,255,257,273,279,289,297,313,315,321,325,341,343,357,365
%N A305409 Positive numbers that can be expressed as the product of 1 or more binary palindromes (elements of A006995).
%H A305409 Robert Israel, <a href="/A305409/b305409.txt">Table of n, a(n) for n = 1..3086</a>
%e A305409 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).
%p A305409 dmax:= 10: N:= 2^dmax: # to get all terms < N
%p A305409 revdigs:= proc(n)
%p A305409   local L, Ln, i;
%p A305409   L:= convert(n, base, 2);
%p A305409   Ln:= nops(L);
%p A305409   add(L[i]*2^(Ln-i), i=1..Ln);
%p A305409 end proc:
%p A305409 A:= {}:
%p A305409 for d from 2 to dmax do
%p A305409 if d::even then
%p A305409     A:= A union {seq(2^(d/2)*x + revdigs(x), x=2^(d/2-1)..2^(d/2)-1)}
%p A305409 else
%p A305409     m:= (d-1)/2;
%p A305409     B:={seq(2^(m+1)*x + revdigs(x), x=2^(m-1)..2^m-1)};
%p A305409     A:= A union B union map(`+`, B, 2^m)
%p A305409 fi
%p A305409 od:
%p A305409 R:= {1}:
%p A305409 for b in A do
%p A305409   R:= map(t -> seq(t*b^j,j=0..floor(log[b](N/t))), R)
%p A305409 od:
%p A305409 sort(convert(R,list)); # _Robert Israel_, Jun 01 2018
%Y A305409 Cf. A006995.
%K A305409 nonn,base
%O A305409 1,2
%A A305409 _Jeffrey Shallit_, May 31 2018