Finalized code
Problem solved:)
Defined method to return max prime factor
Problem completely solved:)
Problem completely solved using iterrative fibonacci method