|
|
A277446
|
|
Longest partition of the binary digits of n read from left to right into contiguous blocks so that the value of a block divides the value of its successor and with no leading zeros in the blocks.
|
|
3
|
|
|
1, 1, 2, 1, 1, 2, 3, 1, 1, 2, 1, 2, 2, 3, 4, 1, 1, 1, 1, 2, 1, 2, 1, 2, 2, 3, 2, 3, 3, 4, 5, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 3, 1, 2, 2, 2, 1, 2, 2, 2, 2, 3, 2, 3, 2, 3, 3, 4, 3, 4, 4, 5, 6, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 2, 1, 2, 1, 2, 1, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 3, 2, 4, 2
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,3
|
|
LINKS
|
|
|
EXAMPLE
|
We have 58 = (1,1,1,0,1,0)_2 and (1)_2|(1)_2|(1,0)_2|(1,0)_2 yielding the value four.
We have 676 = (1,0,1,0,1,0,0,1,0,0)_2 and (1,0)_2|(1,0)_2|(1,0,0)_2|(1,0,0)_2 yielding the value four.
|
|
PROG
|
(PARI) okp(p, b) = {vb = vector(#p); vv = vector(#p); j = 1; for (k=1, #p, vb[k] = vector(p[k], m, b[j+m-1]); if ((vb[k])[1] == 0, return (0)); vv[k] = subst(Pol(vb[k]), x, 2); if ((k >1) && (vv[k] % vv[k-1]), return (0)); j += p[k]; ); 1; }
a(n) = {b = binary(n); nb = 0; forpart(p=#b, if (okp(p, b), nb = max(nb, #p)); ); nb; } \\ Michel Marcus, Oct 18 2016
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|