Gasp ! I'm really bored and wrote a short C code to test the results. It's confirmed 31 ! Compile and test it for yourself !
#include <stdio.h>
int main()
{
int i, j, total=0, switches[1001] = {0} ;
for (i=1; i<1001; i++) {
for (j=i; j<1001; j+=i ) {...