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.

A257302 Number of 4th power nonresidues modulo n.

Original entry on oeis.org

0, 0, 1, 2, 3, 2, 3, 6, 5, 6, 5, 8, 9, 6, 11, 14, 12, 10, 9, 16, 13, 10, 11, 20, 19, 18, 17, 20, 21, 22, 15, 28, 21, 24, 27, 28, 27, 18, 31, 36, 30, 26, 21, 32, 37, 22, 23, 44, 27, 38, 41, 44, 39, 34, 43, 48, 37, 42, 29, 52, 45, 30, 47, 58, 57, 42, 33, 58
Offset: 1

Views

Author

Stanislav Sykora, Apr 19 2015

Keywords

Comments

a(n) is the number of values r, 0<=r=0, (m^p)%n != r.

Crossrefs

Cf. A095972 (p=2), A257301 (p=3), A257303 (p=5).

Programs

  • Mathematica
    Table[Length[Complement[Range[n - 1], Union[Mod[Range[n]^4, n]]]], {n, 100}] (* Vincenzo Librandi, Apr 20 2015 *)
  • PARI
    nrespowp(n,p) = {my(v=vector(n),d=0);
      for(r=0,n-1,v[1+(r^p)%n]+=1);
      for(k=1,n,if(v[k]==0,d++));
      return(d);}
    a(n) = nrespowp(n,4)

Formula

a(n) = n - A052273(n).
Satisfies a(n) <= n-2 (residues 0 and 1 are always present).