login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 59th year, we have over 358,000 sequences, and we’ve crossed 10,300 citations (which often say “discovered thanks to the OEIS”).

Other ways to Give
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A037227 If n = 2^m*k, k odd, then a(n) = 2*m+1. 14
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, 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, 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 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

Take the number of rightmost zeros in the binary expansion of n, double it, and increment it by 1. - Ralf Stephan, Aug 22 2013

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

LINKS

T. D. Noe, Table of n, a(n) for n=1..1024

J. F. Adams, P. D. Lax, and R. S. Phillips, On matrices whose real linear combinations are nonsingular, Proceedings of the American Mathematical Society, 16:318-322, 1965.

D. B. Shapiro, Problem 10456: Anticommuting Matrices, Amer. Math. Monthly, 105 (1998), 565-566.

Index entries for sequences related to binary expansion of n

FORMULA

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

a(n) = a(n-1)+(-1)^n*(a(floor(n/2))+1). - Vladeta Jovovic, Apr 27 2003

a(2*n) = a(n) + 2, a(2*n+1) = 1. a(n) = 2*A007814(n) + 1. - Ralf Stephan, Oct 07 2003

a(A005408(n)) = 1; a(A016825(n)) = 3; A017113(a(n)) = 5; A051062(a(n)) = 7. - Reinhard Zumkeller, Jun 30 2012

a((2*n-1)*2^p) = 2*p+1, p >= 0 and n >= 1. - Johannes W. Meijer, Feb 07 2013

From Peter Bala, Feb 07 2016: (Start)

a(n) = ( A002487(n-1) + A002487(n+1) )/A002487(n).

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.

G.f.: Sum_{n >= 0} (2*n + 1)*x^(2^n)/(1 - x^(2^(n+1))). (End)

a(n) = 2*floor(A002487(n-1)/A002487(n))+1 for n > 1. - I. V. Serov, Jun 15 2017

From Amiram Eldar, Nov 29 2022: (Start)

Dirichlet g.f.: zeta(s)*(2^s+1)/(2^s-1).

Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 3. (End)

MAPLE

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

MATHEMATICA

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 *)

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 *)

Table[2 IntegerExponent[n, 2] + 1, {n, 120}] (* Vincenzo Librandi, Jun 19 2019 *)

PROG

(Haskell)

a037227 = (+ 1) . (* 2) . a007814 -- Reinhard Zumkeller, Jun 30 2012

(R)

maxrow <- 6 # by choice

a <- 1

for(m in 0:maxrow){

for(k in 0:(2^m-1)) {

a[2^(m+1) +k] <- a[2^m+k]

a[2^(m+1)+2^m+k] <- a[2^m+k]

}

a[2^(m+1) ] <- a[2^(m+1)] + 2

}

a

# Yosu Yurramendi, May 21 2015

(PARI) a(n)=2*valuation(n, 2)+1 \\ Charles R Greathouse IV, May 21 2015

(Magma) [2*Valuation(n, 2)+1: n in [1..120]]; // Vincenzo Librandi, Jun 19 2019

(Python)

def A037227(n): return ((~n & n-1).bit_length()<<1)+1 # Chai Wah Wu, Jul 05 2022

CROSSREFS

Cf. A001511, A002487, A007814, A005408, A016825, A017113, A075300, A051062, A220466.

Sequence in context: A325523 A352483 A016475 * A056753 A243158 A154723

Adjacent sequences: A037224 A037225 A037226 * A037228 A037229 A037230

KEYWORD

nonn,easy,nice,mult,changed

AUTHOR

N. J. A. Sloane

EXTENSIONS

More terms from Erich Friedman

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified December 5 06:35 EST 2022. Contains 358582 sequences. (Running on oeis4.)