OFFSET
1,4
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..65537
FORMULA
EXAMPLE
For n = 12, with divisors 1, 2, 3, 4, 6, 12, we select from the sequence gcd(1,12/1), gcd(2,12/2), gcd(3,12/3), gcd(4,12/4), gcd(6,12/6), gcd(12,12/12) = 1, 2, 1, 1, 2, 1 only those that are primes, namely the two 2's, and form their product, thus a(12) = 2*2 = 4.
For n = 100, with divisors 1, 2, 4, 5, 10, 20, 25, 50, 100, we select from the sequence gcd(1,100/1), gcd(2,100/2), gcd(4,100/4), gcd(5,100/5), gcd(10,100/10), gcd(20,100/20), gcd(25,100/25), gcd(50,100/50), gcd(100,100/100) = 1, 2, 1, 5, 10, 5, 1, 2, 1, only those that are primes, namely 2, 5, 5 and 2, thus a(100) = 2*5*5*2 = 100.
MATHEMATICA
a[n_]:=Product[GCD[i, n/i]^Boole[PrimeQ[GCD[i, n/i]]], {i, Divisors[n]}]; Array[a, 105] (* Stefano Spezia, Feb 20 2024 *)
PROG
(PARI) A295666(n) = { my(m=1, p); fordiv(n, d, p = gcd(d, n/d); if(isprime(p), m *= p)); m; };
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Nov 26 2017
STATUS
approved