Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #13 Dec 12 2023 18:20:37
%S 0,0,0,2,0,2,0,2,4,2,0,6,0,2,4,8,0,8,0,8,4,4,0,12,8,4,4,8,0,16,0,8,4,
%T 4,8,22,0,6,8,18,0,18,0,10,16,6,0,22,12,14,8,10,0,18,8,22,8,6,0,30,0,
%U 6,20,24,8,20,0,16,8,28,0,36,0,8,16,16,12,20,0,32
%N a(n) = 4*Sum_{i=1..n-1} Sum_{j=1..m} floor((j*i)/n) - (m-1)*m*(n-1) where m is floor(sqrt(n)).
%C Tsangaris proves that a(n)=0 iff n is prime (or 1) and a(n)>0 iff n is composite.
%H Panayiotis G. Tsangaris, <a href="http://ami.ektf.hu/uploads/papers/finalpdf/AAPASM_31_from3to10.pdf">Prime numbers and cyclotomy</a>, Acta Academiae Paedagogicae Agriensis, Sectio Mathematicae 31 (2004) 3-10.
%o (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)
%K nonn
%O 1,4
%A _Michel Marcus_, Feb 04 2017
%E Edited by _Robert Israel_, Feb 07 2017