%I #22 Feb 17 2024 08:11:40
%S 3,7,13,19,31,33,57,59,79,83,133,101,183,157,177,203,307,219,381,271,
%T 343,377,553,349,571,523,601,529,871,501,993,747,843,887,973,743,1407,
%U 1105,1177,983,1723,987,1893,1309,1371,1613,2257,1293,2199,1663,2013
%N Sum of the orders of the elements in the dihedral group D_2n.
%H Amiram Eldar, <a href="/A086148/b086148.txt">Table of n, a(n) for n = 1..10000</a>
%F a(n) = 2*n + Sum_{d|n} d*phi(d). - _Vladeta Jovovic_, Aug 27 2003
%t f[p_, e_] := (p^(2*e+1)+1)/(p+1); a[1] = 3; a[n_] := 2*n + Times @@ (f @@@ FactorInteger[n]); Array[a, 50] (* _Amiram Eldar_, Jul 31 2019 *)
%o (Python)
%o from sympy import factorint, prod
%o a = lambda n: 2*n + prod((p**(2*e+1)+1)//(p+1) for p,e in factorint(n).items()) # _DarĂo Clavijo_, Feb 15 2024
%o (PARI) a(n) = 2*n + sumdivmult(n, d, d*eulerphi(d)); \\ _Michel Marcus_, Feb 16 2024
%Y Cf. A057660.
%K nonn
%O 1,1
%A Yuval Dekel (dekelyuval(AT)hotmail.com), Aug 25 2003
%E More terms from _Vladeta Jovovic_, Aug 27 2003