Skip to content

OstrowskiNumerals ​

Ostrowski numeration: the numeral system a continued fraction's partial quotients define, with a ceiling rule — a digit may reach its bound only if the one below it is zero — that forbids carries. All quotients equal to 1 gives the golden ratio and reduces to ZeckendorfNumerals.

OstrowskiNumerals(quotients)the system for partial quotients a1,a2,…a_1, a_2, \dots
Typed signatures
TypePackageApplies
(list<integer>) -> valuenumeralsalways

Domain: Numeral systems

Examples

Basic #

All quotients 1 gives Zeckendorf-style digits (places 1,1,2,3,5,8,13,211,1,2,3,5,8,13,21)

live ↗
InIntegerDigits(20,OstrowskiNumerals([1,1,1,1,1,1,1,1]))\mathrm{IntegerDigits}(20, \mathrm{OstrowskiNumerals}(\bigl\lbrack1, 1, 1, 1, 1, 1, 1, 1\bigr\rbrack))Out[0,1,0,1,0,1,0,0]\bigl\lbrack0, 1, 0, 1, 0, 1, 0, 0\bigr\rbrack
Scope #

Quotients [2,2,2][2,2,2]: places 1,2,51, 2, 5

live ↗
InIntegerDigits(9,OstrowskiNumerals([2,2,2]))\mathrm{IntegerDigits}(9, \mathrm{OstrowskiNumerals}(\bigl\lbrack2, 2, 2\bigr\rbrack))Out[1,2,0]\bigl\lbrack1, 2, 0\bigr\rbrack
About
Examples2

See also: IntegerDigits, ZeckendorfNumerals, Ostrowski