login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A023506 Exponent of 2 in prime factorization of prime(n) - 1. 15
0, 1, 2, 1, 1, 2, 4, 1, 1, 2, 1, 2, 3, 1, 1, 2, 1, 2, 1, 1, 3, 1, 1, 3, 5, 2, 1, 1, 2, 4, 1, 1, 3, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 6, 2, 1, 1, 1, 1, 2, 3, 1, 4, 1, 8, 1, 2, 1, 2, 3, 1, 2, 1, 1, 3, 2, 1, 4, 1, 2, 5, 1, 1, 2, 1, 1, 2, 2, 4, 3, 1, 2, 1, 4, 1, 1, 6, 3, 2, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 2, 1, 2, 1, 3, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
COMMENTS
Also the number of steps to reach an integer starting with prime(n)/2 and iterating the map x->x*ceiling(x). - Benoit Cloitre, Sep 06 2002
Also exponent of 2 in -1 + prime(n)^s for odd exponents s because (-1 + prime(n)^s)/(prime(n) - 1) is odd. - Labos Elemer, Jan 20 2004
First occurrence of 0,1,2,3,4,...: 1, 2, 3, 13, 7, 25, 44, 116, 55, 974, 1581, 2111, 1470, 4289, 10847, 15000, 6543, 91466, 62947, 397907, 498178, ..., for primes 2, 3, 5, 41, 17, 97, 193, 641, 257, 7681, 13313, 18433, 12289, 40961, 114689, 163841, 65537, 1179649, 786433, 5767169, 7340033, .... - Robert G. Wilson v, May 28 2009
LINKS
FORMULA
EXAMPLE
n=25, p(25)=97, A006093(25) = 96 = 2*2*2*2*2*3, so a(25)=5.
MAPLE
A023506:= x -> padic[ordp](ithprime(x)-1, 2):
seq(A023506(x), x=1..1000); # Robert Israel, May 06 2014
MATHEMATICA
f[n_] := Block[{fi = First@ FactorInteger[ Prime@n - 1]}, If[ fi[[1]] == 2, fi[[2]], 0]]; Array[f, 105] (* Robert G. Wilson v, May 28 2009 *)
Table[IntegerExponent[Prime[n] - 1, 2], {n, 110}] (* Bruno Berselli, Aug 05 2013 *)
PROG
(PARI) A023506(n) = {local(m, r); r=0; m=prime(n)-1; while(m%2==0, m=m/2; r++); r} \\ Michael B. Porter, Jan 26 2010
(PARI) forprime(p=2, 700, print1(valuation(p-1, 2), ", ")); \\ Bruno Berselli, Aug 05 2013
(Magma) [Valuation(NthPrime(n)-1, 2): n in [1..110]]; // Bruno Berselli, Aug 05 2013
(Python)
from sympy import prime
def A023506(n): return (~(m:=prime(n)-1)& m-1).bit_length() # Chai Wah Wu, Jul 07 2022
CROSSREFS
Cf. A007814, A000010, A000040, A006093, A057023, A057773 (partial sums).
Subsequence of A001511 (except 1st term).
Sequence in context: A245195 A340191 A182105 * A232089 A141021 A140995
KEYWORD
nonn,easy
AUTHOR
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 18:17 EDT 2024. Contains 371962 sequences. (Running on oeis4.)