Hi everyone. i have to solve a problem like that finding the last three digits before the decimal point for the number (3+sqrt(5))^n with n <= 2e9. I thinked but don't have the idea about this problem. So thank you if you help me to solve and i want to know that if with anyone number such is not integer number. can i finding the last three digits before the decimal point. Very thank you
Take all coefficients modulo $$$1000$$$. $$$(3+\sqrt5)^n+(3-\sqrt5)^n$$$ is an integer by the binomial theorem so you only need to compute the value of $$$(3+\sqrt5)^n+(3-\sqrt5)^n$$$, which you can do by using binary exponentiation to find $$$(3+\sqrt5)^n=a+b\sqrt5$$$ and $$$(3-\sqrt5)^n=a-b\sqrt5$$$, then use the fact that $$$(3-\sqrt5)^n<0.8^n<1$$$.
Thanks for your help. I can solve this problem <3