A028233 If n = p_1^e_1 * ... * p_k^e_k, p_1 < ... < p_k primes, then a(n) = p_1^e_1, with a(1) = 1.
1, 2, 3, 4, 5, 2, 7, 8, 9, 2, 11, 4, 13, 2, 3, 16, 17, 2, 19, 4, 3, 2, 23, 8, 25, 2, 27, 4, 29, 2, 31, 32, 3, 2, 5, 4, 37, 2, 3, 8, 41, 2, 43, 4, 9, 2, 47, 16, 49, 2, 3, 4, 53, 2, 5, 8, 3, 2, 59, 4, 61, 2, 9, 64, 5, 2, 67, 4, 3, 2, 71, 8, 73, 2, 3, 4, 7, 2, 79, 16, 81, 2, 83, 4, 5, 2
Offset: 1
Examples
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)
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..10000 (first 1000 terms from T. D. Noe)
Crossrefs
Programs
-
GAP
List(List(List(List([1..10^3], Factors), Collected), i -> i[1]), j -> j[1]^j[2]); # Muniru A Asiru, Jan 27 2018
-
Haskell
a028233 = head . a141809_row -- Reinhard Zumkeller, Jun 04 2012, Aug 17 2011
-
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 *)
-
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
Formula
a(n) = A141809(n,1). - Reinhard Zumkeller, Jun 04 2012
a(n) = n / A028234(n). - Antti Karttunen, May 29 2017
Extensions
Name edited to include a(1) = 1 by Franklin T. Adams-Watters, Jan 27 2018
Comments