OFFSET

1,3

EXAMPLE

50 = 2^1 *5^2. 1 is the prime power closest to 2 and smaller than 2. 23 is the prime power closest to 5^2 and smaller than 5^2. So a(50) = 1*23 = 23.

PROG

(PARI) { a(n) = local(f, r, k, d); f=factorint(n); r=1; for(i=1, matsize(f)[1], k=f[i, 1]^f[i, 2]-1; while(k>1 && !isprime(k) && (!ispower(k, , &d)||!isprime(d)), k--); r*=k); r } \\ Max Alekseyev, Mar 26 2007

(Sage) def A120636(n): return prod((previous_prime_power(p**m) for p, m in factor(n))) if n > 1 else 1 # D. S. McNeil, Feb 09 2011

CROSSREFS

KEYWORD

nonn,mult

AUTHOR

Leroy Quet, Jun 22 2006

EXTENSIONS

More terms from Max Alekseyev, Mar 26 2007

STATUS

approved