Description
Calculate one exact modular affine recurrence step.
Sequence calculations depend on the reference index, common difference or ratio, and whether a domain uses exact integers or real-valued arithmetic. Alternation depends on index parity; modular arithmetic chooses a representative in a fixed residue interval. A supplied local rule is not discovered from data and need not establish a complete recurrence or prediction model.
Calculate one exact modular affine recurrence step.
When to use this tool
Use Recurrence Term Modulus Step when you already have previous, multiplier, increment, modulus and need to calculate one exact modular affine recurrence step.
How to use the tool and how it works
- Enter previous, multiplier, increment, modulus. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read nextResidue. Use the output convention below.
Require signed safe whole previous/multiplier/increment and positive safe whole modulus. Compute (previous*multiplier+increment) mod modulus with BigInt, adding modulus to a negative remainder.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| previous | Previous | Required. Safe integer. |
| multiplier | Multiplier | Required. Safe integer. |
| increment | Increment | Required. Safe integer. |
| modulus | Modulus | Required. Safe integer; minimum 1. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| nextResidue | Exact whole residue in [0,modulus), with negative remainder normalized. | Required. Safe integer. |
{
"input": {
"previous": 7,
"multiplier": 5,
"increment": 3,
"modulus": 11
},
"output": {
"nextResidue": 5
}
} Limitations and assumptions
- The result lies in [0,modulus); a single recurrence step does not establish period, statistical quality or secure randomness.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
- Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.
Alternative or Complementary methods
Use the complete sequence definition and initial conditions for recurrence analysis. Choose exact integer or rational arithmetic when large indices or exact terms matter; local reference shifts and residue operations do not discover a generating rule.
References
Similar or alternative tools
- Alternating Sequence Sign At Index
Find an alternating sequence's sign relative to a supplied reference index.
- Finite Sequence Endpoint Parity
Compare endpoint-index parity and calculate inclusive sequence length.