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”).

Binary encoding of quadratic residue set for each prime. a(n) = A055094(A000040(n)).
3

%I #9 Sep 20 2022 07:52:35

%S 1,2,9,52,738,2829,53643,162438,4023888,166236537,921787428,

%T 48034254669,935251837851,2558696229078,68055676507664,

%U 2655011771373417,210067141980993186,831463105466530077,42882922858578320598

%N Binary encoding of quadratic residue set for each prime. a(n) = A055094(A000040(n)).

%F a(A080148(n)) = A080117(A080148(n)).

%p with(numtheory,ithprime); A080146 := n -> A055094(ithprime(n));

%t A055094[n_] := With[{rr = Table[Mod[k^2, n], {k, 1, n-1}] // Union}, Boole[MemberQ[rr, #]]& /@ Range[n-1]] // FromDigits[#, 2]&;

%t a[n_] := A055094[Prime[n]];

%t Table[a[n], {n, 1, 20}] (* _Jean-François Alcover_, Sep 20 2022 *)

%o (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

%Y Cf. A000040, A055094, A080117, A080148.

%K nonn

%O 1,2

%A _Antti Karttunen_, Feb 11 2003