%I #36 Oct 22 2022 08:06:37
%S 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,
%T 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,
%U 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
%N The index j < k such that n divides 2^k - 2^j, where k is the least index (A204987) for which such j exists.
%C For a guide to related sequences, see A204892.
%H Antti Karttunen, <a href="/A204988/b204988.txt">Table of n, a(n) for n = 1..6556</a>
%F a(n) = A007814(n) + (1-(-1)^n)/2 (conjecture). - _Velin Yanev_, Nov 14 2016.
%F From _Andrew Howroyd_, Aug 08 2018: (Start)
%F 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).
%F a(n) = max(1, A007814(n)). (End)
%F Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 3/2. - _Amiram Eldar_, Oct 22 2022
%e (See example at A204987.)
%t (See the program at A204987.)
%t a[n_] := Max[1, IntegerExponent[n, 2]]; Array[a, 100] (* _Amiram Eldar_, Oct 22 2022 *)
%o (PARI) \\ Use the program at A204987. - _Antti Karttunen_, Nov 19 2017
%o (PARI) a(n)=max(1, valuation(n,2)); \\ _Andrew Howroyd_, Aug 08 2018
%Y Cf. A007814, A204892, A204987.
%K nonn,mult
%O 1,4
%A _Clark Kimberling_, Jan 21 2012
%E More terms from _Antti Karttunen_, Nov 19 2017
%E Keyword:mult added by _Andrew Howroyd_, Aug 08 2018