login
A093803
Greatest odd proper divisor of n; a(1)=1.
7
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, 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, 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
OFFSET
1,6
LINKS
FORMULA
a(n) <= A000265(n);
a(n) = n / (A020639(n)*(n mod 2) + A006519(n)*(1 - n mod 2)).
a(n) = A000265(A032742(n)). - Antti Karttunen, Aug 12 2017
MAPLE
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
MATHEMATICA
Join[{1}, Table[Max[Select[Most[Divisors[n]], OddQ]], {n, 2, 90}]] (* Harvey P. Dale, Apr 10 2012 *)
odd[n_] := n/2^IntegerExponent[n, 2]; a[n_] := odd[n/FactorInteger[n][[1, 1]]]; Array[a, 100] (* Amiram Eldar, Jul 04 2022 *)
PROG
(Scheme) (define (A093803 n) (/ n (if (odd? n) (A020639 n) (A006519 n)))) ;; Antti Karttunen, Aug 12 2017
(PARI) a(n)= my(x=if(n==1, 1, n/factor(n)[1, 1])); x >> valuation(x, 2); \\ Michel Marcus, Oct 26 2022
(Python)
from math import prod
from sympy import factorint
def A093803(n):
if n == 1: return 1
f = factorint(n)
m = min(f)
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
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, May 19 2004
STATUS
approved