Skip to main content
deleted 136 characters in body
Source Link
thepace
  • 2.3k
  • 10
  • 10

Kudos to writing this program. The only thing that I see can be optimised is:

    Math.pow(PHI, i += 3) - Math.pow(_PHI, i)
    // PHI^(i+3) - PHI^i = PHI^i*(PHI^3-1) = PHI^i * PHI_CUBE_LESS_1 (Constant). Add comment if used.
  • One more thing that I see is that your code is hardlined for the problem, i.e for cases say, MAX_NUM is <=4 no solution exists.
  • Wouldn't int suffice rather than using long?

Just add the wiki link in the comment for others to check the mathematical formula :)
Great work!!!

Kudos to writing this program. The only thing that I see can be optimised is:

    Math.pow(PHI, i += 3) - Math.pow(_PHI, i)
    // PHI^(i+3) - PHI^i = PHI^i*(PHI^3-1) = PHI^i * PHI_CUBE_LESS_1 (Constant). Add comment if used.
  • One more thing that I see is that your code is hardlined for the problem, i.e for cases say, MAX_NUM is <=4 no solution exists.
  • Wouldn't int suffice rather than using long?

Just add the wiki link in the comment for others to check the mathematical formula :)
Great work!!!

Kudos to writing this program. The only thing that I see can be optimised is:

    Math.pow(PHI, i += 3) - Math.pow(_PHI, i)
    // PHI^(i+3) - PHI^i = PHI^i*(PHI^3-1) = PHI^i * PHI_CUBE_LESS_1 (Constant). Add comment if used.
  • Wouldn't int suffice rather than using long?

Just add the wiki link in the comment for others to check the mathematical formula :)
Great work!!!

added 1 character in body
Source Link
thepace
  • 2.3k
  • 10
  • 10

Kudos to writing this program. The only thing that I see can be optimised is:

    Math.pow(PHI, i += 3) - Math.pow(_PHI, i)
    // PHI^(i+3) - PHI^i = PHI^i*(PHI^3-1) = PHI^i * PHI_CUBE_LESS_1 (Constant). Add comment if used.
  • One more thing that I see is that your code is hardlined for the problem, i.e for cases say, MAX_NUM is <4<=4 no solution exists.
  • Wouldn't int suffice rather than using long?

Just add the wiki link in the comment for others to check the mathematical formula :)
Great work!!!

Kudos to writing this program. The only thing that I see can be optimised is:

    Math.pow(PHI, i += 3) - Math.pow(_PHI, i)
    // PHI^(i+3) - PHI^i = PHI^i*(PHI^3-1) = PHI^i * PHI_CUBE_LESS_1 (Constant). Add comment if used.
  • One more thing that I see is that your code is hardlined for the problem, i.e for cases say, MAX_NUM is <4 no solution exists.
  • Wouldn't int suffice rather than using long?

Just add the wiki link in the comment for others to check the mathematical formula :)
Great work!!!

Kudos to writing this program. The only thing that I see can be optimised is:

    Math.pow(PHI, i += 3) - Math.pow(_PHI, i)
    // PHI^(i+3) - PHI^i = PHI^i*(PHI^3-1) = PHI^i * PHI_CUBE_LESS_1 (Constant). Add comment if used.
  • One more thing that I see is that your code is hardlined for the problem, i.e for cases say, MAX_NUM is <=4 no solution exists.
  • Wouldn't int suffice rather than using long?

Just add the wiki link in the comment for others to check the mathematical formula :)
Great work!!!

Source Link
thepace
  • 2.3k
  • 10
  • 10

Kudos to writing this program. The only thing that I see can be optimised is:

    Math.pow(PHI, i += 3) - Math.pow(_PHI, i)
    // PHI^(i+3) - PHI^i = PHI^i*(PHI^3-1) = PHI^i * PHI_CUBE_LESS_1 (Constant). Add comment if used.
  • One more thing that I see is that your code is hardlined for the problem, i.e for cases say, MAX_NUM is <4 no solution exists.
  • Wouldn't int suffice rather than using long?

Just add the wiki link in the comment for others to check the mathematical formula :)
Great work!!!