# N-back Sequence Generator > N-back stimulus lists with an exact number of targets and lures, and a CSV answer key. Builds the item list for an n-back task: positions on a 3 × 3 grid, digits or shapes, with an exact number of targets (the item equals the one N steps back) and optional lures (equal to the item N−1 or N+1 back, a common source of false alarms). Every item is checked so that no accidental targets or lures sneak in. The result is the answer key as a table and CSV — the same generator Mindquarry uses for its n-back exercise. Part of usefulweb.app (https://usefulweb.app/). Part of [Mindquarry](https://mindquarry.usefulweb.app/) (ownerApp: mindquarry). Results are deterministic calculations from the inputs and the listed assumptions; the API returns exactly what the web page shows. ## Use it - Human interface: https://mindquarrynbacksequence.usefulweb.app/ (interactive tool at https://mindquarrynbacksequence.usefulweb.app/tool) - JSON API: POST https://mindquarrynbacksequence.usefulweb.app/api/v1/calculate with a JSON object of inputs (schema: https://mindquarrynbacksequence.usefulweb.app/api/v1/tool) - OpenAPI: https://mindquarrynbacksequence.usefulweb.app/openapi.json - MCP (Streamable HTTP): https://mindquarrynbacksequence.usefulweb.app/mcp - tool `mindquarry_n_back_sequence` ## Inputs - n (integer): N (steps back) - length (integer): Number of items - targetPercent (number): Targets - Share of the items after the first N that are targets. - lurePercent (number): Lures - Items equal to the one N−1 or N+1 back (but not N back). With N = 1 only N+1 lures exist. - stimuli (select): Stimuli - seed (text): Seed (same seed = same sequence) ## Method - Targets: round(target share × (items − N)) positions after the first N items are drawn at random; a target copies the item N steps back. - Lures: drawn from the remaining positions; a lure copies the item N−1 or N+1 back but never equals the item N back. If no such value is free at a position, the lure moves to the next free position. - Every other item (a filler) is drawn from the stimuli that are neither N back nor N±1 back, so the key never contains accidental targets or lures; the counts in the result are recounted from the final list. - Randomness comes from a seeded sfc32 generator, so the same inputs always give the same sequence. ## Limits - Practising these tasks makes you better at these tasks; it does not prove that memory, intelligence or everyday life improve.