{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Definition\n\nLet $q \\ge 1$ be an integer, and let $\\chi$ be a [[Dirichlet character|7XB5VJKDPG]] modulo $q$.\nLet $M$ be an integer and $N \\ge 1$.\nThe *character sum* of $\\chi$ over the interval $(M, M + N]$ is\n$$S_\\chi(M, N) = \\sum_{n = M + 1}^{M + N} \\chi(n).$$\nMore generally, a character sum is a sum $\\sum_{n \\in A} \\chi(f(n))$ over a finite set $A$ of integers, where $f$ is a polynomial with integer coefficients.\n\n## Remarks\n\nExample: let $\\chi$ be the Legendre symbol modulo $5$, so $\\chi(1) = \\chi(4) = 1$, $\\chi(2) = \\chi(3) = -1$ and $\\chi(5) = 0$.\nThen $S_\\chi(0, 3) = 1 - 1 - 1 = -1$ and $S_\\chi(0, 5) = 0$.\nNon-example: the sum $\\sum_{n \\le N} \\mu(n)$ of the [[Möbius function|0FANE7P0DY]] is not a character sum, since $\\mu$ is not a Dirichlet character: $\\mu(4) = 0$ but $\\mu(2)\\mu(2) = 1$, so $\\mu$ is not completely multiplicative.\nOrthogonality gives the complete sum: $S_\\chi(M, q) = 0$ if $\\chi$ is not principal, and $S_\\chi(M, q) = \\varphi(q)$ if $\\chi$ is principal, where $\\varphi$ is [[Euler's totient function|0DAMHCT17R]].\nThus $\\abs{S_\\chi(M, N)} \\le \\varphi(q)$ for every nonprincipal $\\chi$.\nThe Pólya–Vinogradov inequality improves this to $\\abs{S_\\chi(M, N)} \\le C \\sqrt{q} \\log q$ for nonprincipal $\\chi$, with an absolute constant $C$.\n",
  "commit": "547b6eddb8f2feb8d579f2d633d22a27b7e132fc",
  "front": {
    "defines": "VTYJ9419C7",
    "kind": "definition",
    "msc": [
      "11L40",
      "11L10"
    ],
    "name": "Character sum",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Character_sum"
      }
    ],
    "tag": "4JWHKNGS4Y",
    "uses": [
      "7XB5VJKDPG"
    ]
  },
  "kind": "definition",
  "link": "https://math2.tamnd.com/node/4JWHKNGS4Y/",
  "links": [
    {
      "field": "defines",
      "target": "VTYJ9419C7"
    },
    {
      "field": "uses",
      "target": "7XB5VJKDPG"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/4JWHKNGS4Y.md",
  "msc": [
    "11L40",
    "11L10"
  ],
  "name": "Character sum",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/4JW/4JWHKNGS4Y.md",
  "status": null,
  "tag": "4JWHKNGS4Y",
  "uri": "m2://4JWHKNGS4Y",
  "url": "https://math2.tamnd.com/wiki/character-sum-definition/",
  "writing": {
    "tag": "4JWHKNGS4Y",
    "kind": "definition",
    "level": "W0",
    "next": [
      {
        "what": "a source with a locator",
        "have": 0,
        "want": 1
      }
    ]
  }
}
