|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
2^a(n) is the largest power of 2 dividing (prime(n)+1).
|
|
LINKS
|
|
|
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);
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|