OFFSET
1,3
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
MAPLE
f:= proc(p) local x;
for x from 1 do if numtheory:-order(x, p) = (p-1)/2 then return x fi od
end proc:
f(2):= 1:
seq(f(ithprime(n)), n=1..1000); # Robert Israel, Jan 14 2016
MATHEMATICA
f[p_] := Module[{x}, For[x = 1, True, x++, If[MultiplicativeOrder[x, p] == (p - 1)/2, Return[x]]]];
f[2] = 1;
f /@ Prime[Range[100]] (* Jean-François Alcover, Jul 17 2020, after Maple *)
CROSSREFS
KEYWORD
nonn
AUTHOR
EXTENSIONS
More terms from David W. Wilson, Aug 15 1996
Offset changed by Robert Israel, Jan 14 2016
STATUS
approved