login
A068504
Highest power of 2 dividing prime(n)+1.
2
1, 4, 2, 8, 4, 2, 2, 4, 8, 2, 32, 2, 2, 4, 16, 2, 4, 2, 4, 8, 2, 16, 4, 2, 2, 2, 8, 4, 2, 2, 128, 4, 2, 4, 2, 8, 2, 4, 8, 2, 4, 2, 64, 2, 2, 8, 4, 32, 4, 2, 2, 16, 2, 4, 2, 8, 2, 16, 2, 2, 4, 2, 4, 8, 2, 2, 4, 2, 4, 2, 2, 8, 16, 2, 4, 128, 2, 2, 2, 2, 4, 2, 16, 2, 8, 4, 2, 2, 2, 16, 4, 32, 8, 4, 4, 8, 2
OFFSET
1,2
LINKS
FORMULA
a(n) = A006519(A008864(n)). - Michel Marcus, Nov 24 2013
a(n) = 2^A023512(n). - Michel Marcus, Nov 24 2013
MAPLE
f:= n -> 2^padic:-ordp(ithprime(n)+1, 2):
map(f, [$1..100]); # Robert Israel, Jan 13 2017
MATHEMATICA
a[n_] := 2^IntegerExponent[Prime[n] + 1, 2]; Array[a, 100] (* Amiram Eldar, Jun 04 2022 *)
PROG
(PARI) a(n) = 2^valuation(prime(n)+1, 2); \\ Michel Marcus, Nov 24 2013
(Python)
from sympy import prime
def A068504(n): return (m:=prime(n)+1)&-m # Chai Wah Wu, Jul 09 2022
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Benoit Cloitre, Mar 11 2002
STATUS
approved