English | Español

Try our Free Online Math Solver! Online Math Solver

 Depdendent Variable

 Number of equations to solve: 23456789
 Equ. #1:
 Equ. #2:

 Equ. #3:

 Equ. #4:

 Equ. #5:

 Equ. #6:

 Equ. #7:

 Equ. #8:

 Equ. #9:

 Solve for:

 Dependent Variable

 Number of inequalities to solve: 23456789
 Ineq. #1:
 Ineq. #2:

 Ineq. #3:

 Ineq. #4:

 Ineq. #5:

 Ineq. #6:

 Ineq. #7:

 Ineq. #8:

 Ineq. #9:

 Solve for:

 Please use this form if you would like to have this math solver on your website, free of charge. Name: Email: Your Website: Msg:

From Rational to Factorial

A factorial number N denoted by N = [ , a, b] consists of three parts.

• the sign part which is either 0 or 1,
• the whole part a = [an, . . . , a1, a0], where ak = 0, 1, . . . , k + 1, for k = 0, 1, . . . , n and,
• the fractional part b = [b1, b2, . . . , bm], where bk = 0, 1, . . . , k for k = 1, 2, . . . ,m

such that N is equivalent to the decimal number For example, the factorial number [1, [3, 2, 1, 1, 1, 0], [0, 0, 2, 2]] is equivalent to which is equivalent to the rational number -24321/10 or 24321/-10.

It can be shown that any rational number can be represented uniquely by a factorial
number of the form [ , a, b] where a and b are of finite lengths.

Write a program that converts a rational number to a factorial number.

INPUT
One line of input per case. The line represents a rational number R in the form n/d where n
and d are integers with d not equal zero .

OUTPUT
One line of output per test case. The line represents the factorial number that corresponds
to the rational number in the input. It must have the form  Prev Next