OFFSET
1,2
COMMENTS
Highest power of smallest prime dividing n. - Reinhard Zumkeller, Apr 09 2015
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000 (first 1000 terms from T. D. Noe)
FORMULA
a(n) = A141809(n,1). - Reinhard Zumkeller, Jun 04 2012
a(n) = n / A028234(n). - Antti Karttunen, May 29 2017
EXAMPLE
From Muniru A Asiru, Jan 27 2018: (Start)
If n=10, then a(10) = 2 since 10 = 2^1*5^1.
If n=16, then a(16) = 16 since 16 = 2^4.
If n=29, then a(29) = 29 since 29 = 29^1.
(End)
MAPLE
A028233 := proc(n)
local spf, pf;
if n = 1 then
return 1 ;
end if;
spf := A020639(n) ;
for pf in ifactors(n)[2] do
if pf[1] = spf then
return pf[1]^pf[2] ;
end if;
end do:
end proc: # R. J. Mathar, Jul 09 2016
# second Maple program:
a:= n-> `if`(n=1, 1, (i->i[1]^i[2])(sort(ifactors(n)[2])[1])):
seq(a(n), n=1..100); # Alois P. Heinz, Jan 29 2018
MATHEMATICA
a[n_] := Power @@ First[ FactorInteger[n]]; Table[a[n], {n, 1, 86}] (* Jean-François Alcover, Dec 01 2011 *)
PROG
(Haskell)
a028233 = head . a141809_row
-- Reinhard Zumkeller, Jun 04 2012, Aug 17 2011
(PARI) a(n)=if(n>1, n=factor(n); n[1, 1]^n[1, 2], 1) \\ Charles R Greathouse IV, Apr 26 2012
(Python)
from sympy import factorint
def a(n):
f = factorint(n)
return 1 if n==1 else min(f)**f[min(f)] # Indranil Ghosh, May 12 2017
(Scheme)
;; Naive implementation of A020639 is given under that entry. All of these functions could be also defined with definec to make them faster on the later calls. See http://oeis.org/wiki/Memoization#Scheme
(define (A028233 n) (if (< n 2) n (let ((lpf (A020639 n))) (let loop ((m lpf) (n (/ n lpf))) (cond ((not (zero? (modulo n lpf))) m) (else (loop (* m lpf) (/ n lpf)))))))) ;; Antti Karttunen, May 29 2017
(GAP) List(List(List(List([1..10^3], Factors), Collected), i -> i[1]), j -> j[1]^j[2]); # Muniru A Asiru, Jan 27 2018
CROSSREFS
KEYWORD
nonn,nice,easy
AUTHOR
EXTENSIONS
Name edited to include a(1) = 1 by Franklin T. Adams-Watters, Jan 27 2018
STATUS
approved