login
A089310
Write n in binary; a(n) = number of 1's in second block of 1's from right.
3
0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 2, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 2, 2, 2, 0, 3, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 0, 2, 2, 2, 2, 1, 2, 2, 0, 3, 3, 3, 0, 4, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 3, 1, 1, 0, 2, 2, 2
OFFSET
0,14
EXAMPLE
13 = 1101 so a(13) = 2.
PROG
(PARI) a(n)=local(b, c, s):b=binary(n):c=length(b):while(!b[c], c=c-1):while(c>0&&b[c], c=c-1): if(c<=0, 0, while(!b[c], c=c-1):s=0:while(c>0&&b[c], c=c-1:s=s+1):s) /* Ralf Stephan */
CROSSREFS
KEYWORD
nonn,base
AUTHOR
N. J. A. Sloane, Dec 22 2003
EXTENSIONS
More terms from Ralf Stephan, Feb 01 2004
STATUS
approved