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.

A165918 a(n) = number of squarefree quadratic non-residues of n.

Original entry on oeis.org

0, 0, 1, 2, 2, 2, 3, 5, 4, 3, 4, 7, 5, 5, 7, 10, 7, 8, 6, 11, 10, 8, 10, 15, 10, 8, 11, 15, 10, 12, 12, 18, 15, 11, 15, 21, 13, 13, 19, 25, 16, 19, 14, 25, 24, 17, 19, 29, 19, 18, 21, 28, 17, 22, 25, 33, 25, 18, 19, 35, 21, 22, 32, 34, 28, 29, 20, 36, 33, 31, 29, 44, 26, 23
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A165916.

Programs

  • PARI
    squares(n) = {local(s = Set()); for (j=1, n, s = setunion(s, Set(j^2 % n));); return (s);}
    qnonr(n) = {local(s = Set()); sq = squares(n);for (j=0, n-1, if (length(setintersect(Set(j), sq))==0, s = setunion(s, Set(j)));); return (s);}
    a(n) = {s = Set(); qnr = qnonr(n); for (j=1, #qnr, if (issquarefree(eval(qnr[j])), s = setunion(s, Set(qnr[j])));); return (#s);}  \\ Michel Marcus, Jul 23 2013

Extensions

a(1) added by Christopher Hunt Gribble, Oct 05 2009