Automorphic Numbers MATLAB help
조회 수: 1 (최근 30일)
이전 댓글 표시
Here is a question that was asked; can anyone actually compute this:
A k digit automorphic, or circular, number is a number whose square ends in the same k digits as the number itself. For example, 76 is a 2-digit automorphic number because 76^2=57 76. K-digit automorphic numbers are said to come in pairs. What is the leftmost (that is, most significant) digit of each of the two 1,001-digit, base-10, automorphic numbers?
댓글 수: 0
답변 (1개)
Walter Roberson
2015년 9월 4일
I worked this out numerous years ago. It turns out there is a simple structure to the pairs. The sum of the two K-digit automorphic numbers is (10^K + 1). One of them will always end in 5 and the other will always end in 6. Furthermore if you square the one ending in 5, and take the digit to the left of the original value in the square (the K+1 digit counting from the right) then it is the first digit of next value ending in 5. For example,
5^2 = 25, and the two digit automorphic number ending in 5 is 25.
25^2 = 625, and the three digit automorphic number ending in 5 is 625.
625^2 = 390625 and the 4 digit automorphic number ending in 5 is 0625
0625^2 = 390625 and the 5 digit automophic number ending in 5 is 902625
10001-0625 = 9376 and 9376^2 = 87909376 so 9376 is the 4 digit automorphic number ending in 6.
There is also a shortcut to calculating what the next digit is for the 5 case, which you could discover with a bit of algebra. But it is your homework and implementation is your problem ;-)
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!