%I #27 Jul 12 2024 09:52:18
%S 0,1,4,1,1,3,2,1,1,3,1,4,2,1,1,5,1,3,1,1,2,1,1,2,2,4,1,1,3,2,1,1,2,1,
%T 6,1,3,1,1,3,1,5,1,2,4,1,1,1,1,4,2,1,2,1,2,1,3,1,6,2,1,4,1,1,2,3,1,2,
%U 1,3,2,1,1,5,1,1,4,3,2,2,1,4,1,2,1,1,2,2,3,1,1,1,1,1,1,1,3,2,1,3,1,3,1,2,1
%N Exponent of highest power of 2 dividing 3*prime(n)+1.
%H Amiram Eldar, <a href="/A087963/b087963.txt">Table of n, a(n) for n = 1..10000</a>
%F a(n) = A007814(3*prime(n)+1).
%e For n = 10: p = prime(10) = 29, 3*p + 1 = 88 = 2^3 * 11, a(10) = 3.
%t ffi[x_] := Flatten[FactorInteger[x]]; e2[x_] := Part[[ffi[x]], 2]; Table[e2[3*Prime[w]+1], {w, 1, 100}]
%t IntegerExponent[3 * Prime[Range[100]] + 1, 2] (* _Amiram Eldar_, Jul 12 2024 *)
%o (PARI) a(n) = valuation(3*prime(n)+1, 2); \\ _Michel Marcus_, Sep 01 2016
%o (Magma) [Valuation(3*NthPrime(n)+1, 2): n in [1..80]] \\ _Vincenzo Librandi_, Sep 01 2016
%o (Python)
%o from sympy import prime
%o def A087963(n): return (~(m:=prime(n)*3+1)&m-1).bit_length() # _Chai Wah Wu_, Jul 10 2022
%Y Cf. A087272, A087273, A087274, A007814, A087230.
%K nonn
%O 1,3
%A _Labos Elemer_, Sep 18 2003
%E a(1)=0 corrected by _Michel Marcus_, Sep 01 2016