OFFSET
1,2
MATHEMATICA
A055094[n_] := With[{rr = Table[Mod[k^2, n], {k, 1, n-1}] // Union}, Boole[MemberQ[rr, #]]& /@ Range[n-1]] // FromDigits[#, 2]&;
a[n_] := A055094[Prime[n]];
Table[a[n], {n, 1, 20}] (* Jean-François Alcover, Sep 20 2022 *)
PROG
(PARI) a(n) = my(p=prime(n)); sum(k=1, p-1, 2^(k-1)*(0<sum(i=1, p-1, i^2%p==p-k))); \\ Michel Marcus, Sep 20 2022; after A055094
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Feb 11 2003
STATUS
approved