Skip to content

Instantly share code, notes, and snippets.

@lrlucena
Last active December 7, 2015 23:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lrlucena/70811b06b124893f676c to your computer and use it in GitHub Desktop.
Save lrlucena/70811b06b124893f676c to your computer and use it in GitHub Desktop.
Qual o valor de x na equação: (x+3)! + (x+2)! = 8(x+1)!
f(x: Inteiro): Inteiro = escolha x
caso 0 => 1
caso n => n * f(n - 1)
fim
solução =
para x de 0 até 10 se f(x + 3) + f(x + 2) == 8 * f(x + 1) gere x fim
escreva solução
@lrlucena
Copy link
Author

lrlucena commented Dec 7, 2015

Resolvendo algebricamente:
(x+3)! + (x+2)! = 8 * (x+1)!
(x+3)(x+2)(x+1)! + (x+2)(x+1)! = 8 * (x+1)!
(x+3)
(x+2)+(x+2) = 8 , x>=0
(x+4)_(x+2) = 8
x^2+6_x = 0
x * (x + 6) = 0
x' = 0
x'' = -6 (viola a condição x>=0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment