%I #44 Jan 04 2023 02:59:27
%S 1,3,1,4,1,3,1,5,1,3,1,4,1,3,1,6,1,3,1,4,1,3,1,5,1,3,1,4,1,3,1,7,1,3,
%T 1,4,1,3,1,5,1,3,1,4,1,3,1,6,1,3,1,4,1,3,1,5,1,3,1,4,1,3,1,8,1,3,1,4,
%U 1,3,1,5,1,3,1,4,1,3,1,6,1,3,1,4,1,3,1,5,1,3,1,4,1,3,1,7,1,3,1,4,1,3,1,5,1
%N Exponent of 2 in 3^n - 1.
%C Also the 2-adic order of Fibonacci(3n) [Lengyel]. - _R. J. Mathar_, Nov 05 2008
%H Robert Israel, <a href="/A090740/b090740.txt">Table of n, a(n) for n = 1..10000</a>
%H T. Lengyel, <a href="https://www.fq.math.ca/Scanned/33-3/lengyel.pdf">The order of the Fibonacci and Lucas numbers</a>, Fib. Quart. 33 (1995), 234-239.
%H Diego Marques and Pavel Trojovský, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL18/Marques2/marques11.html">The p-adic order of some fibonomial coefficients</a>, J. Int. Seq. 18 (2015), Article 15.3.1, proposition 7.
%F a(n) = A007814(n) + A059841(n) + 1.
%F Multiplicative with a(p^e) = e+2 if p = 2; 1 if p > 2. G.f.: A(x) = 1/(1-x^2) + Sum_{k>=0} x^(2^k)/(1-x^(2^k)). - _Vladeta Jovovic_, Jan 19 2004
%F G.f.: Sum_{k>=0} t*(1+2*t+t^2+t^3)/(1-t^4) with t=x^2^k. Recurrence: a(2n) = a(n) + 1 + [n odd], a(2n+1) = 1. - _Ralf Stephan_, Jan 23 2004
%F G.f. A(x) satisfies A(x) = A(x^2) + x/(1-x) + x^2/(1-x^4). - _Robert Israel_, Dec 28 2015
%F Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 5/2. - _Amiram Eldar_, Nov 28 2022
%F Dirichlet g.f.: zeta(s)*(2^s+1-1/2^s)/(2^s-1). - _Amiram Eldar_, Jan 04 2023
%e n=2: 3^2 - 1 = 8 = 2^3 so a(2)=3.
%p seq(padic:-ordp(3^n-1, 2), n=1..100); # _Robert Israel_, Dec 28 2015
%t Table[Part[Flatten[FactorInteger[ -1+3^n]], 2], {n, 1, 70}]
%t IntegerExponent[#,2]&/@(3^Range[110]-1) (* _Harvey P. Dale_, Jan 28 2017 *)
%o (PARI) a(n)=if(n<1,0,if(n%2==0,a(n/2)+1+(n/2)%2,1)) /* _Ralf Stephan_, Jan 23 2004 */
%o (PARI) a(n)=valuation(fibonacci(3*n),2); \\ _Joerg Arndt_, Oct 28 2012
%o (PARI) a(n)=my(t=valuation(n,2)); if(t,t+2,1) \\ _Charles R Greathouse IV_, Mar 14 2014
%o (Python)
%o def A090740(n): return (n&-n).bit_length()+int(not n&1) # _Chai Wah Wu_, Jul 11 2022
%Y Cf. A069895, A091512, A088660, A090739, A001511.
%Y Cf. A007814, A014445, A059841.
%K nonn,mult,easy
%O 1,2
%A _Labos Elemer_ and _Ralf Stephan_, Jan 19 2004