login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A161789 a(n) = the largest integer k such that 2^k - 1 divides n. 3
1, 1, 2, 1, 1, 2, 3, 1, 2, 1, 1, 2, 1, 3, 4, 1, 1, 2, 1, 1, 3, 1, 1, 2, 1, 1, 2, 3, 1, 4, 5, 1, 2, 1, 3, 2, 1, 1, 2, 1, 1, 3, 1, 1, 4, 1, 1, 2, 3, 1, 2, 1, 1, 2, 1, 3, 2, 1, 1, 4, 1, 5, 6, 1, 1, 2, 1, 1, 2, 3, 1, 2, 1, 1, 4, 1, 3, 2, 1, 1, 2, 1, 1, 3, 1, 1, 2, 1, 1, 4, 3, 1, 5, 1, 1, 2, 1, 3, 2, 1, 1, 2, 1, 1, 4 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,3

COMMENTS

A161788(n) = 2^a(n) - 1. a(A161790(n)) = 1.

Conjecture: gcd(n, m) = a(2^n + 2^m - 2) for n > 0 and m > 0. - Velin Yanev, Aug 24 2017

LINKS

Table of n, a(n) for n=1..105.

MAPLE

A161789 := proc(n) for k from ilog2(n+1) to 0 by -1 do if n mod (2^k-1) = 0 then RETURN(k); fi; od: end: seq(A161789(n), n=1..120) ; # R. J. Mathar, Jun 27 2009

MATHEMATICA

kn[n_]:=Module[{k=Floor[Log[2, n]]+1}, While[!Divisible[n, 2^k-1], k--]; k]; Array[kn, 110] (* Harvey P. Dale, Mar 26 2012 *)

PROG

(PARI) a(n)=forstep(k=logint(n+1, 2), 1, -1, if(n%(2^k-1)==0, return(k))) \\ Charles R Greathouse IV, Aug 25 2017

CROSSREFS

Cf. A000225, A161788, A161790.

Sequence in context: A152650 A184219 A180262 * A109671 A141289 A284271

Adjacent sequences:  A161786 A161787 A161788 * A161790 A161791 A161792

KEYWORD

nonn,easy

AUTHOR

Leroy Quet, Jun 19 2009

EXTENSIONS

Extended by R. J. Mathar, Jun 27 2009

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 21 12:09 EDT 2019. Contains 321369 sequences. (Running on oeis4.)