This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A179680 #26 Jul 30 2018 09:48:56 %S A179680 0,1,1,1,1,3,3,1,1,5,1,3,5,5,7,1,1,3,9,3,3,3,3,6,5,2,13,5,3,15,15,1,1, %T A179680 17,5,9,1,5,7,10,13,21,1,7,2,3,2,9,11,9,25,13,2,27,9,9,5,11,2,6,27,5, %U A179680 25,1,1,33,3,9,15,35,11,15,3,11,37,3,6,5,13,13 %N A179680 The number of exponents >1 in a recursive reduction of 2n-1 until reaching an odd part equal to 1. %C A179680 Let N = 2n-1. Then consider the following algorithm of updating pairs (v,m) indicating highest exponent of 2 (2-adic valuation) and odd part: Initialize at step 1 by v(1) = A007814(N+1) and m(1) = A000265(N+1). Iterate over steps i>=2: v(i) = A007814(N+m(i-1)), m(i) = A000265(N+m(i-1)) using the previous odd part m(i-1) until some m(k) = 1. a(n) is defined as the count of the v(i) which are larger than 1. %C A179680 This is an algorithm to compute A002326 because the sum v(1)+v(2)+ ... +v(k) of the exponents is A002326(n-1). %C A179680 A179382(n) = 1 + the number of iterations taken by the algorithm when starting from N = 2n-1. - _Antti Karttunen_, Oct 02 2017 %H A179680 Antti Karttunen, <a href="/A179680/b179680.txt">Table of n, a(n) for n = 1..8192</a> %e A179680 For n = 9, 2*n-1 = 17, we have v_1 = v_2 = v_3 = 1, v_4 = 5. Thus a(9) = 1. %e A179680 For n = 10, 2*n-1 = 19, we have v_1 = 2, v_2 = 3, v_3 = v_4 = v_5 = 1, v_6 = v_7 = 2, v_8 = 1, v_9 = 5. Thus a(10) = 5. %p A179680 A179680 := proc(n) local l,m,a ,N ; N := 2*n-1 ; a := 0 ; l := A007814(N+1) ; m := A000265(N+1) ; if l > 1 then a := a+1 ; end if; while m <> 1 do l := A007814(N+m) ; if l > 1 then a := a+1 ; end if; m := A000265(N+m) ; end do: a ; end proc: %p A179680 seq(A179680(n),n=1..80) ; # _R. J. Mathar_, Apr 05 2011 %t A179680 a7814[n_] := IntegerExponent[n, 2]; %t A179680 a265[n_] := n/2^IntegerExponent[n, 2]; %t A179680 a[n_] := Module[{l, m, k, nn}, nn = 2n-1; k = 0; l = a7814[nn+1]; m = a265[nn+1]; If[l>1, k++]; While[m != 1, l = a7814[nn+m]; If[l>1, k++]; m = a265[nn+m]]; k]; %t A179680 Array[a, 80] (* _Jean-François Alcover_, Jul 30 2018, after _R. J. Mathar_ *) %o A179680 (Scheme) (define (A179680 n) (let ((x (+ n n -1))) (let loop ((s (- 1 (A000035 n))) (k 1)) (let ((m (A000265 (+ x k)))) (if (= 1 m) s (loop (+ s (if (> (A007814 (+ x m)) 1) 1 0)) m)))))) ;; _Antti Karttunen_, Oct 02 2017 %o A179680 (Sage) %o A179680 def A179680(n): %o A179680 s, m, N = 0, 1, 2*n - 1 %o A179680 while True: %o A179680 k = N + m %o A179680 v = valuation(k, 2) %o A179680 if v > 1: s += 1 %o A179680 m = k >> v %o A179680 if m == 1: break %o A179680 return s %o A179680 print([A179680(n) for n in (1..80)]) # _Peter Luschny_, Oct 07 2017 %Y A179680 Cf. A179676, A179460, A007814, A002326, A179382, A292239, A292265, A292266. %K A179680 nonn %O A179680 1,6 %A A179680 _Vladimir Shevelev_, Jul 24 2010