%I #15 Mar 31 2012 10:22:33
%S 5,4,17,26,13,18,65,28,101,122,49,22,165,76,257,290,109,68,401,67,485,
%T 530,193,626,529,244,177,842,301,439,1025,364,1157,226,433,581,429,22,
%U 1601,1682,361,423,1937,676,2117,2210,769,1047,2501,868,529,2810,973,3026,961,292,3365,3482,1201,1660
%N Least m>1 such that m^3 mod n^2 is 1.
%C For n = 2, 4, 5 and 8 there are the obvious solutions n^2 + 1, but these are not minimal for n = 3, 6, 7 and 9.
%C Which other n have least m less than n^2 + 1?
%C There will be a solution less than n^2 + 1 when n is divisible by 3 or by any prime == 1 (mod 3). - Franklin T. Adams-Watters, May 17 2011.
%e The obvious case for 4 is 4^2 +1 = 17 and 17^3=4913 == 1 (mod 16).
%e For 6 the least m^3 is not the obvious m=36^2+1=37 but m=13 to give 13^3=2197 == 1 (mod 49).
%o (PARI) a(n)=for(k=2,n^2+1,if(Mod(k,n^2)^3==1,return(k)))
%K nonn
%O 2,1
%A _J. M. Bergot_, May 17 2011
%E Corrected, extended, and edited by _Franklin T. Adams-Watters_, May 17 2011