5乗したとき、下桁の数が自分自身と同じになる数
「平方したとき、下桁の数が自分自身と同じになる数」をAutomorphic number と言いますが、
「5乗したとき、下桁の数が自分自身と同じになる数」を探してみた。
ちなみに、Automorphic number は「5乗したとき、下桁の数が自分自身と同じになる数」になる。
出力結果
[0, [1, 2, 3, 4, 5, 6, 7, 8, 9]]
[1, [24, 25, 32, 43, 49, 51, 57, 68, 75, 76, 93, 99]]
[2, [125, 193, 249, 251, 307, 375, 376, 432, 443, 499, 501, 557, 568, 624, 625, 693, 749, 751, 807, 875, 943, 999]]
[3, [1249, 1251, 1693, 1875, 2057, 2499, 2501, 2943, 3125, 3307, 3568, 3749, 3751, 4193, 4375, 4557, 4999, 5001, 5443, 5625, 5807, 6249, 6251, 6432, 6693, 6875, 7057, 7499, 7501, 7943, 8125, 8307, 8749, 8751, 9193, 9375, 9376, 9557, 9999]]
[4, [13568, 15625, 18751, 20807, 22943, 24999, 25001, 27057, 29193, 31249, 34375, 40625, 43751, 45807, 47943, 49999, 50001, 52057, 54193, 56249, 59375, 65625, 68751, 70807, 72943, 74999, 75001, 77057, 79193, 81249, 84375, 86432, 90624, 90625, 93751, 95807, 97943, 99999]]
[5, [109375, 109376, 140625, 172943, 186432, 204193, 218751, 249999, 250001, 281249, 295807, 327057, 359375, 390625, 422943, 454193, 468751, 499999, 500001, 531249, 545807, 577057, 609375, 640625, 672943, 704193, 718751, 749999, 750001, 781249, 795807, 813568, 827057, 859375, 890624, 890625, 922943, 954193, 968751, 999999]]
[6, [1204193, 1295807, 1718751, 2077057, 2109375, 2499999, 2500001, 2890624, 2890625, 2922943, 3281249, 3704193, 3795807, 4218751, 4577057, 4609375, 4999999, 5000001, 5390625, 5422943, 5781249, 6204193, 6295807, 6718751, 7077057, 7109375, 7109376, 7499999, 7500001, 7890625, 7922943, 8281249, 8704193, 8795807, 9186432, 9218751, 9577057, 9609375, 9999999]]
[7, [12109375, 12890624, 12890625, 16295807, 17077057, 20813568, 24218751, 24999999, 25000001, 25781249, 32922943, 33704193, 37109375, 37890625, 41295807, 42077057, 49218751, 49999999, 50000001, 50781249, 57922943, 58704193, 62109375, 62890625, 66295807, 67077057, 74218751, 74999999, 75000001, 75781249, 79186432, 82922943, 83704193, 87109375, 87109376, 87890625, 91295807, 92077057, 99218751, 99999999]]
def A(n)
(n..n * 10 - 1).select{|i| (i ** 5 - i) % (n * 10) == 0}
end
(0..7).each{|i| p [i, A(10 ** i)]}
出力結果
[0, [1, 2, 3, 4, 5, 6, 7, 8, 9]]
[1, [24, 25, 32, 43, 49, 51, 57, 68, 75, 76, 93, 99]]
[2, [125, 193, 249, 251, 307, 375, 376, 432, 443, 499, 501, 557, 568, 624, 625, 693, 749, 751, 807, 875, 943, 999]]
[3, [1249, 1251, 1693, 1875, 2057, 2499, 2501, 2943, 3125, 3307, 3568, 3749, 3751, 4193, 4375, 4557, 4999, 5001, 5443, 5625, 5807, 6249, 6251, 6432, 6693, 6875, 7057, 7499, 7501, 7943, 8125, 8307, 8749, 8751, 9193, 9375, 9376, 9557, 9999]]
[4, [13568, 15625, 18751, 20807, 22943, 24999, 25001, 27057, 29193, 31249, 34375, 40625, 43751, 45807, 47943, 49999, 50001, 52057, 54193, 56249, 59375, 65625, 68751, 70807, 72943, 74999, 75001, 77057, 79193, 81249, 84375, 86432, 90624, 90625, 93751, 95807, 97943, 99999]]
[5, [109375, 109376, 140625, 172943, 186432, 204193, 218751, 249999, 250001, 281249, 295807, 327057, 359375, 390625, 422943, 454193, 468751, 499999, 500001, 531249, 545807, 577057, 609375, 640625, 672943, 704193, 718751, 749999, 750001, 781249, 795807, 813568, 827057, 859375, 890624, 890625, 922943, 954193, 968751, 999999]]
[6, [1204193, 1295807, 1718751, 2077057, 2109375, 2499999, 2500001, 2890624, 2890625, 2922943, 3281249, 3704193, 3795807, 4218751, 4577057, 4609375, 4999999, 5000001, 5390625, 5422943, 5781249, 6204193, 6295807, 6718751, 7077057, 7109375, 7109376, 7499999, 7500001, 7890625, 7922943, 8281249, 8704193, 8795807, 9186432, 9218751, 9577057, 9609375, 9999999]]
[7, [12109375, 12890624, 12890625, 16295807, 17077057, 20813568, 24218751, 24999999, 25000001, 25781249, 32922943, 33704193, 37109375, 37890625, 41295807, 42077057, 49218751, 49999999, 50000001, 50781249, 57922943, 58704193, 62109375, 62890625, 66295807, 67077057, 74218751, 74999999, 75000001, 75781249, 79186432, 82922943, 83704193, 87109375, 87109376, 87890625, 91295807, 92077057, 99218751, 99999999]]
0 件のコメント:
コメントを投稿
注: コメントを投稿できるのは、このブログのメンバーだけです。