login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A080146
Binary encoding of quadratic residue set for each prime. a(n) = A055094(A000040(n)).
3
1, 2, 9, 52, 738, 2829, 53643, 162438, 4023888, 166236537, 921787428, 48034254669, 935251837851, 2558696229078, 68055676507664, 2655011771373417, 210067141980993186, 831463105466530077, 42882922858578320598
OFFSET
1,2
FORMULA
a(A080148(n)) = A080117(A080148(n)).
MAPLE
with(numtheory, ithprime); A080146 := n -> A055094(ithprime(n));
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