// Numbas version: exam_results_page_options {"name": "Proof 1: the Goldbach conjecture", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"statement": "

In 1742, Christian Goldbach wrote in a letter to Leonhard Euler claiming that

\n

Every even integer greater than 2 can be written as the sum of two primes.

\n

This is now called Goldbach's conjecture, and is the oldest and best-known unsolved problem in number theory. While the proof has remained elusive, the conjecture has been computer verified for numbers up to $4\\times 10^{18}$.

This is a question about proof. You must show that each of the given numbers can be written as the sum of two prime numbers. The best way to do this is to exhibit the numbers as a sum of primes:

\n
\n
• $\\var{2a} = \\var{answers[keys(answers)[a]]}$
• \n
• $\\var{2(a+1)} = \\var{answers[keys(answers)[a+1]]}$
• \n
• $\\var{2(a+2)} = \\var{answers[keys(answers)[a+2]]}$
• \n
• $\\var{2(a+3)} = \\var{answers[keys(answers)[a+3]]}$.
• \n
", "functions": {}, "variablesTest": {"condition": "", "maxRuns": 100}, "tags": [], "metadata": {"licence": "Creative Commons Attribution-ShareAlike 4.0 International", "description": "

Intorduction to proof and existence statements.

"}, "ungrouped_variables": ["a", "answers", "A0", "A1", "A2", "A3"], "variable_groups": [], "variables": {"A1": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "name": "A1", "definition": "answers[\"\" + 2(a+1)]"}, "A3": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "name": "A3", "definition": "answers[\"\" + 2(a+3)]"}, "a": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "name": "a", "definition": "random(2..12)"}, "A2": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "name": "A2", "definition": "answers[\"\" + 2(a+2)]"}, "answers": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "name": "answers", "definition": "[\"0\":\"0+0\",\"2\":\"1+1\",\"4\":\"2+2\",\"6\":\"3+3\",\"8\":\"3+5\",\"10\":\"5+5\",\"12\":\"5+7\",\"14\":\"7+7\",\"16\":\"11+5\",\"18\":\"11+7\",\"20\":\"13+7\",\"22\":\"5+17\",\"24\":\"5+19\",\"26\":\"19+7\",\"28\":\"17+11\",\"30\":\"17+13\"]"}, "A0": {"templateType": "anything", "group": "Ungrouped variables", "description": "", "name": "A0", "definition": "answers[\"\" + 2(a+0)]"}}, "extensions": [], "preamble": {"js": "", "css": ""}, "parts": [{"gaps": [{"showPreview": true, "vsetRangePoints": 5, "useCustomName": false, "failureRate": 1, "extendBaseMarkingAlgorithm": true, "checkingAccuracy": 0.001, "scripts": {"mark": {"order": "instead", "script": "// extract question variables\nvar variables = this.question.scope.variables;\nvar unwrap = Numbas.jme.unwrapValue;\nvar a = unwrap(variables.a);\n\ntry {\n var numbers = this.studentAnswer.split(\"+\");\n \n if (numbers.length != 2) {\n // check this is a sum of two numbers\n this.setCredit(0,\"Enter a sum of two numbers\");\n } else {\n this.answered = true;\n // check the numbers are prime\n for (var j=0; j<2; j++) {\n var p = Numbas.util.parseNumber(numbers[j]);\n if (1 == p) {\n this.setCredit(0,\"The number $1$ is not prime.\");\n return;\n }\n for (var i = 2; i < p; i++) {\n if (0 == p % i) {\n this.setCredit(0,\"The number $\" + p + \"$ is not prime.\");\n return;\n }\n }\n }\n // check the numbers add up properly\n if (2*a == Numbas.util.parseNumber(numbers[0]) + Numbas.util.parseNumber(numbers[1])) {\n this.setCredit(1,\"Good, $\" + 2*a + \" = \" + this.studentAnswer + \"$.\");\n } else {\n this.setCredit(0,\"$\" + 2*a + \" \\\\neq \" + this.studentAnswer + \"$.\");\n }\n }\n}\ncatch(e) {\n this.markingComment(e);\n}"}}, "customMarkingAlgorithm": "", "answer": "{A0}", "marks": 1, "customName": "", "showFeedbackIcon": true, "type": "jme", "variableReplacementStrategy": "originalfirst", "checkingType": "absdiff", "checkVariableNames": false, "showCorrectAnswer": true, "variableReplacements": [], "vsetRange": [0, 1], "valuegenerators": [], "unitTests": []}, {"showPreview": true, "vsetRangePoints": 5, "useCustomName": false, "failureRate": 1, "extendBaseMarkingAlgorithm": true, "checkingAccuracy": 0.001, "scripts": {"mark": {"order": "instead", "script": "// extract question variables\nvar variables = this.question.scope.variables;\nvar unwrap = Numbas.jme.unwrapValue;\nvar a = unwrap(variables.a);\n\ntry {\n var numbers = this.studentAnswer.split(\"+\");\n \n if (numbers.length != 2) {\n // check this is a sum of two numbers\n this.setCredit(0,\"Enter a sum of two numbers\");\n } else {\n this.answered = true;\n // check the numbers are prime\n for (var j=0; j<2; j++) {\n var p = Numbas.util.parseNumber(numbers[j]);\n if (1 == p) {\n this.setCredit(0,\"The number $1$ is not prime.\");\n return;\n }\n for (var i = 2; i < p; i++) {\n if (0 == p % i) {\n this.setCredit(0,\"The number $\" + p + \"$ is not prime.\");\n return;\n }\n }\n }\n // check the numbers add up properly\n if (2*(a+1) == Numbas.util.parseNumber(numbers[0]) + Numbas.util.parseNumber(numbers[1])) {\n this.setCredit(1,\"Good, $\" + 2*(a+1) + \" = \" + this.studentAnswer + \"$.\");\n } else {\n this.setCredit(0,\"$\" + 2*(a+1) + \" \\\\neq \" + this.studentAnswer + \"$.\");\n }\n }\n}\ncatch(e) {\n this.markingComment(e);\n}"}}, "customMarkingAlgorithm": "", "answer": "{A1}", "marks": 1, "customName": "", "showFeedbackIcon": true, "type": "jme", "variableReplacementStrategy": "originalfirst", "checkingType": "absdiff", "checkVariableNames": false, "showCorrectAnswer": true, "variableReplacements": [], "vsetRange": [0, 1], "valuegenerators": [], "unitTests": []}, {"showPreview": true, "vsetRangePoints": 5, "useCustomName": false, "failureRate": 1, "extendBaseMarkingAlgorithm": true, "checkingAccuracy": 0.001, "scripts": {"mark": {"order": "instead", "script": "// extract question variables\nvar variables = this.question.scope.variables;\nvar unwrap = Numbas.jme.unwrapValue;\nvar a = unwrap(variables.a);\n\ntry {\n var numbers = this.studentAnswer.split(\"+\");\n \n if (numbers.length != 2) {\n // check this is a sum of two numbers\n this.setCredit(0,\"Enter a sum of two numbers\");\n } else {\n this.answered = true;\n // check the numbers are prime\n for (var j=0; j<2; j++) {\n var p = Numbas.util.parseNumber(numbers[j]);\n if (1 == p) {\n this.setCredit(0,\"The number $1$ is not prime.\");\n return;\n }\n for (var i = 2; i < p; i++) {\n if (0 == p % i) {\n this.setCredit(0,\"The number $\" + p + \"$ is not prime.\");\n return;\n }\n }\n }\n // check the numbers add up properly\n if (2*(a+2) == Numbas.util.parseNumber(numbers[0]) + Numbas.util.parseNumber(numbers[1])) {\n this.setCredit(1,\"Good, $\" + 2*(a+2) + \" = \" + this.studentAnswer + \"$.\");\n } else {\n this.setCredit(0,\"$\" + 2*(a+2) + \" \\\\neq \" + this.studentAnswer + \"$.\");\n }\n }\n}\ncatch(e) {\n this.markingComment(e);\n}"}}, "customMarkingAlgorithm": "", "answer": "{A2}", "marks": 1, "customName": "", "showFeedbackIcon": true, "type": "jme", "variableReplacementStrategy": "originalfirst", "checkingType": "absdiff", "checkVariableNames": false, "showCorrectAnswer": true, "variableReplacements": [], "vsetRange": [0, 1], "valuegenerators": [], "unitTests": []}, {"showPreview": true, "vsetRangePoints": 5, "useCustomName": false, "failureRate": 1, "extendBaseMarkingAlgorithm": true, "checkingAccuracy": 0.001, "scripts": {"mark": {"order": "instead", "script": "// extract question variables\nvar variables = this.question.scope.variables;\nvar unwrap = Numbas.jme.unwrapValue;\nvar a = unwrap(variables.a);\n\ntry {\n var numbers = this.studentAnswer.split(\"+\");\n \n if (numbers.length != 2) {\n // check this is a sum of two numbers\n this.setCredit(0,\"Enter a sum of two numbers\");\n } else {\n this.answered = true;\n // check the numbers are prime\n for (var j=0; j<2; j++) {\n var p = Numbas.util.parseNumber(numbers[j]);\n if (1 == p) {\n this.setCredit(0,\"The number $1$ is not prime.\");\n return;\n }\n for (var i = 2; i < p; i++) {\n if (0 == p % i) {\n this.setCredit(0,\"The number $\" + p + \"$ is not prime.\");\n return;\n }\n }\n }\n // check the numbers add up properly\n if (2*(a+3) == Numbas.util.parseNumber(numbers[0]) + Numbas.util.parseNumber(numbers[1])) {\n this.setCredit(1,\"Good, $\" + 2*(a+3) + \" = \" + this.studentAnswer + \"$.\");\n } else {\n this.setCredit(0,\"$\" + 2*(a+3) + \" \\\\neq \" + this.studentAnswer + \"$.\");\n }\n }\n}\ncatch(e) {\n this.markingComment(e);\n}"}}, "customMarkingAlgorithm": "", "answer": "{A3}", "marks": 1, "customName": "", "showFeedbackIcon": true, "type": "jme", "variableReplacementStrategy": "originalfirst", "checkingType": "absdiff", "checkVariableNames": false, "showCorrectAnswer": true, "variableReplacements": [], "vsetRange": [0, 1], "valuegenerators": [], "unitTests": []}], "prompt": "

Prove the following weakened version of the Goldbach conjecture:

\n

Every even integer between $\\var{2a}$ and $\\var{2(a+3) + 1}$ is the sum of two primes.

\n

Prove that it is possible to write these numbers as a sum of two primes, by actually writing them as sum of two primes:

\n
\n
• $\\var{2a} =$ [[0]]
• \n
• $\\var{2(a+1)} =$ [[1]]
• \n
• $\\var{2(a+2)} =$ [[2]]
• \n
• $\\var{2(a+3)} =$ [[3]].
• \n
", "useCustomName": false, "extendBaseMarkingAlgorithm": true, "scripts": {}, "customMarkingAlgorithm": "", "marks": 0, "customName": "", "showFeedbackIcon": true, "type": "gapfill", "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "variableReplacements": [], "sortAnswers": false, "unitTests": []}], "name": "Proof 1: the Goldbach conjecture", "rulesets": {}, "type": "question", "contributors": [{"name": "Daniel Mansfield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/743/"}, {"name": "Sean Gardiner", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2443/"}]}]}], "contributors": [{"name": "Daniel Mansfield", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/743/"}, {"name": "Sean Gardiner", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2443/"}]}