# Question 19832: A Composite Can Pass a Fermat Test for a Chosen Base

[Return to catalogue page 100](https://ocme.evemisslab.com/en/questions/page/100/)

[← Question derivation index](https://ocme.evemisslab.com/en/questions/) · [Original question batch](https://ocme.evemisslab.com/en/practice/batch-20261014-advance-20261106-r05-fermat-little-theorem-foundations/#q-20261014-advance-20261106-r05-fermat-little-theorem-0082)

This teaching derivation has second-context AI mathematical and bilingual semantic review, limited to the model and assumptions stated in this question. It has no human review or new Lean proof and does not promote the original question or MKO to Canonical truth.

R0038-19832 · q-20261014-advance-20261106-r05-fermat-little-theorem-0082



## Original question and givens

Use integer base a=13 and modulus=561, normalized residues in [0,modulus). Exact integer square-and-multiply computes powers; trial division checks primality. Every equality of residues here is a congruence modulo the stated modulus, not an unrestricted integer equality. The coprime form requires prime modulus and an invertible base; the all-integer form for prime p also allows p to divide a. Never cancel a noninvertible residue. Give (modulus, base, prime, coprime, power_modulus_minus_1, boundary).


- G001 — Use integer base a=13 and modulus=561, normalized residues in [0,modulus). Exact integer square-and-multiply computes powers; trial division checks primality. Every equality of residues here is a congruence modulo the stated modulus, not an unrestricted integer equality. The coprime form requires prime modulus and an invertible base; the all-integer form for prime p also allows p to divide a. Never cancel a noninvertible residue. Give (modulus, base, prime, coprime, power_modulus_minus_1, boundary).





## Definition and scope

Use the original question domain, assumptions and cited MKO definitions. This item has second-context mathematical and bilingual review, with the model, answer and every arithmetic step independently recomputed from the original parameters; the source question remains a candidate.


- [mko-fermat-little-theorem](https://ocme.evemisslab.com/en/mko/mko-fermat-little-theorem/)





## Step-by-step derivation

S001 · impliesBefore

source operation=flt-converse-counterexample;original snapshot and mathematics retained

After

explicit ordered source output fields=[modulus, base, prime, coprime, power_modulus_minus_1, boundary]

Conditions: none

Keep the historical interface marker in the original snapshot while listing ordered source fields here,without JavaScript or external lookup.Field labels are not mathematical evidence,and No retains the operation's claim scope.

Step identifiers and dependenciesRule: source_ordered_interface_explicit_without_javascript · Uses: G001





S002 · impliesBefore

ACTUAL integer modulus=561;complete trial range2..floor_sqrt=23

After

checked rows[divisor,quotient,remainder]=[[2, 280, 1], [3, 187, 0]];first exact factor=3;prime=No

Conditions: none

An exact factor in the trial range witnesses compositeness.If the entire range has no factor,any composite decomposition would require one at most sqrt(n),so all composite cases are excluded.The empty range for2 is valid.This is not a primality inference from a Fermat test.

Step identifiers and dependenciesRule: flt_primality_complete_trial_or_actual_factor_not_Fermat_test · Uses: G001, S001





S003 · impliesBefore

original signed base=13;positive modulus=561;use nonnegative gcd inputs=[13, 561]

After

ALL Euclidean rows[left,right,q,r]=[[13, 561, 0, 13], [561, 13, 43, 2], [13, 2, 6, 1], [2, 1, 2, 0]];terminal nonnegative gcd=1;coprime=Yes

Conditions: none

Euclidean replacements preserve common divisors and give the terminal gcd,including gcd(0,m)=m.Primality of the modulus and invertibility of the base remain separate flags.

Step identifiers and dependenciesRule: flt_actual_gcd_coprime_separate_from_primality · Uses: G001, S002





S004 · calculationBefore

Fermat original signed base exact quotient := div(13, 561)

After

Fermat original signed base exact quotient = 13/561

Conditions: none

Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S003





S005 · calculationBefore

Fermat original signed base floor quotient multiple := mul(0, 561)

After

Fermat original signed base floor quotient multiple = 0

Conditions: none

Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S004





S006 · calculationBefore

Fermat original signed base normalized remainder := sub(13, 0)

After

Fermat original signed base normalized remainder = 13

Conditions: none

Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S005





S007 · impliesBefore

Fermat original signed base:signed integer value=13;positive modulus=561;exact quotient=13/561;floor q=0

After

value=q*modulus+remainder;normalized remainder=13 in[0,561)

Conditions: none

Use a positive modulus and floor quotient to obtain the nonnegative representative even for a negative base.Equal remainders express congruence modulo this modulus,not unrestricted integer equality.

Step identifiers and dependenciesRule: flt_exact_signed_modulo_not_integer_equality · Uses: G001, S006





S008 · impliesBefore

Fermat original modular exponent:original normalized base=13;original exponent=560;modulus=561

After

initialize accumulator1,current_base=base,remaining=exponent;invariant accumulator*current_base^remaining congruent to original power

Conditions: none

The multiplicative identity gives the exponent0 convention.Each step preserves congruence to the same original power without constructing huge ordinary powers or replacing modular relations with real equalities.

Step identifiers and dependenciesRule: flt_modular_power_initial_invariant · Uses: G001, S007





S009 · calculationBefore

Fermat original modular exponent bit0 current base square := mul(13, 13)

After

Fermat original modular exponent bit0 current base square = 169

Conditions: none

Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S008





S010 · calculationBefore

Fermat original modular exponent bit0 squared base reduction exact quotient := div(169, 561)

After

Fermat original modular exponent bit0 squared base reduction exact quotient = 169/561

Conditions: none

Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S009





S011 · calculationBefore

Fermat original modular exponent bit0 squared base reduction floor quotient multiple := mul(0, 561)

After

Fermat original modular exponent bit0 squared base reduction floor quotient multiple = 0

Conditions: none

Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S010





S012 · calculationBefore

Fermat original modular exponent bit0 squared base reduction normalized remainder := sub(169, 0)

After

Fermat original modular exponent bit0 squared base reduction normalized remainder = 169

Conditions: none

Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S011





S013 · impliesBefore

Fermat original modular exponent bit0 squared base reduction:signed integer value=169;positive modulus=561;exact quotient=169/561;floor q=0

After

value=q*modulus+remainder;normalized remainder=169 in[0,561)

Conditions: none

Use a positive modulus and floor quotient to obtain the nonnegative representative even for a negative base.Equal remainders express congruence modulo this modulus,not unrestricted integer equality.

Step identifiers and dependenciesRule: flt_exact_signed_modulo_not_integer_equality · Uses: G001, S012





S014 · impliesBefore

Fermat original modular exponent:step=0;previous[accumulator,base,exponent]=[1, 13, 560];low bit=0

After

next[accumulator,base,exponent]=[1, 169, 280];split exponent=2*q+bit preserves original-power invariant

Conditions: none

Replace an even power by a squared base;an odd power also contributes one base factor to the accumulator.Exact reductions preserve congruence and halving the remaining nonnegative exponent guarantees termination.

Step identifiers and dependenciesRule: flt_each_binary_power_step_exact_invariant · Uses: G001, S013





S015 · calculationBefore

Fermat original modular exponent bit1 current base square := mul(169, 169)

After

Fermat original modular exponent bit1 current base square = 28561

Conditions: none

Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S014





S016 · calculationBefore

Fermat original modular exponent bit1 squared base reduction exact quotient := div(28561, 561)

After

Fermat original modular exponent bit1 squared base reduction exact quotient = 28561/561

Conditions: none

Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S015





S017 · calculationBefore

Fermat original modular exponent bit1 squared base reduction floor quotient multiple := mul(50, 561)

After

Fermat original modular exponent bit1 squared base reduction floor quotient multiple = 28050

Conditions: none

Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S016





S018 · calculationBefore

Fermat original modular exponent bit1 squared base reduction normalized remainder := sub(28561, 28050)

After

Fermat original modular exponent bit1 squared base reduction normalized remainder = 511

Conditions: none

Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S017





S019 · impliesBefore

Fermat original modular exponent bit1 squared base reduction:signed integer value=28561;positive modulus=561;exact quotient=28561/561;floor q=50

After

value=q*modulus+remainder;normalized remainder=511 in[0,561)

Conditions: none

Use a positive modulus and floor quotient to obtain the nonnegative representative even for a negative base.Equal remainders express congruence modulo this modulus,not unrestricted integer equality.

Step identifiers and dependenciesRule: flt_exact_signed_modulo_not_integer_equality · Uses: G001, S018





S020 · impliesBefore

Fermat original modular exponent:step=1;previous[accumulator,base,exponent]=[1, 169, 280];low bit=0

After

next[accumulator,base,exponent]=[1, 511, 140];split exponent=2*q+bit preserves original-power invariant

Conditions: none

Replace an even power by a squared base;an odd power also contributes one base factor to the accumulator.Exact reductions preserve congruence and halving the remaining nonnegative exponent guarantees termination.

Step identifiers and dependenciesRule: flt_each_binary_power_step_exact_invariant · Uses: G001, S019





S021 · calculationBefore

Fermat original modular exponent bit2 current base square := mul(511, 511)

After

Fermat original modular exponent bit2 current base square = 261121

Conditions: none

Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S020





S022 · calculationBefore

Fermat original modular exponent bit2 squared base reduction exact quotient := div(261121, 561)

After

Fermat original modular exponent bit2 squared base reduction exact quotient = 261121/561

Conditions: none

Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S021





S023 · calculationBefore

Fermat original modular exponent bit2 squared base reduction floor quotient multiple := mul(465, 561)

After

Fermat original modular exponent bit2 squared base reduction floor quotient multiple = 260865

Conditions: none

Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S022





S024 · calculationBefore

Fermat original modular exponent bit2 squared base reduction normalized remainder := sub(261121, 260865)

After

Fermat original modular exponent bit2 squared base reduction normalized remainder = 256

Conditions: none

Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S023





S025 · impliesBefore

Fermat original modular exponent bit2 squared base reduction:signed integer value=261121;positive modulus=561;exact quotient=261121/561;floor q=465

After

value=q*modulus+remainder;normalized remainder=256 in[0,561)

Conditions: none

Use a positive modulus and floor quotient to obtain the nonnegative representative even for a negative base.Equal remainders express congruence modulo this modulus,not unrestricted integer equality.

Step identifiers and dependenciesRule: flt_exact_signed_modulo_not_integer_equality · Uses: G001, S024





S026 · impliesBefore

Fermat original modular exponent:step=2;previous[accumulator,base,exponent]=[1, 511, 140];low bit=0

After

next[accumulator,base,exponent]=[1, 256, 70];split exponent=2*q+bit preserves original-power invariant

Conditions: none

Replace an even power by a squared base;an odd power also contributes one base factor to the accumulator.Exact reductions preserve congruence and halving the remaining nonnegative exponent guarantees termination.

Step identifiers and dependenciesRule: flt_each_binary_power_step_exact_invariant · Uses: G001, S025





S027 · calculationBefore

Fermat original modular exponent bit3 current base square := mul(256, 256)

After

Fermat original modular exponent bit3 current base square = 65536

Conditions: none

Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S026





S028 · calculationBefore

Fermat original modular exponent bit3 squared base reduction exact quotient := div(65536, 561)

After

Fermat original modular exponent bit3 squared base reduction exact quotient = 65536/561

Conditions: none

Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S027





S029 · calculationBefore

Fermat original modular exponent bit3 squared base reduction floor quotient multiple := mul(116, 561)

After

Fermat original modular exponent bit3 squared base reduction floor quotient multiple = 65076

Conditions: none

Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S028





S030 · calculationBefore

Fermat original modular exponent bit3 squared base reduction normalized remainder := sub(65536, 65076)

After

Fermat original modular exponent bit3 squared base reduction normalized remainder = 460

Conditions: none

Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S029





S031 · impliesBefore

Fermat original modular exponent bit3 squared base reduction:signed integer value=65536;positive modulus=561;exact quotient=65536/561;floor q=116

After

value=q*modulus+remainder;normalized remainder=460 in[0,561)

Conditions: none

Use a positive modulus and floor quotient to obtain the nonnegative representative even for a negative base.Equal remainders express congruence modulo this modulus,not unrestricted integer equality.

Step identifiers and dependenciesRule: flt_exact_signed_modulo_not_integer_equality · Uses: G001, S030





S032 · impliesBefore

Fermat original modular exponent:step=3;previous[accumulator,base,exponent]=[1, 256, 70];low bit=0

After

next[accumulator,base,exponent]=[1, 460, 35];split exponent=2*q+bit preserves original-power invariant

Conditions: none

Replace an even power by a squared base;an odd power also contributes one base factor to the accumulator.Exact reductions preserve congruence and halving the remaining nonnegative exponent guarantees termination.

Step identifiers and dependenciesRule: flt_each_binary_power_step_exact_invariant · Uses: G001, S031





S033 · calculationBefore

Fermat original modular exponent bit4 accumulator product := mul(1, 460)

After

Fermat original modular exponent bit4 accumulator product = 460

Conditions: none

Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S032





S034 · calculationBefore

Fermat original modular exponent bit4 accumulator reduction exact quotient := div(460, 561)

After

Fermat original modular exponent bit4 accumulator reduction exact quotient = 460/561

Conditions: none

Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S033





S035 · calculationBefore

Fermat original modular exponent bit4 accumulator reduction floor quotient multiple := mul(0, 561)

After

Fermat original modular exponent bit4 accumulator reduction floor quotient multiple = 0

Conditions: none

Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S034





S036 · calculationBefore

Fermat original modular exponent bit4 accumulator reduction normalized remainder := sub(460, 0)

After

Fermat original modular exponent bit4 accumulator reduction normalized remainder = 460

Conditions: none

Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S035





S037 · impliesBefore

Fermat original modular exponent bit4 accumulator reduction:signed integer value=460;positive modulus=561;exact quotient=460/561;floor q=0

After

value=q*modulus+remainder;normalized remainder=460 in[0,561)

Conditions: none

Use a positive modulus and floor quotient to obtain the nonnegative representative even for a negative base.Equal remainders express congruence modulo this modulus,not unrestricted integer equality.

Step identifiers and dependenciesRule: flt_exact_signed_modulo_not_integer_equality · Uses: G001, S036





S038 · calculationBefore

Fermat original modular exponent bit4 current base square := mul(460, 460)

After

Fermat original modular exponent bit4 current base square = 211600

Conditions: none

Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S037





S039 · calculationBefore

Fermat original modular exponent bit4 squared base reduction exact quotient := div(211600, 561)

After

Fermat original modular exponent bit4 squared base reduction exact quotient = 211600/561

Conditions: none

Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S038





S040 · calculationBefore

Fermat original modular exponent bit4 squared base reduction floor quotient multiple := mul(377, 561)

After

Fermat original modular exponent bit4 squared base reduction floor quotient multiple = 211497

Conditions: none

Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S039





S041 · calculationBefore

Fermat original modular exponent bit4 squared base reduction normalized remainder := sub(211600, 211497)

After

Fermat original modular exponent bit4 squared base reduction normalized remainder = 103

Conditions: none

Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S040





S042 · impliesBefore

Fermat original modular exponent bit4 squared base reduction:signed integer value=211600;positive modulus=561;exact quotient=211600/561;floor q=377

After

value=q*modulus+remainder;normalized remainder=103 in[0,561)

Conditions: none

Use a positive modulus and floor quotient to obtain the nonnegative representative even for a negative base.Equal remainders express congruence modulo this modulus,not unrestricted integer equality.

Step identifiers and dependenciesRule: flt_exact_signed_modulo_not_integer_equality · Uses: G001, S041





S043 · impliesBefore

Fermat original modular exponent:step=4;previous[accumulator,base,exponent]=[1, 460, 35];low bit=1

After

next[accumulator,base,exponent]=[460, 103, 17];split exponent=2*q+bit preserves original-power invariant

Conditions: none

Replace an even power by a squared base;an odd power also contributes one base factor to the accumulator.Exact reductions preserve congruence and halving the remaining nonnegative exponent guarantees termination.

Step identifiers and dependenciesRule: flt_each_binary_power_step_exact_invariant · Uses: G001, S042





S044 · calculationBefore

Fermat original modular exponent bit5 accumulator product := mul(460, 103)

After

Fermat original modular exponent bit5 accumulator product = 47380

Conditions: none

Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S043





S045 · calculationBefore

Fermat original modular exponent bit5 accumulator reduction exact quotient := div(47380, 561)

After

Fermat original modular exponent bit5 accumulator reduction exact quotient = 47380/561

Conditions: none

Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S044





S046 · calculationBefore

Fermat original modular exponent bit5 accumulator reduction floor quotient multiple := mul(84, 561)

After

Fermat original modular exponent bit5 accumulator reduction floor quotient multiple = 47124

Conditions: none

Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S045





S047 · calculationBefore

Fermat original modular exponent bit5 accumulator reduction normalized remainder := sub(47380, 47124)

After

Fermat original modular exponent bit5 accumulator reduction normalized remainder = 256

Conditions: none

Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S046





S048 · impliesBefore

Fermat original modular exponent bit5 accumulator reduction:signed integer value=47380;positive modulus=561;exact quotient=47380/561;floor q=84

After

value=q*modulus+remainder;normalized remainder=256 in[0,561)

Conditions: none

Use a positive modulus and floor quotient to obtain the nonnegative representative even for a negative base.Equal remainders express congruence modulo this modulus,not unrestricted integer equality.

Step identifiers and dependenciesRule: flt_exact_signed_modulo_not_integer_equality · Uses: G001, S047





S049 · calculationBefore

Fermat original modular exponent bit5 current base square := mul(103, 103)

After

Fermat original modular exponent bit5 current base square = 10609

Conditions: none

Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S048





S050 · calculationBefore

Fermat original modular exponent bit5 squared base reduction exact quotient := div(10609, 561)

After

Fermat original modular exponent bit5 squared base reduction exact quotient = 10609/561

Conditions: none

Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S049





S051 · calculationBefore

Fermat original modular exponent bit5 squared base reduction floor quotient multiple := mul(18, 561)

After

Fermat original modular exponent bit5 squared base reduction floor quotient multiple = 10098

Conditions: none

Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S050





S052 · calculationBefore

Fermat original modular exponent bit5 squared base reduction normalized remainder := sub(10609, 10098)

After

Fermat original modular exponent bit5 squared base reduction normalized remainder = 511

Conditions: none

Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S051





S053 · impliesBefore

Fermat original modular exponent bit5 squared base reduction:signed integer value=10609;positive modulus=561;exact quotient=10609/561;floor q=18

After

value=q*modulus+remainder;normalized remainder=511 in[0,561)

Conditions: none

Use a positive modulus and floor quotient to obtain the nonnegative representative even for a negative base.Equal remainders express congruence modulo this modulus,not unrestricted integer equality.

Step identifiers and dependenciesRule: flt_exact_signed_modulo_not_integer_equality · Uses: G001, S052





S054 · impliesBefore

Fermat original modular exponent:step=5;previous[accumulator,base,exponent]=[460, 103, 17];low bit=1

After

next[accumulator,base,exponent]=[256, 511, 8];split exponent=2*q+bit preserves original-power invariant

Conditions: none

Replace an even power by a squared base;an odd power also contributes one base factor to the accumulator.Exact reductions preserve congruence and halving the remaining nonnegative exponent guarantees termination.

Step identifiers and dependenciesRule: flt_each_binary_power_step_exact_invariant · Uses: G001, S053





S055 · calculationBefore

Fermat original modular exponent bit6 current base square := mul(511, 511)

After

Fermat original modular exponent bit6 current base square = 261121

Conditions: none

Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S054





S056 · calculationBefore

Fermat original modular exponent bit6 squared base reduction exact quotient := div(261121, 561)

After

Fermat original modular exponent bit6 squared base reduction exact quotient = 261121/561

Conditions: none

Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S055





S057 · calculationBefore

Fermat original modular exponent bit6 squared base reduction floor quotient multiple := mul(465, 561)

After

Fermat original modular exponent bit6 squared base reduction floor quotient multiple = 260865

Conditions: none

Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S056





S058 · calculationBefore

Fermat original modular exponent bit6 squared base reduction normalized remainder := sub(261121, 260865)

After

Fermat original modular exponent bit6 squared base reduction normalized remainder = 256

Conditions: none

Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S057





S059 · impliesBefore

Fermat original modular exponent bit6 squared base reduction:signed integer value=261121;positive modulus=561;exact quotient=261121/561;floor q=465

After

value=q*modulus+remainder;normalized remainder=256 in[0,561)

Conditions: none

Use a positive modulus and floor quotient to obtain the nonnegative representative even for a negative base.Equal remainders express congruence modulo this modulus,not unrestricted integer equality.

Step identifiers and dependenciesRule: flt_exact_signed_modulo_not_integer_equality · Uses: G001, S058





S060 · impliesBefore

Fermat original modular exponent:step=6;previous[accumulator,base,exponent]=[256, 511, 8];low bit=0

After

next[accumulator,base,exponent]=[256, 256, 4];split exponent=2*q+bit preserves original-power invariant

Conditions: none

Replace an even power by a squared base;an odd power also contributes one base factor to the accumulator.Exact reductions preserve congruence and halving the remaining nonnegative exponent guarantees termination.

Step identifiers and dependenciesRule: flt_each_binary_power_step_exact_invariant · Uses: G001, S059





S061 · calculationBefore

Fermat original modular exponent bit7 current base square := mul(256, 256)

After

Fermat original modular exponent bit7 current base square = 65536

Conditions: none

Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S060





S062 · calculationBefore

Fermat original modular exponent bit7 squared base reduction exact quotient := div(65536, 561)

After

Fermat original modular exponent bit7 squared base reduction exact quotient = 65536/561

Conditions: none

Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S061





S063 · calculationBefore

Fermat original modular exponent bit7 squared base reduction floor quotient multiple := mul(116, 561)

After

Fermat original modular exponent bit7 squared base reduction floor quotient multiple = 65076

Conditions: none

Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S062





S064 · calculationBefore

Fermat original modular exponent bit7 squared base reduction normalized remainder := sub(65536, 65076)

After

Fermat original modular exponent bit7 squared base reduction normalized remainder = 460

Conditions: none

Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S063





S065 · impliesBefore

Fermat original modular exponent bit7 squared base reduction:signed integer value=65536;positive modulus=561;exact quotient=65536/561;floor q=116

After

value=q*modulus+remainder;normalized remainder=460 in[0,561)

Conditions: none

Use a positive modulus and floor quotient to obtain the nonnegative representative even for a negative base.Equal remainders express congruence modulo this modulus,not unrestricted integer equality.

Step identifiers and dependenciesRule: flt_exact_signed_modulo_not_integer_equality · Uses: G001, S064





S066 · impliesBefore

Fermat original modular exponent:step=7;previous[accumulator,base,exponent]=[256, 256, 4];low bit=0

After

next[accumulator,base,exponent]=[256, 460, 2];split exponent=2*q+bit preserves original-power invariant

Conditions: none

Replace an even power by a squared base;an odd power also contributes one base factor to the accumulator.Exact reductions preserve congruence and halving the remaining nonnegative exponent guarantees termination.

Step identifiers and dependenciesRule: flt_each_binary_power_step_exact_invariant · Uses: G001, S065





S067 · calculationBefore

Fermat original modular exponent bit8 current base square := mul(460, 460)

After

Fermat original modular exponent bit8 current base square = 211600

Conditions: none

Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S066





S068 · calculationBefore

Fermat original modular exponent bit8 squared base reduction exact quotient := div(211600, 561)

After

Fermat original modular exponent bit8 squared base reduction exact quotient = 211600/561

Conditions: none

Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S067





S069 · calculationBefore

Fermat original modular exponent bit8 squared base reduction floor quotient multiple := mul(377, 561)

After

Fermat original modular exponent bit8 squared base reduction floor quotient multiple = 211497

Conditions: none

Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S068





S070 · calculationBefore

Fermat original modular exponent bit8 squared base reduction normalized remainder := sub(211600, 211497)

After

Fermat original modular exponent bit8 squared base reduction normalized remainder = 103

Conditions: none

Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S069





S071 · impliesBefore

Fermat original modular exponent bit8 squared base reduction:signed integer value=211600;positive modulus=561;exact quotient=211600/561;floor q=377

After

value=q*modulus+remainder;normalized remainder=103 in[0,561)

Conditions: none

Use a positive modulus and floor quotient to obtain the nonnegative representative even for a negative base.Equal remainders express congruence modulo this modulus,not unrestricted integer equality.

Step identifiers and dependenciesRule: flt_exact_signed_modulo_not_integer_equality · Uses: G001, S070





S072 · impliesBefore

Fermat original modular exponent:step=8;previous[accumulator,base,exponent]=[256, 460, 2];low bit=0

After

next[accumulator,base,exponent]=[256, 103, 1];split exponent=2*q+bit preserves original-power invariant

Conditions: none

Replace an even power by a squared base;an odd power also contributes one base factor to the accumulator.Exact reductions preserve congruence and halving the remaining nonnegative exponent guarantees termination.

Step identifiers and dependenciesRule: flt_each_binary_power_step_exact_invariant · Uses: G001, S071





S073 · calculationBefore

Fermat original modular exponent bit9 accumulator product := mul(256, 103)

After

Fermat original modular exponent bit9 accumulator product = 26368

Conditions: none

Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S072





S074 · calculationBefore

Fermat original modular exponent bit9 accumulator reduction exact quotient := div(26368, 561)

After

Fermat original modular exponent bit9 accumulator reduction exact quotient = 26368/561

Conditions: none

Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S073





S075 · calculationBefore

Fermat original modular exponent bit9 accumulator reduction floor quotient multiple := mul(47, 561)

After

Fermat original modular exponent bit9 accumulator reduction floor quotient multiple = 26367

Conditions: none

Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S074





S076 · calculationBefore

Fermat original modular exponent bit9 accumulator reduction normalized remainder := sub(26368, 26367)

After

Fermat original modular exponent bit9 accumulator reduction normalized remainder = 1

Conditions: none

Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S075





S077 · impliesBefore

Fermat original modular exponent bit9 accumulator reduction:signed integer value=26368;positive modulus=561;exact quotient=26368/561;floor q=47

After

value=q*modulus+remainder;normalized remainder=1 in[0,561)

Conditions: none

Use a positive modulus and floor quotient to obtain the nonnegative representative even for a negative base.Equal remainders express congruence modulo this modulus,not unrestricted integer equality.

Step identifiers and dependenciesRule: flt_exact_signed_modulo_not_integer_equality · Uses: G001, S076





S078 · calculationBefore

Fermat original modular exponent bit9 current base square := mul(103, 103)

After

Fermat original modular exponent bit9 current base square = 10609

Conditions: none

Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S077





S079 · calculationBefore

Fermat original modular exponent bit9 squared base reduction exact quotient := div(10609, 561)

After

Fermat original modular exponent bit9 squared base reduction exact quotient = 10609/561

Conditions: none

Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S078





S080 · calculationBefore

Fermat original modular exponent bit9 squared base reduction floor quotient multiple := mul(18, 561)

After

Fermat original modular exponent bit9 squared base reduction floor quotient multiple = 10098

Conditions: none

Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S079





S081 · calculationBefore

Fermat original modular exponent bit9 squared base reduction normalized remainder := sub(10609, 10098)

After

Fermat original modular exponent bit9 squared base reduction normalized remainder = 511

Conditions: none

Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.

Step identifiers and dependenciesRule: exact_rational_arithmetic · Uses: G001, S080





S082 · impliesBefore

Fermat original modular exponent bit9 squared base reduction:signed integer value=10609;positive modulus=561;exact quotient=10609/561;floor q=18

After

value=q*modulus+remainder;normalized remainder=511 in[0,561)

Conditions: none

Use a positive modulus and floor quotient to obtain the nonnegative representative even for a negative base.Equal remainders express congruence modulo this modulus,not unrestricted integer equality.

Step identifiers and dependenciesRule: flt_exact_signed_modulo_not_integer_equality · Uses: G001, S081





S083 · impliesBefore

Fermat original modular exponent:step=9;previous[accumulator,base,exponent]=[256, 103, 1];low bit=1

After

next[accumulator,base,exponent]=[1, 511, 0];split exponent=2*q+bit preserves original-power invariant

Conditions: none

Replace an even power by a squared base;an odd power also contributes one base factor to the accumulator.Exact reductions preserve congruence and halving the remaining nonnegative exponent guarantees termination.

Step identifiers and dependenciesRule: flt_each_binary_power_step_exact_invariant · Uses: G001, S082





S084 · impliesBefore

Fermat original modular exponent:remaining exponent0;final normalized accumulator=1

After

EXACT original base^560 modulo561=1

Conditions: none

At remaining exponent0 the invariant leaves exactly the accumulator,giving the original power's residue.The arithmetic result alone does not certify a prime modulus.

Step identifiers and dependenciesRule: flt_modular_power_terminal_not_primality_converse · Uses: G001, S083





S085 · impliesBefore

ACTUAL composite modulus=561 certified by a trial factor;ORIGINAL base=13 coprime;computed a^(m-1) modulo m=1

After

THIS chosen composite/base pair passes the Fermat power test,but modulus is NOT prime;counterexample to converse ONLY

Conditions: none

This explicit composite/coprime-base pair refutes the implication from a passing test to primality.It says neither that every composite nor every base passes,and does not refute Fermat's theorem under its prime premise.

Step identifiers and dependenciesRule: flt_composite_passing_chosen_base_not_all_bases_or_theorem_failure · Uses: G001, S084









## Reverse checks


- S085 · premise_and_result_audit — Check against the original data and this step's premises; a one-way implication is not an equivalence.
- S084 · premise_and_result_audit — Check against the original data and this step's premises; a one-way implication is not an equivalence.
- S083 · premise_and_result_audit — Check against the original data and this step's premises; a one-way implication is not an equivalence.
- S082 · premise_and_result_audit — Check against the original data and this step's premises; a one-way implication is not an equivalence.
- S081 · premise_and_result_audit — Recompute Fermat original modular exponent bit9 squared base reduction normalized remainder with exact rational arithmetic, not rounded decimals.
- S080 · premise_and_result_audit — Recompute Fermat original modular exponent bit9 squared base reduction floor quotient multiple with exact rational arithmetic, not rounded decimals.
- S079 · premise_and_result_audit — Recompute Fermat original modular exponent bit9 squared base reduction exact quotient with exact rational arithmetic, not rounded decimals.
- S078 · premise_and_result_audit — Recompute Fermat original modular exponent bit9 current base square with exact rational arithmetic, not rounded decimals.
- S077 · premise_and_result_audit — Check against the original data and this step's premises; a one-way implication is not an equivalence.
- S076 · premise_and_result_audit — Recompute Fermat original modular exponent bit9 accumulator reduction normalized remainder with exact rational arithmetic, not rounded decimals.
- S075 · premise_and_result_audit — Recompute Fermat original modular exponent bit9 accumulator reduction floor quotient multiple with exact rational arithmetic, not rounded decimals.
- S074 · premise_and_result_audit — Recompute Fermat original modular exponent bit9 accumulator reduction exact quotient with exact rational arithmetic, not rounded decimals.
- S073 · premise_and_result_audit — Recompute Fermat original modular exponent bit9 accumulator product with exact rational arithmetic, not rounded decimals.
- S072 · premise_and_result_audit — Check against the original data and this step's premises; a one-way implication is not an equivalence.
- S071 · premise_and_result_audit — Check against the original data and this step's premises; a one-way implication is not an equivalence.
- S070 · premise_and_result_audit — Recompute Fermat original modular exponent bit8 squared base reduction normalized remainder with exact rational arithmetic, not rounded decimals.
- S069 · premise_and_result_audit — Recompute Fermat original modular exponent bit8 squared base reduction floor quotient multiple with exact rational arithmetic, not rounded decimals.
- S068 · premise_and_result_audit — Recompute Fermat original modular exponent bit8 squared base reduction exact quotient with exact rational arithmetic, not rounded decimals.
- S067 · premise_and_result_audit — Recompute Fermat original modular exponent bit8 current base square with exact rational arithmetic, not rounded decimals.
- S066 · premise_and_result_audit — Check against the original data and this step's premises; a one-way implication is not an equivalence.
- S065 · premise_and_result_audit — Check against the original data and this step's premises; a one-way implication is not an equivalence.
- S064 · premise_and_result_audit — Recompute Fermat original modular exponent bit7 squared base reduction normalized remainder with exact rational arithmetic, not rounded decimals.
- S063 · premise_and_result_audit — Recompute Fermat original modular exponent bit7 squared base reduction floor quotient multiple with exact rational arithmetic, not rounded decimals.
- S062 · premise_and_result_audit — Recompute Fermat original modular exponent bit7 squared base reduction exact quotient with exact rational arithmetic, not rounded decimals.
- S061 · premise_and_result_audit — Recompute Fermat original modular exponent bit7 current base square with exact rational arithmetic, not rounded decimals.
- S060 · premise_and_result_audit — Check against the original data and this step's premises; a one-way implication is not an equivalence.
- S059 · premise_and_result_audit — Check against the original data and this step's premises; a one-way implication is not an equivalence.
- S058 · premise_and_result_audit — Recompute Fermat original modular exponent bit6 squared base reduction normalized remainder with exact rational arithmetic, not rounded decimals.
- S057 · premise_and_result_audit — Recompute Fermat original modular exponent bit6 squared base reduction floor quotient multiple with exact rational arithmetic, not rounded decimals.
- S056 · premise_and_result_audit — Recompute Fermat original modular exponent bit6 squared base reduction exact quotient with exact rational arithmetic, not rounded decimals.
- S055 · premise_and_result_audit — Recompute Fermat original modular exponent bit6 current base square with exact rational arithmetic, not rounded decimals.
- S054 · premise_and_result_audit — Check against the original data and this step's premises; a one-way implication is not an equivalence.
- S053 · premise_and_result_audit — Check against the original data and this step's premises; a one-way implication is not an equivalence.
- S052 · premise_and_result_audit — Recompute Fermat original modular exponent bit5 squared base reduction normalized remainder with exact rational arithmetic, not rounded decimals.
- S051 · premise_and_result_audit — Recompute Fermat original modular exponent bit5 squared base reduction floor quotient multiple with exact rational arithmetic, not rounded decimals.
- S050 · premise_and_result_audit — Recompute Fermat original modular exponent bit5 squared base reduction exact quotient with exact rational arithmetic, not rounded decimals.
- S049 · premise_and_result_audit — Recompute Fermat original modular exponent bit5 current base square with exact rational arithmetic, not rounded decimals.
- S048 · premise_and_result_audit — Check against the original data and this step's premises; a one-way implication is not an equivalence.
- S047 · premise_and_result_audit — Recompute Fermat original modular exponent bit5 accumulator reduction normalized remainder with exact rational arithmetic, not rounded decimals.
- S046 · premise_and_result_audit — Recompute Fermat original modular exponent bit5 accumulator reduction floor quotient multiple with exact rational arithmetic, not rounded decimals.
- S045 · premise_and_result_audit — Recompute Fermat original modular exponent bit5 accumulator reduction exact quotient with exact rational arithmetic, not rounded decimals.
- S044 · premise_and_result_audit — Recompute Fermat original modular exponent bit5 accumulator product with exact rational arithmetic, not rounded decimals.
- S043 · premise_and_result_audit — Check against the original data and this step's premises; a one-way implication is not an equivalence.
- S042 · premise_and_result_audit — Check against the original data and this step's premises; a one-way implication is not an equivalence.
- S041 · premise_and_result_audit — Recompute Fermat original modular exponent bit4 squared base reduction normalized remainder with exact rational arithmetic, not rounded decimals.
- S040 · premise_and_result_audit — Recompute Fermat original modular exponent bit4 squared base reduction floor quotient multiple with exact rational arithmetic, not rounded decimals.
- S039 · premise_and_result_audit — Recompute Fermat original modular exponent bit4 squared base reduction exact quotient with exact rational arithmetic, not rounded decimals.
- S038 · premise_and_result_audit — Recompute Fermat original modular exponent bit4 current base square with exact rational arithmetic, not rounded decimals.
- S037 · premise_and_result_audit — Check against the original data and this step's premises; a one-way implication is not an equivalence.
- S036 · premise_and_result_audit — Recompute Fermat original modular exponent bit4 accumulator reduction normalized remainder with exact rational arithmetic, not rounded decimals.
- S035 · premise_and_result_audit — Recompute Fermat original modular exponent bit4 accumulator reduction floor quotient multiple with exact rational arithmetic, not rounded decimals.
- S034 · premise_and_result_audit — Recompute Fermat original modular exponent bit4 accumulator reduction exact quotient with exact rational arithmetic, not rounded decimals.
- S033 · premise_and_result_audit — Recompute Fermat original modular exponent bit4 accumulator product with exact rational arithmetic, not rounded decimals.
- S032 · premise_and_result_audit — Check against the original data and this step's premises; a one-way implication is not an equivalence.
- S031 · premise_and_result_audit — Check against the original data and this step's premises; a one-way implication is not an equivalence.
- S030 · premise_and_result_audit — Recompute Fermat original modular exponent bit3 squared base reduction normalized remainder with exact rational arithmetic, not rounded decimals.
- S029 · premise_and_result_audit — Recompute Fermat original modular exponent bit3 squared base reduction floor quotient multiple with exact rational arithmetic, not rounded decimals.
- S028 · premise_and_result_audit — Recompute Fermat original modular exponent bit3 squared base reduction exact quotient with exact rational arithmetic, not rounded decimals.
- S027 · premise_and_result_audit — Recompute Fermat original modular exponent bit3 current base square with exact rational arithmetic, not rounded decimals.
- S026 · premise_and_result_audit — Check against the original data and this step's premises; a one-way implication is not an equivalence.
- S025 · premise_and_result_audit — Check against the original data and this step's premises; a one-way implication is not an equivalence.
- S024 · premise_and_result_audit — Recompute Fermat original modular exponent bit2 squared base reduction normalized remainder with exact rational arithmetic, not rounded decimals.
- S023 · premise_and_result_audit — Recompute Fermat original modular exponent bit2 squared base reduction floor quotient multiple with exact rational arithmetic, not rounded decimals.
- S022 · premise_and_result_audit — Recompute Fermat original modular exponent bit2 squared base reduction exact quotient with exact rational arithmetic, not rounded decimals.
- S021 · premise_and_result_audit — Recompute Fermat original modular exponent bit2 current base square with exact rational arithmetic, not rounded decimals.
- S020 · premise_and_result_audit — Check against the original data and this step's premises; a one-way implication is not an equivalence.
- S019 · premise_and_result_audit — Check against the original data and this step's premises; a one-way implication is not an equivalence.
- S018 · premise_and_result_audit — Recompute Fermat original modular exponent bit1 squared base reduction normalized remainder with exact rational arithmetic, not rounded decimals.
- S017 · premise_and_result_audit — Recompute Fermat original modular exponent bit1 squared base reduction floor quotient multiple with exact rational arithmetic, not rounded decimals.
- S016 · premise_and_result_audit — Recompute Fermat original modular exponent bit1 squared base reduction exact quotient with exact rational arithmetic, not rounded decimals.
- S015 · premise_and_result_audit — Recompute Fermat original modular exponent bit1 current base square with exact rational arithmetic, not rounded decimals.
- S014 · premise_and_result_audit — Check against the original data and this step's premises; a one-way implication is not an equivalence.
- S013 · premise_and_result_audit — Check against the original data and this step's premises; a one-way implication is not an equivalence.
- S012 · premise_and_result_audit — Recompute Fermat original modular exponent bit0 squared base reduction normalized remainder with exact rational arithmetic, not rounded decimals.
- S011 · premise_and_result_audit — Recompute Fermat original modular exponent bit0 squared base reduction floor quotient multiple with exact rational arithmetic, not rounded decimals.
- S010 · premise_and_result_audit — Recompute Fermat original modular exponent bit0 squared base reduction exact quotient with exact rational arithmetic, not rounded decimals.
- S009 · premise_and_result_audit — Recompute Fermat original modular exponent bit0 current base square with exact rational arithmetic, not rounded decimals.
- S008 · premise_and_result_audit — Check against the original data and this step's premises; a one-way implication is not an equivalence.
- S007 · premise_and_result_audit — Check against the original data and this step's premises; a one-way implication is not an equivalence.
- S006 · premise_and_result_audit — Recompute Fermat original signed base normalized remainder with exact rational arithmetic, not rounded decimals.
- S005 · premise_and_result_audit — Recompute Fermat original signed base floor quotient multiple with exact rational arithmetic, not rounded decimals.
- S004 · premise_and_result_audit — Recompute Fermat original signed base exact quotient with exact rational arithmetic, not rounded decimals.
- S003 · premise_and_result_audit — Check against the original data and this step's premises; a one-way implication is not an equivalence.
- S002 · premise_and_result_audit — Check against the original data and this step's premises; a one-way implication is not an equivalence.
- S001 · premise_and_result_audit — Check against the original data and this step's premises; a one-way implication is not an equivalence.





## Result

(561, 13, No, Yes, 1, converse_false_composite_can_pass_Fermat_test)

The full substitutions and premise checks give the original answer; source identity,format and status are unchanged.





## This question review and source binding

Review date: 2026-10-26

Original questions, answers, step expressions, numeric ASTs and historical records are retained. Source candidate labels remain historical and are not overwritten as formal proof.

Source hashes and review receipts
- input commit: 0f7be61e2c22317a4075561dc822c87d881a50db
- original question SHA-256: 69c97a8c5d94c34155acdbd6131637d339e39a548525c84e98c34562a583c370
- candidate record SHA-256: 178d9b3a2f1fd1fbec85f4e66c59d9a0a92e388aa52da6c0934491091bed7776
- semantic review receipt SHA-256: d165cad30849a3aba67390a59c572c0d965269d4b405e43df36da19e28d85612
- question-first witness SHA-256: c222ca47a07939c019865a1e4d9ce633205cdee68db92bf96a96f5683a62ebc7
- Lean: NOT_RUN · human review: NOT_PERFORMED

[Same-source full JSON](https://ocme.evemisslab.com/data/question-derivations/questions/q-20261014-advance-20261106-r05-fermat-little-theorem-0082.json)




