close
login
A384997
Numbers m such that phi(m) is a heptagonal number.
1
1, 2, 19, 27, 38, 54, 113, 145, 149, 226, 232, 290, 298, 348, 361, 541, 589, 617, 667, 722, 813, 837, 891, 971, 1082, 1084, 1178, 1234, 1289, 1334, 1363, 1501, 1626, 1674, 1782, 1783, 1942, 2133, 2357, 2578, 2726, 3002, 3011, 3187, 3566, 3869, 4069, 4266, 4685, 4714, 4823
OFFSET
1,2
EXAMPLE
Since phi(54) = 18 = (5 * 3^2 - 3 * 3) / 2, a heptagonal number, 54 is a term of this sequence.
MATHEMATICA
Select[Range[5000], IntegerQ[(3 + Sqrt[9 + 40 EulerPhi[#]])/10] &]
PROG
(PARI) isok(m) = ispolygonal(eulerphi(m), 7); \\ Michel Marcus, Sep 09 2025
(Python)
from math import isqrt
from sympy import totient as phi
ok = lambda n: (d:=9+40*phi(n)) == (s:=isqrt(d))**2 and (3+s)%10==0
print([m for m in range(1, 5000) if ok(m)]) # Aidan Chen, Sep 19 2025
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Aidan Chen, Sep 07 2025
STATUS
approved