OFFSET
1,2
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
Index entries for linear recurrences with constant coefficients, signature (1, 1, -1).
FORMULA
a(n) = floor(log_2(A298476(n))) + 1.
From Robert Israel, Jan 24 2018: (Start)
If n is even, a(n) = 3*n-4.
If n <> 1 or 5 is odd, a(n) = 3*n-3.
G.f.: x*(1+x+3*x^2+x^3-x^4+x^5+x^6-x^7)/((1-x)*(1-x^2)). (End)
EXAMPLE
The lexicographically earliest strings of length a(n) with a minimum palindromic partition into n parts:
n | a(n) | string | partition
--+------+----------------+---------------------------
1 | 1 | 0 | (0)
2 | 2 | 01 | (0)(1)
3 | 6 | 001011 | (0)(010)(11)
4 | 8 | 00101100 | (00)(101)(1)(00)
5 | 11 | 00101100101 | (00)(101)(1001)(0)(1)
6 | 14 | 00101110001011 | (00)(101)(11)(00)(010)(11)
MAPLE
MATHEMATICA
With[{s = Array[Boole[# == 11] + Floor[#/6] + Floor[(# + 4)/6] + 1 &, 2^8]}, Array[FirstPosition[s, #][[1]] &, Max@ Take[#, LengthWhile[Differences@ #, # == 1 &]] &@ Union@ s]] (* Michael De Vlieger, Jan 23 2018 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Peter Kagey, Jan 19 2018
STATUS
approved