Check the result if it is divisible or not
정보
This question is locked. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
이전 댓글 표시
N = 2026;
S = 4^N + 7^N;
if mod (S,5) == 0;
disp(sprintf('S(2026) is divisible by 5'));
else
disp(sprintf('S(2026) is not divisible by 5'));
end
The result is S(2026) is not divisible by 5, but it actually can be divisible by 5. The reason is S(2026) = inf., that's why it can't give me the proper answer. So how can i get the exact integer number of S or is it another way to check and get correct answer?
댓글 수: 1
Rena Berman
2024년 6월 5일
(Answers Dev) Restored edit
채택된 답변
추가 답변 (0개)
This question is locked.
카테고리
도움말 센터 및 File Exchange에서 Number Theory에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!