cp's OEIS Frontend

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.

A037227 If n = 2^m*k, k odd, then a(n) = 2*m+1.

This page as a plain text file.
%I A037227 #67 Nov 29 2022 02:46:53
%S A037227 1,3,1,5,1,3,1,7,1,3,1,5,1,3,1,9,1,3,1,5,1,3,1,7,1,3,1,5,1,3,1,11,1,3,
%T A037227 1,5,1,3,1,7,1,3,1,5,1,3,1,9,1,3,1,5,1,3,1,7,1,3,1,5,1,3,1,13,1,3,1,5,
%U A037227 1,3,1,7,1,3,1,5,1,3,1,9,1,3,1,5,1,3,1,7,1,3,1,5,1,3,1,11,1,3,1,5,1,3
%N A037227 If n = 2^m*k, k odd, then a(n) = 2*m+1.
%C A037227 Take the number of rightmost zeros in the binary expansion of n, double it, and increment it by 1. - _Ralf Stephan_, Aug 22 2013
%C A037227 Gives the maximum possible number of n X n complex Hermitian matrices with the property that all of their nonzero real linear combinations are nonsingular (see Adams et al. reference). - _Nathaniel Johnston_, Dec 11 2013
%H A037227 T. D. Noe, <a href="/A037227/b037227.txt">Table of n, a(n) for n=1..1024</a>
%H A037227 J. F. Adams, P. D. Lax, and R. S. Phillips, <a href="http://dx.doi.org/10.1090/S0002-9939-1965-0179183-6">On matrices whose real linear combinations are nonsingular</a>, Proceedings of the American Mathematical Society, 16:318-322, 1965.
%H A037227 D. B. Shapiro, <a href="http://www.jstor.org/stable/2589421">Problem 10456: Anticommuting Matrices</a>, Amer. Math. Monthly, 105 (1998), 565-566.
%H A037227 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>
%F A037227 a(n) = Sum_{d divides n} (-1)^(d+1)*mu(d)*tau(n/d). Multiplicative with a(p^e) = 2*e+1 if p = 2; 1 if p > 2. - _Vladeta Jovovic_, Apr 27 2003
%F A037227 a(n) = a(n-1)+(-1)^n*(a(floor(n/2))+1). - _Vladeta Jovovic_, Apr 27 2003
%F A037227 a(2*n) = a(n) + 2, a(2*n+1) = 1. a(n) = 2*A007814(n) + 1. - _Ralf Stephan_, Oct 07 2003
%F A037227 a(A005408(n)) = 1; a(A016825(n)) = 3; A017113(a(n)) = 5; A051062(a(n)) = 7. - _Reinhard Zumkeller_, Jun 30 2012
%F A037227 a((2*n-1)*2^p)  = 2*p+1, p  >= 0 and n >= 1. - _Johannes W. Meijer_, Feb 07 2013
%F A037227 From _Peter Bala_, Feb 07 2016: (Start)
%F A037227 a(n) = ( A002487(n-1) + A002487(n+1) )/A002487(n).
%F A037227 a(n*2^(k+1) + 2^k) = 2*k + 1 for n,k >= 0; thus a(2*n+1) = 1, a(4*n+2) = 3, a(8*n+4) = 5, a(16*n+8) = 7 and so on. Note the square array ( n*2^(k+1) + 2^k - 1 )n, k>=0 is the transpose of A075300.
%F A037227 G.f.: Sum_{n >= 0} (2*n + 1)*x^(2^n)/(1 - x^(2^(n+1))). (End)
%F A037227 a(n) = 2*floor(A002487(n-1)/A002487(n))+1 for n > 1. - _I. V. Serov_, Jun 15 2017
%F A037227 From _Amiram Eldar_, Nov 29 2022: (Start)
%F A037227 Dirichlet g.f.: zeta(s)*(2^s+1)/(2^s-1).
%F A037227 Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 3. (End)
%p A037227 nmax:=102: for p from 0 to ceil(simplify(log[2](nmax))) do for n from 1 to ceil(nmax/(p+2)) do a((2*n-1)*2^p):= 2*p+1: od: od: seq(a(n), n=1..nmax);  # _Johannes W. Meijer_, Feb 07 2013
%t A037227 a[n_] := Sum[(-1)^(d+1)*MoebiusMu[d]*DivisorSigma[0, n/d], {d, Divisors[n]}]; Table[a[n], {n, 1, 102}] (* _Jean-François Alcover_, Dec 31 2012, after _Vladeta Jovovic_ *)
%t A037227 f[n_]:=Module[{z=Last[Split[IntegerDigits[n,2]]]},If[Union[z]={0},2* Length[ z]+1,1]]; Array[f,110] (* _Harvey P. Dale_, Jun 16 2019, after Ralf Stephan *)
%t A037227 Table[2 IntegerExponent[n, 2] + 1, {n, 120}] (* _Vincenzo Librandi_, Jun 19 2019 *)
%o A037227 (Haskell)
%o A037227 a037227 = (+ 1) . (* 2) . a007814  -- _Reinhard Zumkeller_, Jun 30 2012
%o A037227 (R)
%o A037227 maxrow <- 6 # by choice
%o A037227 a <- 1
%o A037227 for(m in 0:maxrow){
%o A037227 for(k in 0:(2^m-1)) {
%o A037227    a[2^(m+1)    +k] <- a[2^m+k]
%o A037227    a[2^(m+1)+2^m+k] <- a[2^m+k]
%o A037227 }
%o A037227    a[2^(m+1)      ] <- a[2^(m+1)] + 2
%o A037227 }
%o A037227 a
%o A037227 # _Yosu Yurramendi_, May 21 2015
%o A037227 (PARI) a(n)=2*valuation(n,2)+1 \\ _Charles R Greathouse IV_, May 21 2015
%o A037227 (Magma) [2*Valuation(n, 2)+1: n in [1..120]]; // _Vincenzo Librandi_, Jun 19 2019
%o A037227 (Python)
%o A037227 def A037227(n): return ((~n & n-1).bit_length()<<1)+1 # _Chai Wah Wu_, Jul 05 2022
%Y A037227 Cf. A001511, A002487, A007814, A005408, A016825, A017113, A075300, A051062, A220466.
%K A037227 nonn,easy,nice,mult
%O A037227 1,2
%A A037227 _N. J. A. Sloane_
%E A037227 More terms from _Erich Friedman_