OFFSET
1,2
FORMULA
Other identities and observations:
It seems that a(n) <= A213709(n) for all n >= 1. A254119 gives the difference between these two sequences.
From Antti Karttunen, Feb 21 2015: (Start)
Here secondmsb is implemented by the starting offset 2 version of A079944, and effectively gives the second most significant bit in the binary expansion of n. The formula follows from the semi-regular nature of number-of-runs beanstalk, as in the upper half of any next higher range [A255062(n+1) .. A255061(n+2)] of its infinite trunk (A255056), the beanstalk imitates its behavior in the range [A255062(n) .. A255061(n+1)].
(End)
PROG
(PARI)
A005811(n) = hammingweight(bitxor(n, n\2));
A255071(n) = { my(k, i); k = (2^(n+1))-2; i = 1; while(1, k = k - A005811(k); if(!bitand(k+1, k+2), return(i), i++)); };
for(n=1, 48, write("b255071.txt", n, " ", A255071(n)));
(Scheme)
;; Shifted variant gives: (map A255071shifted (iota 16)) --> (0 1 2 3 5 9 16 29 53 97 178 328 608 1134 2126 4001)
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Feb 14 2015
EXTENSIONS
a(37) added by Antti Karttunen, Feb 19 2015
STATUS
approved