|
|
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
Squares that are partial sums of A023896.
|
|
LINKS
|
|
|
EXAMPLE
|
a(3) = 25 is a term because A213544(6) = 25 = 5^2.
|
|
MAPLE
|
s:= 1: R:= 1: count:= 1:
for n from 2 to 10^6 do
s:= s + n/2*numtheory:-phi(n);
if issqr(s) then
count:= count+1; R:= R, s;
fi;
od:
R;
|
|
MATHEMATICA
|
f[1] = 1; f[n_] := n*EulerPhi[n]/2; seq[len_, max_] := Module[{s = {}, sum = 0, c = 0, n = 1}, While[c < len && n < max, sum += f[n]; n++; If[IntegerQ@Sqrt[sum], c++; AppendTo[s, sum]]]; s]; seq[4, 1000] (* Amiram Eldar, Apr 07 2022 *)
|
|
PROG
|
(Python)
from itertools import count, islice
from sympy import totient
def A352788_gen(): # generator of terms
c, m, ms = 0, 1, 1
for n in count(1):
c += 1 if n <= 2 else n*totient(n)//2
if c == ms:
yield c
else:
while c > ms:
ms += 2*m+1
m += 1
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,more
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|