A215883 When written in base 4, n ends in a(n) consecutive nonzero digits.
0, 1, 1, 1, 0, 2, 2, 2, 0, 2, 2, 2, 0, 2, 2, 2, 0, 1, 1, 1, 0, 3, 3, 3, 0, 3, 3, 3, 0, 3, 3, 3, 0, 1, 1, 1, 0, 3, 3, 3, 0, 3, 3, 3, 0, 3, 3, 3, 0, 1, 1, 1, 0, 3, 3, 3, 0, 3, 3, 3, 0, 3, 3, 3, 0, 1, 1, 1, 0, 2, 2, 2, 0, 2, 2, 2, 0, 2, 2, 2, 0, 1, 1, 1, 0, 4, 4
Offset: 0
Examples
The numbers 0,1,2,3,4,5,6,7 are written in base 4 as 0,1,2,3,10,11,12,13 and thus end in a(0..7)=0,1,1,1,0,2,2,2 nonzero digits.
Programs
-
PARI
a(n,b=4)=n=divrem(n,b); for(c=0,9e9,n[2]||return(c); n=divrem(n[1],b))
-
PARI
a(n)=my(k);while(n%4,n>>=2;k++);k \\ Charles R Greathouse IV, Sep 26 2013
Formula
a(4^(t+1)*k+m) = t for 4^t > m > 4^(t-1).
Comments