login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A186034 2-adic valuation of the n-th Motzkin number. 2

%I #29 Jul 09 2022 11:10:26

%S 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,

%T 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,

%U 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

%N 2-adic valuation of the n-th Motzkin number.

%H Antti Karttunen, <a href="/A186034/b186034.txt">Table of n, a(n) for n = 0..4095</a>

%H E. Rowland and R. Yassawi, <a href="http://arxiv.org/abs/1310.8635">Automatic congruences for diagonals of rational functions</a>, arXiv preprint arXiv:1310.8635 [math.NT], 2013-2014.

%F a(n) = log_2(A001006(n)/numerator(A001006(n)/2^n)).

%F (-1)^a(n) = A186035(n).

%F a(n) = A007814(A001006(n)). - _Antti Karttunen_, Aug 12 2017

%p A186034 := proc(n)

%p local m,ml ;

%p m := A001006(n) ;

%p ml := %/2^n ;

%p m/numer(ml) ;

%p ilog2(%) ;

%p end proc:

%p seq(A186034(n),n=0..80) ; # _R. J. Mathar_, Feb 13 2015

%t 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 *)

%o (Python)

%o from itertools import count, islice

%o def A186034_gen(): # generator of terms

%o a, b = 1, 1

%o yield from (0, 0)

%o for n in count(2):

%o a, b = b, (b*(2*n+1)+a*3*(n-1))//(n+2)

%o yield (~b&b-1).bit_length()

%o A186034_list = list(islice(A186034_gen(),30)) # _Chai Wah Wu_, Jul 08 2022

%Y Cf. A001006, A007814, A186035.

%K nonn

%O 0,4

%A _Paul Barry_, Feb 11 2011

%E Definition edited by _Eric Rowland_, May 06 2013

%E More terms from _Antti Karttunen_, Aug 12 2017

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 22:17 EDT 2024. Contains 371964 sequences. (Running on oeis4.)