|
|
A186034
|
|
2-adic valuation of the n-th Motzkin number.
|
|
2
|
|
|
0, 0, 1, 2, 0, 0, 0, 0, 0, 0, 2, 1, 0, 0, 1, 2, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0, 2, 1, 0, 0, 2, 1, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0, 2, 1, 0, 0, 1, 2, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0, 2, 1, 0, 0, 1, 2, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,4
|
|
LINKS
|
|
|
FORMULA
|
|
|
MAPLE
|
local m, ml ;
ml := %/2^n ;
m/numer(ml) ;
ilog2(%) ;
end proc:
|
|
MATHEMATICA
|
IntegerExponent[RecurrenceTable[(n + 4) M[n + 2] - (2 n + 5) M[n + 1] - 3 (n + 1) M[n] == 0 && M[0] == M[1] == 1, M[n], {n, 0, 127}], 2] (* Eric Rowland, May 06 2013 *)
|
|
PROG
|
(Python)
from itertools import count, islice
def A186034_gen(): # generator of terms
a, b = 1, 1
yield from (0, 0)
for n in count(2):
a, b = b, (b*(2*n+1)+a*3*(n-1))//(n+2)
yield (~b&b-1).bit_length()
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|