Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download
Views: 45896
Kernel: Python 3

context.divkbaseb(k, b)

Generates an automaton that recognises the writing in base bb of the numbers divisible by the integer kk.

Preconditions:

  • 2b2 \le b

  • the labelset has at least bb generators

Postconditions:

  • the automaton has kk states

  • Result = quotkbaseb(k, b).project(0)

See also:

Examples

import vcsn c = vcsn.context('lal_char(0-9), b') c.divkbaseb(3, 2)
Image in a Jupyter notebook
c.divkbaseb(2, 4)
Image in a Jupyter notebook

If kk and bb are coprime, then the result is known to be minimal.

div4base4 = c.divkbaseb(4, 4) div4base4
Image in a Jupyter notebook
div4base4.minimize()
Image in a Jupyter notebook