OFFSET
1,6
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..10000
FORMULA
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
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, May 19 2004
STATUS
approved