OFFSET
1,1
COMMENTS
No prime k belongs to the sequence, because for prime k, phi(k) = k-1 and consecutive numbers are coprime, i.e. gcd(k, k-1) = 1, which is not prime.
All squares of primes (p^2) belong to the sequence, because phi(p^2) = p^2 - p and gcd(p^2, p^2 - p) = p, which is prime.
Squarefree terms are A350586. - Robert Israel, Mar 20 2026
EXAMPLE
For k = 9: phi(9) = 6 and gcd(9, 6) = 3, which is prime, so 9 is a term.
For k = 8: phi(8) = 4 and gcd(8, 4) = 4, which is not prime, so 8 is not a term.
MAPLE
filter:= k -> isprime(igcd(k, NumberTheory:-phi(k))):
select(filter, [$1..300]); # Robert Israel, Mar 20 2026
MATHEMATICA
Select[Range[210], PrimeQ[GCD[#, EulerPhi[#]]] &] (* Amiram Eldar, Mar 20 2026 *)
PROG
(Python)
from sympy import totient, gcd, isprime
def ok(k): return isprime(gcd(k, totient(k)))
print([k for k in range(1, 300) if ok(k)])
(PARI) isok(k) = isprime(gcd(k, eulerphi(k))); \\ Michel Marcus, Mar 20 2026
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Aied Sulaiman, Mar 20 2026
STATUS
approved
