{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Definition\n\nLet $\\mathcal{A}$ be a finite set of integers, $\\mathcal{P}$ a set of primes, $z \\ge 2$, and $P(z)$, $\\mathcal{A}_d$ and $S(\\mathcal{A}, \\mathcal{P}, z)$ as for the [[Brun sieve|M4G4RXASTY]].\nLet $D \\ge 1$.\nLet $(\\lambda_d)$ be real numbers indexed by the divisors $d$ of $P(z)$ such that:\n\n1. $\\lambda_1 = 1$;\n2. $\\lambda_d = 0$ for $d \u003e D$.\n\nThe *Selberg sieve* is the upper bound\n$$S(\\mathcal{A}, \\mathcal{P}, z) \\le \\sum_{a \\in \\mathcal{A}} \\Big( \\sum_{d \\mid \\gcd(a, P(z))} \\lambda_d \\Big)^{2} = \\sum_{d_1, d_2 \\mid P(z)} \\lambda_{d_1} \\lambda_{d_2}\\, \\#\\mathcal{A}_{\\lcm(d_1, d_2)},$$\ntogether with the choice of the weights $\\lambda_d$ that minimises the main term of the right side.\nThat main term is a quadratic form in the $\\lambda_d$ once $\\#\\mathcal{A}_d$ is written as $X g(d) + r_d$ with a multiplicative function $g$ and remainders $r_d$.\n\n## Remarks\n\nThe inequality holds termwise: if $\\gcd(a, P(z)) = 1$, the inner sum is $\\lambda_1 = 1$; otherwise the square is $\\ge 0$.\nExample: take $\\mathcal{A} = \\set{1, \\ldots, 10}$, $P(z) = 6$, $D = 3$, $\\lambda_1 = 1$, $\\lambda_2 = \\lambda_3 = -1/2$ and $\\lambda_6 = 0$.\nThe inner sum is $1$ for the three $a$ coprime to $6$, and $1/2$ for the six $a$ divisible by exactly one of $2$ and $3$.\nIt is $0$ for $a = 6$.\nSo the bound is $3 + 6 \\cdot \\tfrac14 = 4.5$, and indeed $S(\\mathcal{A}, \\mathcal{P}, z) = 3 \\le 4.5$.\nNon-example: weights with $\\lambda_1 = 0$ fail clause 1, and then $a = 1$ contributes $0$ instead of $1$, so the inequality can fail.\nWith $0 \u003c g(p) \u003c 1$ for $p \\mid P(z)$, the optimal weights give the main term $X / G$ with\n$$G = \\sum_{\\substack{d \\mid P(z) \\\\ d \\le D}} \\prod_{p \\mid d} \\frac{g(p)}{1 - g(p)},$$\nand they satisfy $\\abs{\\lambda_d} \\le 1$.\n",
  "commit": "5fc425f97f1f6b11da5892c2948ef8c5d8805665",
  "front": {
    "defines": "5252P3NHT7",
    "kind": "definition",
    "msc": [
      "11N35",
      "11N36"
    ],
    "name": "Selberg sieve",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Selberg_sieve"
      }
    ],
    "tag": "MGSX6V5Y5Y",
    "uses": [
      "4G65M0ZWAZ",
      "M4G4RXASTY"
    ]
  },
  "kind": "definition",
  "link": "https://math2.tamnd.com/node/MGSX6V5Y5Y/",
  "links": [
    {
      "field": "defines",
      "target": "5252P3NHT7"
    },
    {
      "field": "uses",
      "target": "4G65M0ZWAZ"
    },
    {
      "field": "uses",
      "target": "M4G4RXASTY"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/MGSX6V5Y5Y.md",
  "msc": [
    "11N35",
    "11N36"
  ],
  "name": "Selberg sieve",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/MGS/MGSX6V5Y5Y.md",
  "status": null,
  "tag": "MGSX6V5Y5Y",
  "uri": "m2://MGSX6V5Y5Y",
  "url": "https://math2.tamnd.com/wiki/selberg-sieve-definition/",
  "writing": {
    "tag": "MGSX6V5Y5Y",
    "kind": "definition",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      },
      {
        "what": "a source with a locator",
        "have": 0,
        "want": 1
      }
    ]
  }
}
