## `Type::Residue` -- a property representing a residue class

#### Introduction

`Type::Residue(`rem, class`)` represents the integers n for which n-rem is divisible by class.

#### Call(s)

`assume(x,` Type::Residue(rem, class <, subset>`)`)
`is(ex,` Type::Residue(rem, class <, subset>`)`)
`testtype(obj,` Type::Residue(rem, class <, subset>`)`)

#### Parameters

`x` | - | an identifier or one of the expressions `Re(u)` or `Im(u)` with an identifier `u`
`rem` | - | remainder as integer number between `0` and `class - 1`; an integer larger than `class - 1` will be divided by `class` and `rem` gets the remainder of this division
`class` | - | the divider as positive integer
`subset` | - | a subset of the integers (e.g., `Type::PosInt`); otherwise `Type::Integer` is used
`ex` | - | an arithmetical expression
`obj` | - | any MuPAD object

#### Returns

see `assume`, `is` and `testtype`

#### Related Functions

`assume`, `is`, `testtype`, `Type::Even`, `Type::Integer`, `Type::Odd`

#### Details

- The call `assume(x,` Type::Residue(rem, class`)`) marks the identifier `x` as an integer divisible by `class` with remainder `rem`.

  The call `is(ex,` Type::Residue(rem, class`)`) derives, whether the expression `ex` is an integer divisible by `class` with remainder `rem` (or this property can be derived).

- This type expects two or three arguments `rem`, `class`, <subset>.
- This type represents a property that can be used in `assume` and `is`.
- `Type::Even` and `Type::Odd` are objects created by `Type::Residue`.
- The call `testtype(obj,` Type::Residue(rem, class`)`) checks, whether `obj` is an integer and is divisible by `class` with remainder `rem`. If the optional argument `subset` is given, `testtype` checks additionally `testtype(obj, subset)`.

#### Example 1

`Type::Residue` can be used in `testtype`:

    >> testtype(6, Type::Residue(2, 4)),
       testtype(13, Type::Residue(1, 20))

                                    TRUE, FALSE

#### Example 2

`x` is assumed to be divisible by `3` with remainder `1`:

    >> assume(x, Type::Residue(1, 3))

                                3 Type::Integer + 1

Which properties has `x + 2` got?

    >> getprop(x + 2)

                                  3 Type::Integer

`x` is an integer, but it may be odd or not:

    >> is(x, Type::Integer), is(x, Type::Odd)

                                   TRUE, UNKNOWN

The optional subset of the integers restricts the possible values of `x`:

    >> assume(x, Type::Residue(2, 4, Type::PosInt)):
       is(x > 0),
       is(x^2 >= 4)

                                    TRUE, TRUE

#### Changes

- new function

Do you have questions or comments?
Copyright © SciFace Software GmbH & Co. KG 2000