kill(all)$

    Find all positive integer numbers n such that
    for any positive integer a relatively prime to n
    the number 2*n^2 divides a^n -1.

van=facebook.com/LearningCalculus$

coprime(a,n):=gcd(a,n)=1;

divides(a,n):=mod((a^n-1)/(2*n^2),2)= 0;

L:[]$

N:5$

hits:0$

for a: 2 thru N do
    for n: 2 thru N do
            if gcd(a,n) = 1 then 
            (print(a,n,gcd(a,n)),hits:hits+1);

print (hits);