(MAGMAMagma) [Valuation(NthPrime(n)+1, 2): n in [1..110]]; // Bruno Berselli, Aug 05 2013
(MAGMAMagma) [Valuation(NthPrime(n)+1, 2): n in [1..110]]; // Bruno Berselli, Aug 05 2013
Corrected by _Yasutoshi Kohmoto (zbi74583(AT)boat.zero.ad.jp), _, Feb 25 2005
proposed
approved
editing
proposed
IntegerExponent[Prime[Range[100]] + 1, 2] (* Zak Seidov, Apr 25 2014 *)
approved
editing
editing
approved
(PARI) a(n)=valuation(prime(n)+1, 2); vector(100, n, a(n)) \\ _Joerg Arndt_, Mar 11 2014
vector(100, n, a(n)) \\ Joerg Arndt, Mar 11 2014
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)
Join[{0}, Table[FactorInteger[Prime[n] + 1][[1]][[2]], {n, 2, 100}]] (* _Clark Kimberling, _, Oct 01 2013 *)
(PARI) a(n)=valuation(prime(n)+1, 2); vector(100, n, a(n)) \\ Joerg Arndt, Mar 11 2014
proposed
editing
editing
proposed
Cf. A239114.
proposed
editing