freeCodeCamp/curriculum/challenges/portuguese/08-coding-interview-prep/project-euler/problem-180-rational-zeros-...

1.5 KiB

id challengeType title videoUrl localeTitle
5900f4201000cf542c50ff33 5 Problem 180: Rational zeros of a function of three variables Problema 180: Zeros Racionais de uma Função de Três Variáveis

Description

Para qualquer inteiro n, considere as três funções f1, n (x, y, z) = xn + 1 + yn + 1 - zn + 1f2, n (x, y, z) = (xy + yz + zx) * ( xn-1 + yn-1 - zn-1) f3, n (x, y, z) = xyz * (xn-2 + yn-2 - zn-2) e sua combinação fn (x, y, z) = f1, n (x, y, z) + f2, n (x, y, z) - f3, n (x, y, z) Nós chamamos (x, y, z) um triplo dourado de ordem k se x, y e z são todos números racionais da forma a / b com 0 <a <b ≤ k e existe (pelo menos) um inteiro n, de modo que fn (x, y, z) = 0. Seja s (x , y, z) = x + y + z. Seja t = u / v a soma de todos os s distintos (x, y, z) para todos os triplos de ouro (x, y, z) da ordem 35. Todos os s (x, y, z) et devem estar em forma reduzida. Encontre u + v.

Instructions

Tests

tests:
  - text: <code>euler180()</code> deve retornar 285196020571078980.
    testString: 'assert.strictEqual(euler180(), 285196020571078980, "<code>euler180()</code> should return 285196020571078980.");'

Challenge Seed

function euler180() {
  // Good luck!
  return true;
}

euler180();

Solution

// solution required