OFFSET
2,1
MAPLE
MATHEMATICA
A055094[n_] := With[{rr = Table[Mod[k^2, n], {k, 1, n-1}] // Union}, Boole[ MemberQ[rr, #]] & /@ Range[n-1]] // FromDigits[#, 2]&;
A080261[n_] := Module[{bb = IntegerDigits[n, 2]}, lg = Length[bb]; Do[ bb[[i]] = 1 - bb[[i]], {i, lg, lg - Floor[lg/2] + 1, -1}]; FromDigits[ bb, 2]];
a[n_] := Module[{c, p = Prime[n]}, c = A055094[p]; If[Mod[p, 4] == 3, c, A080261[c]]]; Table[a[n], {n, 2, 20}] (* Jean-François Alcover, Mar 05 2016, adapted from Maple *)
PROG
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Feb 11 2003
STATUS
approved