login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

a(n) is the number of even results of n mod k, for 1 < k < n.
1

%I #13 Aug 09 2021 18:17:45

%S 0,0,0,1,1,3,1,4,3,5,3,7,3,9,5,8,6,11,5,13,7,13,7,15,8,16,10,16,10,20,

%T 8,21,11,21,13,22,12,24,14,24,14,28,12,30,16,28,16,30,17,32,18,32,18,

%U 36,18,36,20,36,20,40,18,42,22,39,25,41,23,43,25,45,23,48,22,50

%N a(n) is the number of even results of n mod k, for 1 < k < n.

%H Harvey P. Dale, <a href="/A332801/b332801.txt">Table of n, a(n) for n = 1..1000</a>

%e n(7) = 1 because only 7 mod 5 = 2 is even.

%t Table[Total[Boole[EvenQ/@Mod[n,Range[2,n-1]]]],{n,80}] (* _Harvey P. Dale_, Aug 09 2021 *)

%o (PARI) a(n) = sum(k=2, n-1, ((n % k) % 2)== 0); \\ _Michel Marcus_, Feb 24 2020

%K nonn

%O 1,6

%A _Thomas Kerscher_, Feb 24 2020