A088387 Prime corresponding to largest prime power factor of n, a(1)=1.
1, 2, 3, 2, 5, 3, 7, 2, 3, 5, 11, 2, 13, 7, 5, 2, 17, 3, 19, 5, 7, 11, 23, 2, 5, 13, 3, 7, 29, 5, 31, 2, 11, 17, 7, 3, 37, 19, 13, 2, 41, 7, 43, 11, 3, 23, 47, 2, 7, 5, 17, 13, 53, 3, 11, 2, 19, 29, 59, 5, 61, 31, 3, 2, 13, 11, 67, 17, 23, 7, 71, 3, 73, 37, 5, 19, 11, 13, 79, 2, 3, 41, 83, 7, 17
Offset: 1
Examples
a(6) = a(2*3) = 3 because 3^1 > 2^1; a(36) = a((2^2)(3^2)) = 3 because 3^2 > 2^2; a(12) = a((2^2)*3) = 2 because 2^2 > 3^1.
Links
- Antti Karttunen, Table of n, a(n) for n = 1..65537
Programs
-
Mathematica
f[n_] := Sort[ {#[[1]]^#[[2]], #[[1]]} & /@ FactorInteger@ n][[ -1, 2]]; Array[f, 85] (* Robert G. Wilson v, Nov 05 2007 *) a[n_] := MaximalBy[FactorInteger[n], Power @@ # &][[1, 1]]; Array[a, 85] (* Jean-François Alcover, Jun 27 2019 *)
-
PARI
A088387(n) = if(1==n,1,my(f=factor(n),p=0); isprimepower(vecmax(vector(#f[, 1], i, f[i, 1]^f[i, 2])),&p); (p)); \\ Antti Karttunen, Jul 22 2018
-
Python
from sympy import factorint def A088387(n): return max(((p**e,p) for p, e in factorint(n).items()), default=(0,1))[1] # Chai Wah Wu, Apr 17 2023
Formula
a(n*a(n)) = a(n). - Sam Alexander, Dec 15 2003
Extensions
More terms from Ray Chandler, Dec 20 2003
Edited by N. J. A. Sloane at the suggestion of Stefan Steinerberger, Nov 04 2007
Comments