A204988 The index j < k such that n divides 2^k - 2^j, where k is the least index (A204987) for which such j exists.
1, 1, 1, 2, 1, 1, 1, 3, 1, 1, 1, 2, 1, 1, 1, 4, 1, 1, 1, 2, 1, 1, 1, 3, 1, 1, 1, 2, 1, 1, 1, 5, 1, 1, 1, 2, 1, 1, 1, 3, 1, 1, 1, 2, 1, 1, 1, 4, 1, 1, 1, 2, 1, 1, 1, 3, 1, 1, 1, 2, 1, 1, 1, 6, 1, 1, 1, 2, 1, 1, 1, 3, 1, 1, 1, 2, 1, 1, 1, 4, 1, 1, 1, 2, 1, 1, 1, 3, 1, 1, 1, 2, 1, 1, 1, 5, 1, 1, 1, 2, 1, 1, 1, 3, 1
Offset: 1
Examples
(See example at A204987.)
Links
- Antti Karttunen, Table of n, a(n) for n = 1..6556
Programs
-
Mathematica
(See the program at A204987.) a[n_] := Max[1, IntegerExponent[n, 2]]; Array[a, 100] (* Amiram Eldar, Oct 22 2022 *)
-
PARI
\\ Use the program at A204987. - Antti Karttunen, Nov 19 2017
-
PARI
a(n)=max(1, valuation(n,2)); \\ Andrew Howroyd, Aug 08 2018
Formula
a(n) = A007814(n) + (1-(-1)^n)/2 (conjecture). - Velin Yanev, Nov 14 2016.
From Andrew Howroyd, Aug 08 2018: (Start)
The above conjecture is true because the definition of this sequence and A204987 requires j to be at least 1 and 2^k - 2^j can be written 2^j*(2^(k-j) - 1).
a(n) = max(1, A007814(n)). (End)
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 3/2. - Amiram Eldar, Oct 22 2022
Extensions
More terms from Antti Karttunen, Nov 19 2017
Keyword:mult added by Andrew Howroyd, Aug 08 2018
Comments