{
  "index": "1989-A-1",
  "type": "NT",
  "tag": [
    "NT",
    "ALG"
  ],
  "difficulty": "",
  "question": "How many primes among the positive integers, written as usual in base 10,\nare alternating 1's and 0's, beginning and ending with 1?",
  "solution": "Solution. Suppose that \\( N=101 \\cdots 0101 \\) with \\( k \\) ones, for some \\( k \\geq 2 \\). Then\n\\[\n99 N=9999 \\cdots 9999=10^{2 k}-1=\\left(10^{k}+1\\right)\\left(10^{k}-1\\right) .\n\\]\n\nIf moreover \\( N \\) is prime, then \\( N \\) divides either \\( 10^{k}+1 \\) or \\( 10^{k}-1 \\), and hence one of \\( \\frac{99}{10^{k}-1}=\\frac{10^{k}+1}{N} \\) and \\( \\frac{99}{10^{k}+1}=\\frac{10^{k}-1}{N} \\) is an integer. For \\( k>2,10^{k}-1 \\) and \\( 10^{k}+1 \\) are both greater than 99 , so we get a contradiction. Therefore \\( k=2 \\) and \\( N=101 \\) (which is prime).\n\nRemark. Essentially the same problem appeared on the 1979 British Mathematical Olympiad, reprinted in [Lar1, p. 123] as Problem 4.1.4:\n\nProve that there are no prime numbers in the infinite sequence of integers\n\\[\n10001,100010001,1000100010001, \\ldots .\n\\]",
  "vars": [
    "N"
  ],
  "params": [
    "k"
  ],
  "sci_consts": [],
  "variants": {
    "descriptive_long": {
      "map": {
        "N": "integern",
        "k": "onescount"
      },
      "question": "How many primes among the positive integers, written as usual in base 10,\nare alternating 1's and 0's, beginning and ending with 1?",
      "solution": "Solution. Suppose that \\( integern=101 \\cdots 0101 \\) with \\( onescount \\) ones, for some \\( onescount \\geq 2 \\). Then\n\\[\n99\\, integern=9999 \\cdots 9999=10^{2\\,onescount}-1=\\left(10^{onescount}+1\\right)\\left(10^{onescount}-1\\right) .\n\\]\n\nIf moreover \\( integern \\) is prime, then \\( integern \\) divides either \\( 10^{onescount}+1 \\) or \\( 10^{onescount}-1 \\), and hence one of \\( \\frac{99}{10^{onescount}-1}=\\frac{10^{onescount}+1}{integern} \\) and \\( \\frac{99}{10^{onescount}+1}=\\frac{10^{onescount}-1}{integern} \\) is an integer. For \\( onescount>2,10^{onescount}-1 \\) and \\( 10^{onescount}+1 \\) are both greater than 99 , so we get a contradiction. Therefore \\( onescount=2 \\) and \\( integern=101 \\) (which is prime).\n\nRemark. Essentially the same problem appeared on the 1979 British Mathematical Olympiad, reprinted in [Lar1, p. 123] as Problem 4.1.4:\n\nProve that there are no prime numbers in the infinite sequence of integers\n\\[\n10001,100010001,1000100010001, \\ldots .\n\\]"
    },
    "descriptive_long_confusing": {
      "map": {
        "N": "longitude",
        "k": "backpack"
      },
      "question": "How many primes among the positive integers, written as usual in base 10,\nare alternating 1's and 0's, beginning and ending with 1?",
      "solution": "Solution. Suppose that \\( longitude=101 \\cdots 0101 \\) with \\( backpack \\) ones, for some \\( backpack \\geq 2 \\). Then\n\\[\n99 longitude=9999 \\cdots 9999=10^{2 backpack}-1=\\left(10^{backpack}+1\\right)\\left(10^{backpack}-1\\right) .\n\\]\n\nIf moreover \\( longitude \\) is prime, then \\( longitude \\) divides either \\( 10^{backpack}+1 \\) or \\( 10^{backpack}-1 \\), and hence one of \\( \\frac{99}{10^{backpack}-1}=\\frac{10^{backpack}+1}{longitude} \\) and \\( \\frac{99}{10^{backpack}+1}=\\frac{10^{backpack}-1}{longitude} \\) is an integer. For \\( backpack>2,10^{backpack}-1 \\) and \\( 10^{backpack}+1 \\) are both greater than 99 , so we get a contradiction. Therefore \\( backpack=2 \\) and \\( longitude=101 \\) (which is prime).\n\nRemark. Essentially the same problem appeared on the 1979 British Mathematical Olympiad, reprinted in [Lar1, p. 123] as Problem 4.1.4:\n\nProve that there are no prime numbers in the infinite sequence of integers\n\\[\n10001,100010001,1000100010001, \\ldots .\n\\]"
    },
    "descriptive_long_misleading": {
      "map": {
        "N": "nonnumber",
        "k": "infinitude"
      },
      "question": "How many primes among the positive integers, written as usual in base 10,\nare alternating 1's and 0's, beginning and ending with 1?",
      "solution": "Solution. Suppose that \\( nonnumber=101 \\cdots 0101 \\) with \\( infinitude \\) ones, for some \\( infinitude \\geq 2 \\). Then\n\\[\n99 nonnumber=9999 \\cdots 9999=10^{2 infinitude}-1=\\left(10^{infinitude}+1\\right)\\left(10^{infinitude}-1\\right) .\n\\]\n\nIf moreover \\( nonnumber \\) is prime, then \\( nonnumber \\) divides either \\( 10^{infinitude}+1 \\) or \\( 10^{infinitude}-1 \\), and hence one of \\( \\frac{99}{10^{infinitude}-1}=\\frac{10^{infinitude}+1}{nonnumber} \\) and \\( \\frac{99}{10^{infinitude}+1}=\\frac{10^{infinitude}-1}{nonnumber} \\) is an integer. For \\( infinitude>2,10^{infinitude}-1 \\) and \\( 10^{infinitude}+1 \\) are both greater than 99 , so we get a contradiction. Therefore \\( infinitude=2 \\) and \\( nonnumber=101 \\) (which is prime).\n\nRemark. Essentially the same problem appeared on the 1979 British Mathematical Olympiad, reprinted in [Lar1, p. 123] as Problem 4.1.4:\n\nProve that there are no prime numbers in the infinite sequence of integers\n\\[\n10001,100010001,1000100010001, \\ldots .\n\\]"
    },
    "garbled_string": {
      "map": {
        "N": "qzxwvtnp",
        "k": "hjgrksla"
      },
      "question": "How many primes among the positive integers, written as usual in base 10,\nare alternating 1's and 0's, beginning and ending with 1?",
      "solution": "Solution. Suppose that \\( qzxwvtnp=101 \\cdots 0101 \\) with \\( hjgrksla \\) ones, for some \\( hjgrksla \\geq 2 \\). Then\n\\[\n99 qzxwvtnp=9999 \\cdots 9999=10^{2 hjgrksla}-1=\\left(10^{hjgrksla}+1\\right)\\left(10^{hjgrksla}-1\\right) .\n\\]\n\nIf moreover \\( qzxwvtnp \\) is prime, then \\( qzxwvtnp \\) divides either \\( 10^{hjgrksla}+1 \\) or \\( 10^{hjgrksla}-1 \\), and hence one of \\( \\frac{99}{10^{hjgrksla}-1}=\\frac{10^{hjgrksla}+1}{qzxwvtnp} \\) and \\( \\frac{99}{10^{hjgrksla}+1}=\\frac{10^{hjgrksla}-1}{qzxwvtnp} \\) is an integer. For \\( hjgrksla>2,10^{hjgrksla}-1 \\) and \\( 10^{hjgrksla}+1 \\) are both greater than 99 , so we get a contradiction. Therefore \\( hjgrksla=2 \\) and \\( qzxwvtnp=101 \\) (which is prime).\n\nRemark. Essentially the same problem appeared on the 1979 British Mathematical Olympiad, reprinted in [Lar1, p. 123] as Problem 4.1.4:\n\nProve that there are no prime numbers in the infinite sequence of integers\n\\[\n10001,100010001,1000100010001, \\ldots .\n\\]"
    },
    "kernel_variant": {
      "question": "How many prime numbers have a base-6 representation that consists of alternating digits 1 and 0, beginning and ending with 1, and that contains at least three base-6 digits?  (Typical examples of such numerals are 101₆, 10101₆, 1010101₆, ….)",
      "solution": "Write such a number with k ≥ 2 occurrences of the digit 1:\n\n        N_k = 1010…01 (k ones and k−1 zeros)_6.\n\nIn base-10 this equals the geometric sum\n\n        N_k = 6^{2k−2} + 6^{2k−4} + ⋯ + 6^{2} + 1 = Σ_{j=0}^{k−1} 6^{2j}\n             = (6^{2k} − 1)/(6^{2} − 1) = (6^{2k} − 1)/35.\n\nMultiplying both sides by 35 gives a repunit in base 6:\n\n        35 N_k = 6^{2k} − 1 = (6^{k} − 1)(6^{k} + 1).               (1)\n\nBecause gcd(6^{k} − 1, 6^{k} + 1) = 1, a prime factor can divide at most one of the two factors on the right.  Hence a prime N_k must satisfy exactly one of the divisibilities\n\n        N_k | (6^{k} − 1) or N_k | (6^{k} + 1).\n\nCancelling N_k from (1) in each case gives\n\n        (i)   N_k | (6^{k} − 1)  ⇒  6^{k} + 1 | 35,             or\n        (ii)  N_k | (6^{k} + 1)  ⇒  6^{k} − 1 | 35.              (2)\n\nAll positive divisors of 35 are 1, 5, 7, 35.  We examine (2) case by case.\n\nCase (i)  6^{k} + 1 divides 35.\n   The only possibilities are 1, 5, 7, 35, all of which are < 6^{2}.  But 6^{k} + 1 ≥ 6^{2} + 1 = 37 for every k ≥ 2, so no value of k satisfies (i).\n\nCase (ii)  6^{k} − 1 divides 35.\n   Again 6^{k} − 1 can be 1, 5, 7, or 35.\n        6^{k} − 1 = 1  ⇒ k = 0   (not allowed)\n        6^{k} − 1 = 5  ⇒ 6^{k} = 6  ⇒ k = 1  (not allowed)\n        6^{k} − 1 = 7  ⇒ 6^{k} = 8  (impossible)\n        6^{k} − 1 = 35 ⇒ 6^{k} = 36 ⇒ k = 2, which is admissible.\nThus the only possible value is k = 2.\n\nFor k = 2,\n        N_2 = 6^{2} + 1 = 37,\nwhich is prime.\n\nConsequently, exactly one prime possesses the stated form.\n\nAnswer: 1.",
      "_meta": {
        "core_steps": [
          "Express N with k alternating digits and note that (10²−1)·N = 10^{2k} − 1",
          "Factor 10^{2k} − 1 as (10^{k} − 1)(10^{k} + 1) via difference of squares",
          "Because N is prime, N must divide exactly one of those two factors",
          "Compare sizes: for k>2 both factors exceed (10²−1), contradicting divisibility by N",
          "Conclude k=2 and verify the lone remaining candidate for primality"
        ],
        "mutable_slots": {
          "slot1": {
            "description": "The base in which the digits are written",
            "original": "10"
          },
          "slot2": {
            "description": "The non–zero digit that alternates with zeros (now fixed at 1)",
            "original": "1"
          },
          "slot3": {
            "description": "Multiplier equal to base²−1 that turns the pattern into a repunit of (base−1)’s",
            "original": "99"
          },
          "slot4": {
            "description": "Numerical threshold used to bound k (same number as slot3 in this instance)",
            "original": "99"
          },
          "slot5": {
            "description": "The final candidate when k=2 (here equal to base²+1)",
            "original": "101"
          }
        }
      }
    }
  },
  "checked": true,
  "problem_type": "proof",
  "iteratively_fixed": true
}