Skip to content

Hole idea: FRACTRAN interpreter #615

Description

@MichalMarsalek

FRACTRAN

Input

Multiple inputs, each with the following format:

n p0/q0 p1/q1 ... pk/qk

Where n is a decimal natural starting number, pi/qi are transformation fractions (two / separated decimal natural numbers).

Output

Single decimal natural number (the last value of n˛ after the program halts).

Input/Output constraint

The initial value n, all the numerators and denominators as well as the output should fit in int64. All input fractions are reduced. This gives 63 values for an output encoded as a power of 2 and up to 1303 pairs of output values encoded as powers of 2 and 3. At most 15 nonzero output exponents can be present in the output.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions