/usr/lib/open-axiom/input/is.input is in open-axiom-test 1.5.0~svn3056+ds-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | --Copyright The Numerical Algorithms Group Limited 1991.
-- This is the 3n + 1 function: f(n) = n/2 if n is even,
-- 3n + 1 otherwise
--
-- It can obviously be coded as
-- f n ==
-- even? n => n quo 2
-- 3 * n + 1
-- but we code using the pattern matching syntax:
-- f n ==
-- n is 2*m% => m%
-- 3 * n + 1
-- The 'integer' is to return an integer instead of a polynomial
f n ==
not empty?(u := Is(n, 2*m%)) => integer eval(m%, u)
3 * n + 1
)set stream showall on
-- The function g generates the stream of the repeated applications of f
g(n:INT):STREAM(INT) == generate(f, n)
-- There is a conjecture that g(n) gets into the cycle (1 4 2)
-- for every n
s := g 27
extend(s, 150)
|