A322361 a(n) = gcd(n, A003961(n)), where A003961 is completely multiplicative with a(prime(k)) = prime(k+1).
1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 3, 1, 1, 5, 1, 1, 3, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 15, 1, 1, 1, 1, 7, 9, 1, 1, 1, 1, 1, 3, 1, 1, 5, 1, 1, 3, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 15, 1, 1, 1, 1, 1, 3, 1, 1, 1, 7, 1, 9, 1, 1, 5, 1, 11, 3, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 15, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 3, 1, 1, 35
Offset: 1
Keywords
Links
- Antti Karttunen, Table of n, a(n) for n = 1..20000
Programs
-
Mathematica
a[n_] := If[n == 1, 1, GCD[n, Times@@(NextPrime[First[#]]^Last[#] &/@FactorInteger[n])]]; Array[a, 100] (* Amiram Eldar, Dec 05 2018 *)
-
PARI
A003961(n) = my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); \\ From A003961 A322361(n) = gcd(n, A003961(n));
-
Python
from math import gcd, prod from sympy import nextprime, factorint def A322361(n): return gcd(n,prod(nextprime(p)**e for p, e in factorint(n).items())) # Chai Wah Wu, Dec 26 2022
Comments