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

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A093803 Greatest odd proper divisor of n; a(1)=1. 7

%I #26 Oct 27 2022 19:54:59

%S 1,1,1,1,1,3,1,1,3,5,1,3,1,7,5,1,1,9,1,5,7,11,1,3,5,13,9,7,1,15,1,1,

%T 11,17,7,9,1,19,13,5,1,21,1,11,15,23,1,3,7,25,17,13,1,27,11,7,19,29,1,

%U 15,1,31,21,1,13,33,1,17,23,35,1,9,1,37,25,19,11,39,1,5,27,41,1,21,17

%N Greatest odd proper divisor of n; a(1)=1.

%H Antti Karttunen, <a href="/A093803/b093803.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) <= A000265(n);

%F a(n) = n / (A020639(n)*(n mod 2) + A006519(n)*(1 - n mod 2)).

%F a(n) = A000265(A032742(n)). - _Antti Karttunen_, Aug 12 2017

%p with(numtheory): a := n -> max(1,op(select(k->type(k,odd),divisors(n) minus {n}))): seq(a(n),n=1..85); # _Peter Luschny_, Feb 02 2015

%t Join[{1},Table[Max[Select[Most[Divisors[n]],OddQ]],{n,2,90}]] (* _Harvey P. Dale_, Apr 10 2012 *)

%t odd[n_] := n/2^IntegerExponent[n, 2]; a[n_] := odd[n/FactorInteger[n][[1, 1]]]; Array[a, 100] (* _Amiram Eldar_, Jul 04 2022 *)

%o (Scheme) (define (A093803 n) (/ n (if (odd? n) (A020639 n) (A006519 n)))) ;; _Antti Karttunen_, Aug 12 2017

%o (PARI) a(n)= my(x=if(n==1, 1, n/factor(n)[1, 1])); x >> valuation(x, 2); \\ _Michel Marcus_, Oct 26 2022

%o (Python)

%o from math import prod

%o from sympy import factorint

%o def A093803(n):

%o if n == 1: return 1

%o f = factorint(n)

%o m = min(f)

%o return prod(p**(0 if p == 2 else e-1 if p == m else e) for p,e in f.items()) # _Chai Wah Wu_, Oct 27 2022

%Y Cf. A000265, A005408, A006519, A006530, A020639, A032742, A078701.

%K nonn

%O 1,6

%A _Reinhard Zumkeller_, May 19 2004

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 April 24 20:08 EDT 2024. Contains 371963 sequences. (Running on oeis4.)