OFFSET
1,2
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..16384
FORMULA
a(2^k*(2*n-1) - 1) = 2*n-1 and a(2^k*(2*n-1)) = 2^k*(1 + 2^k*(2*n-1)), n >= 1 and k >= 1. - Johannes W. Meijer, Oct 31 2012
1 <= a(n) <= n^2 + n; both bounds are sharp. - Charles R Greathouse IV, Oct 31 2012
MAPLE
nmax:=69: for n from 1 to nmax do for k from 1 to floor(log[2](nmax)) do a(2^k*(2*n-1) - 1) := 2*n-1; a(2^k*(2*n-1)) := 2^k*(1 + 2^k*(2*n-1)) od: od: seq(a(n), n=1..nmax); # Johannes W. Meijer, Oct 31 2012
MATHEMATICA
Array[SelectFirst[Reverse@ Divisors[# + 1], OddQ]*2^IntegerExponent[#, 2] &, 69] (* Michael De Vlieger, Nov 02 2017 *)
PROG
(PARI) a(n)=(n+1)>>valuation(n+1, 2)<<valuation(n, 2) \\ Charles R Greathouse IV, Oct 31 2012
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Leroy Quet, Jun 03 2009
EXTENSIONS
Extended by Ray Chandler, Jun 11 2009
STATUS
approved