login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A023512
Exponent of 2 in prime factorization of prime(n) + 1.
10
0, 2, 1, 3, 2, 1, 1, 2, 3, 1, 5, 1, 1, 2, 4, 1, 2, 1, 2, 3, 1, 4, 2, 1, 1, 1, 3, 2, 1, 1, 7, 2, 1, 2, 1, 3, 1, 2, 3, 1, 2, 1, 6, 1, 1, 3, 2, 5, 2, 1, 1, 4, 1, 2, 1, 3, 1, 4, 1, 1, 2, 1, 2, 3, 1, 1, 2, 1, 2, 1, 1, 3, 4, 1, 2, 7, 1, 1, 1, 1, 2, 1, 4, 1, 3, 2, 1, 1, 1, 4, 2, 5, 3, 2, 2, 3, 1, 1, 2, 1, 2, 1, 2, 1, 2
OFFSET
1,2
COMMENTS
2^a(n) is the largest power of 2 dividing (prime(n)+1).
EXAMPLE
a(9)=3 because the 9th prime is 23 and the largest power of 2 dividing 24 is 3.
MAPLE
with(numtheory): a:=proc(n) local div, s, j, c: div:=divisors(1+ithprime(n)): s:=nops(div): for j from 1 to s do if type(simplify(log[2](div[j])), integer)=true then c[j]:=simplify(log[2](div[j])) else c[j]:=0 fi od: max(seq(c[j], j=1..s)) end: seq(a(n), n=1..120); # most probably not the simplest Maple program - Emeric Deutsch, Jul 20 2005
MATHEMATICA
Join[{0}, Table[FactorInteger[Prime[n] + 1][[1]][[2]], {n, 2, 100}]] (* Clark Kimberling, Oct 01 2013 *)
IntegerExponent[Prime[Range[100]] + 1, 2] (* Zak Seidov, Apr 25 2014 *)
PROG
(Magma) [Valuation(NthPrime(n)+1, 2): n in [1..110]]; // Bruno Berselli, Aug 05 2013
(PARI) a(n)=valuation(prime(n)+1, 2);
vector(100, n, a(n)) \\ Joerg Arndt, Mar 11 2014
CROSSREFS
Cf. A239114.
Sequence in context: A255191 A277818 A324607 * A322027 A088192 A218459
KEYWORD
nonn
EXTENSIONS
Corrected by Yasutoshi Kohmoto, Feb 25 2005
Edited by N. J. A. Sloane, Dec 23 2006
STATUS
approved