A087963 Exponent of highest power of 2 dividing 3*prime(n)+1.
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, 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, 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
Offset: 1
Keywords
Examples
For n = 10: p = prime(10) = 29, 3*p + 1 = 88 = 2^3 * 11, a(10) = 3.
Links
- Amiram Eldar, Table of n, a(n) for n = 1..10000
Programs
-
Magma
[Valuation(3*NthPrime(n)+1, 2): n in [1..80]]; // Vincenzo Librandi, Sep 01 2016
-
Mathematica
ffi[x_] := Flatten[FactorInteger[x]]; e2[x_] := Part[[ffi[x]], 2]; Table[e2[3*Prime[w]+1], {w, 1, 100}] IntegerExponent[3 * Prime[Range[100]] + 1, 2] (* Amiram Eldar, Jul 12 2024 *)
-
PARI
a(n) = valuation(3*prime(n)+1, 2); \\ Michel Marcus, Sep 01 2016
-
Python
from sympy import prime def A087963(n): return (~(m:=prime(n)*3+1)&m-1).bit_length() # Chai Wah Wu, Jul 10 2022
Formula
a(n) = A007814(3*prime(n)+1).
Extensions
a(1)=0 corrected by Michel Marcus, Sep 01 2016