OFFSET
1,3
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
Ovidiu D. Bagdasar and Peter J. Larcombe, On the Number of Complex Horadam Sequences with a Fixed Period, Fib. Q. 51(4), 2013, 339-347.
FORMULA
a(n) = Sum_{k1<k2, lcm(k1, k2)=n} phi(k1)*phi(k2) + phi(n)*(phi(n)-1)/2, for n>= 2. See link.
MAPLE
N:= 200: # for a(1)..a(N)
V:= Vector(N, n -> numtheory:-phi(n)*(numtheory:-phi(n)-1)/2):
for k1 from 1 to N do
p1:= numtheory:-phi(k1);
for k2 from k1+1 to N do
n:= ilcm(k1, k2);
if n <= N then V[n]:= V[n] + p1*numtheory:-phi(k2) fi;
od:
od:
V[1]:= 1:
convert(V, list); # Robert Israel, Dec 06 2020
PROG
(PARI) a(n) = if (n==1, 1, eulerphi(n)*(eulerphi(n)-1)/2 + sum(k2=1, n, sum(k1=1, k2-1, if (lcm(k1, k2)==n, eulerphi(k1)*eulerphi(k2)))));
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Marcus, Sep 30 2019
STATUS
approved