cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A280109 a(n) is the decimal value corresponding to the binary representation of the distribution of quadratic residues (value=1) and non-quadratic residues (value=0) mod n, where numbers are ordered left to right from 0 to n-1.

This page as a plain text file.
%I A280109 #35 Jun 08 2024 15:44:45
%S A280109 1,3,6,12,25,54,116,200,402,825,1762,3204,6925,14964,25904,51264,
%T A280109 119179,206226,424582,836616,1648692,3610338,8218192,13125760,
%U A280109 26518825,56736525,105587858,210503748,434671993,848848176,1995529252,3359686720,7257392290,15621149067
%N A280109 a(n) is the decimal value corresponding to the binary representation of the distribution of quadratic residues (value=1) and non-quadratic residues (value=0) mod n, where numbers are ordered left to right from 0 to n-1.
%C A280109 Sort mod n numbers {0,1,...,n-1} in ascending order. For each modular number i, write 1 if i is a quadratic residue mod n (i.e., it has a square root), else write 0. The corresponding n-bit number is a(n).
%H A280109 Adnan Baysal, <a href="/A280109/b280109.txt">Table of n, a(n) for n = 1..1000</a>
%e A280109 For n = 10, quadratic residues are 0, 1, 4, 5, 6, 9 so a(10) is 1100111001 in binary which is 825.
%t A280109 f[n_] := Total[ 2^(n -1 -Union[ Mod[ Range[0, n - 1]^2, n]] )]; Array[f, 34] (* _Robert G. Wilson v_, Dec 28 2016 *)
%o A280109 (Python)
%o A280109 def qr_distribution(N):
%o A280109     QR = []
%o A280109     QN = []
%o A280109     for i in range(N):
%o A280109         t = (i*i)%N
%o A280109         if t not in QR: QR.append(t)
%o A280109     for i in range(N):
%o A280109         if i not in QR: QN.append(i)
%o A280109     out = 0
%o A280109     for i in range(0,N):
%o A280109         out *= 2
%o A280109         if i in QR: out += 1
%o A280109     return out
%Y A280109 Cf. A055094, A080117, A080146, A096008.
%K A280109 nonn,base
%O A280109 1,2
%A A280109 _Adnan Baysal_, Dec 26 2016