OFFSET
1,4
COMMENTS
Tsangaris proves that a(n)=0 iff n is prime (or 1) and a(n)>0 iff n is composite.
LINKS
Panayiotis G. Tsangaris, Prime numbers and cyclotomy, Acta Academiae Paedagogicae Agriensis, Sectio Mathematicae 31 (2004) 3-10.
PROG
(PARI) a(n) = if(iscomposite(n), my(m = sqrtint(n)); 4*sum(i=1, n-1, sum(j=1, m, (j*i)\n)) - (m-1)*m*(n-1), 0)
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Marcus, Feb 04 2017
EXTENSIONS
Edited by Robert Israel, Feb 07 2017
STATUS
approved