

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


(a) π(n) = the number of primes less than or equal to n (b) Q(n) ≡ n is even (c) For each k ≥ 1, the function mink(x 1 ,... , xk) which outputs the least number among {x 1 ,... , xk}.
n as (^) √ n = a 0 .a 1 a 2 a 3 · · · where a 0 is a natural number and for i ≥ 1 we have 0 ≤ ai ≤ 9 (if
n is an integer, then ai = 0 for all i ≥ 1). Let f (n, i) = ai, so that f computes the digits of the decimal expansion of
n. Show that f is primitive recursive.
f 1 (0, x 1 ,... xk) = g 1 (x 1 ,... , xk) f 2 (0, x 1 ,... xk) = g 2 (x 1 ,... , xk) f 1 (y + 1, x 1 ,... xk) = h 1 (y, f 1 (y, x 1 ,... , xk), f 2 (y, x 1 ,... , xk), x 1 ,... , xk) f 2 (y + 1, x 1 ,... xk) = h 2 (y, f 1 (y, x 1 ,... , xk), f 2 (y, x 1 ,... , xk), x 1 ,... , xk)
Show that f 1 and f 2 are primitive recursive.
F (0) = 0 F (1) = 1 F (n + 2) = F (n) + F (n + 1)
Show that F is primitive recursive.
[Hint: You may want to code the sequence of previous values, keeping in mind that if s codes a sequence 〈n 0 ,... , nk〉, then each ni < s.]
(a) Seq(s) ≡ s codes a sequence
(b) Length(s) =
k + 1 if s = 〈n 0 ,... , nk〉 0 otherwise
(c) R(s) =
nk if s = 〈n 0 ,... , nk〉 0 otherwise
(d) Inc(s) ≡ s is an increasing sequence, i.e. s = 〈n 0 ,... , nk〉 and n 0 < n 1 < · · · < nk.
(1.) For all x, A( nx )(1) ≥ x + 1. (5.) For all x, An(2x) < An+2(x).