OFFSET
1,2
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
Since phi(67) = 66 = 6*(2*6-1), a hexagonal number, 67 is a term of this sequence.
MAPLE
ishex:= proc(y) issqr(1+8*y) and sqrt(1+8*y) mod 4 = 3 end proc:
select(t -> ishex(NumberTheory:-phi(t)), [$1..2000]); # Robert Israel, Dec 23 2025
MATHEMATICA
Select[Range[2500], IntegerQ[(1 + Sqrt[1 + 8 EulerPhi[#]])/4] &]
PROG
(PARI) isok(m) = ispolygonal(eulerphi(m), 6); \\ Michel Marcus, Sep 09 2025
(Python)
from math import isqrt
from sympy import totient as phi
ok = lambda n: (d:=1+8*phi(n)) == (s:=isqrt(d))**2 and (1+s)%4==0
print([m for m in range(1, 2500) if ok(m)]) # Aidan Chen, Sep 19 2025
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Aidan Chen, Sep 07 2025
STATUS
approved
