Antiimagen de función creciente
Una función f de los números naturales en los números naturales es estrictamente creciente si para cualquier par de números x, y tales que x < y se verifica que f(x) < f(y). La antiimagen por f de un número natural t es el número natural x tal que f(x) = t. No todos los números tienen antiimiagen por f, pero en caso de tenerla es única.
Definir la función
antiimagen :: (Integer -> Integer) -> Integer -> Maybe Integer
tal que, suponiendo que f es una función creciente de los naturales en los naturales, (antiimagen f t) es justamente la antiimagen por f de t, si existe y es Nothing, en caso contrario. Por ejemplo,
antiimagen (\x -> 2*x^2-3) 47 == Just 5 antiimagen (\x -> 2*x^2-3) 48 == Nothing antiimagen (\x -> 2^x) 1024 == Just 10 antiimagen (2^) 1024 == Just 10 antiimagen (2^) (2^(10^7)) == Just 10000000 antiimagen (2^) (1+2^(10^7)) == Nothing








y graficaConvergencia ([1..148] \ [63,81,89,137]) dibuja

(grafica [10..100]) dibuja
y (grafica [100..200]) dibuja