OFFSET
1,1
COMMENTS
a(n) <= n + 1; the inequality is strict iff n is divisible by 9 or by a prime congruent to 1 mod 3. - Robert Israel, May 27 2014
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(7) = 2 because 2^3 is congruent to 1 (mod 7).
MAPLE
A:= n -> min(select(t -> type((t^3-1)/n, integer), [$2 .. n+1]));
map(A, [$1 .. 1000]); # Robert Israel, May 27 2014
MATHEMATICA
f[n_] := Block[{x = 2}, While[Mod[x^3 - 1, n] != 0, x++]; x]; Array[f, 79] (* Robert G. Wilson v, Mar 29 2016 *)
PROG
(MATLAB) m = 2; while mod(m^3 - 1, n); m = m + 1; end; m
(PARI) a(n) = my(k = 2); while(Mod(k, n)^3 != 1, k++); k; \\ Michel Marcus, Mar 30 2016
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
David Wasserman, Mar 05 2004
STATUS
approved