OFFSET
1,2
COMMENTS
When k is prime (denote as p), phi(p) = p - 1, rad(p) = p, and psi(p) = p + 1, so phi(p) + rad(p) + psi(p) = 3*p. Therefore, A000040 is a subsequence.
When k = p^m (m>=1) with p prime, phi(p^m) = (p-1)*p^(m-1), rad(p^m) = p, and psi(p^m) = (p+1)*p^(m-1), so phi(p^m) + rad(p^m) + psi(p^m) = 2*p^m + p = p * (1+2*p^(m-1)). Then, this expression is a multiple of 3 iff p == 0 or 1 (mod 3), equivalently iff p is a generalized cuban prime of A007645. Therefore, as 1 is also a term, every sequence {p^m, p in A007645, m>=0} is a subsequence. See crossrefs section. - Bernard Schott, Jan 25 2023 after an observation of Alois P. Heinz
EXAMPLE
8 is a term because 4+2+12 is divisible by 3.
MATHEMATICA
q[n_] := Module[{f = FactorInteger[n], p, e}, p = f[[;; , 1]]; e = f[[;; , 2]]; Divisible[Times @@ ((p - 1)*p^(e - 1)) + Times @@ p + Times @@ ((p + 1)*p^(e - 1)), 3]]; Select[Range[170], q] (* Amiram Eldar, Dec 15 2022 *)
PROG
(Python)
from sympy.ntheory.factor_ import totient
from sympy import primefactors, prod
def rad(n): return 1 if n < 2 else prod(primefactors(n))
def psi(n):
plist = primefactors(n)
return n*prod(p+1 for p in plist)//prod(plist)
# Output display terms.
for n in range(1, 170):
if(0 == (totient(n) + rad(n) + psi(n)) % 3):
print(n, end = ", ")
(PARI) isok(m) = ((eulerphi(m) + factorback(factorint(m)[, 1]) + m*sumdiv(m, d, moebius(d)^2/d)) % 3) == 0; \\ Michel Marcus, Dec 27 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Torlach Rush, Dec 14 2022
STATUS
approved