// Numbas version: exam_results_page_options {"name": "Marlon's copy of Catherine's copy of Show all the factors of a number", "extensions": [], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variable_groups": [], "advice": "", "functions": {"join_and": {"type": "string", "parameters": [["list", "list"]], "language": "jme", "definition": "if(len(list)=1, join(list,''), join(list[0..len(list)-1],', ')+' and '+list[-1])"}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["n", "factors"], "name": "Marlon's copy of Catherine's copy of Show all the factors of a number", "rulesets": {}, "metadata": {"description": "

Show a list of the factors of a number.

\n

Works by testing each number up to $n$ for divisibility by $n$, so won't do well with really big numbers. Certainly fast enough for numbers up to 4 or 5 digits.

", "licence": "Creative Commons Attribution 4.0 International"}, "statement": "

The factors of $\\var{n}$ are $\\var{latex(join(factors,', '))}$.

\n

Or, if you want to be fancy: the factors of $\\var{n}$ are {join_and(map('\\$'+x+'\\$',x,factors))}.

", "tags": [], "preamble": {"js": "", "css": ""}, "extensions": [], "parts": [], "variables": {"factors": {"name": "factors", "group": "Ungrouped variables", "templateType": "anything", "description": "", "definition": "filter(x|n, x, 1..n)"}, "n": {"name": "n", "group": "Ungrouped variables", "templateType": "anything", "description": "", "definition": "random(10000..20000)"}}, "type": "question", "contributors": [{"name": "Marlon Arcila", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/321/"}]}]}], "contributors": [{"name": "Marlon Arcila", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/321/"}]}