OFFSET
1,2
COMMENTS
The set of numbers which have n contiguous palindromic bit patterns (in their binary representation) is not empty and finite, provided n<>5. Proof: compare A217101 for the proof of existence. The finiteness follows from A206925, since each number p > 2^floor((n+1)/2) has at least A206925(p) >= 2*floor(log_2(p)) > 2*floor((n+1)/2) = n + n mod 2 palindromic substrings. Thus, there is a boundary b <= 2^floor((n+1)/2) such that all numbers > b have more than n palindromic substrings. It follows, that the set of numbers with n palindromic substrings is finite.
a(5)=0, and this is the only zero term. Proof: cf. A217101.
The binary expansion of a(n) has 1 + floor(n/2) digits (n<>5).
a(2n) is the maximal number with n+1 binary digits such that the number of contiguous palindromic bit patterns in the binary representation is minimal (cf. A206926).
LINKS
Hieronymus Fischer, Table of n, a(n) for n = 1..1000
FORMULA
a(n) = max(k | A206925(k) = n), for n<>5.
A206925(a(n)) = n, n<>5.
a(n) => A217101(n), equality holds for n = 1, 2, 3 and 5, only.
Iteration formula:
a(n+2) = 2*a(n) + floor(52*2^floor((n+4-(-1)^n)/2)/63) mod 2, n>5.
a(n+2) = 2*a(n) + floor(52*2^((2*n+7-3*(-1)^n)/4)/63) mod 2, n>5.
Direct calculation formula:
a(n) = floor(52*2^floor((n+1+(-1)^n)/2)/63) mod 2^floor((n+1+(-1)^n)/2)) + (1-(-1)^n)*2^floor((n-2)/2)), for n>5.
a(n) = floor(52*2^((2*n + 1 + 3*(-1)^n)/4)/63) + (1-(-1)^n)*2^((2*n - 5 + (-1)^n)/4), for n>5.
a(2k) = A206926(6k-9), k>2.
G.f.: x*(1 +2*x +x^2 +2*x^3 -6*x^4 +x^5 +14*x^6 +x^8 +x^11 -x^12 -x^13 -2*x^15 +7*x^16 -14*x^18)/((1-2*x^2)*(1-x^3)*(1+x^3)*(1+x^6)); also:
x*(1 -x +3*x^2 +x*(3+14*x^5)/(1-2*x^2) +x^5*(1+x^3)*(1+x^6+x^8)/((1-2*x^2)*(1-x^12))).
EXAMPLE
a(3)=3, since 3=11_2 has 3 contiguous palindromic bit patterns, and this is the greatest such number.
a(6)=13. Since 13=1101_2 has 6 contiguous palindromic bit patterns, and this is the greatest such number.
a(8)=26. Since 26=11010_2 has 8 contiguous palindromic bit patterns (1, 1, 0, 1, 0, 11, 101 and 010), and this is the greatest such number.
a(9)=27. Since 17=11011_2 has 9 contiguous palindromic bit patterns (1, 1, 0, 1, 1, 11, 11, 101 and 11011), and this is the greatest such number.
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Hieronymus Fischer, Jan 23 2013
STATUS
approved