1 * 8 + 1 = 9
12 * 8 + 2 = 98
123 * 8 + 3 = 987
1234 * 8 + 4 = 9876
12345 * 8 + 5 = 98765
1 23456 * 8 + 6 = 987654
1234567 * 8 + 7 = 9876543
12345678 * 8 + 8 = 98765432
123456789 * 8 + 9 = 987654321
心血來潮,想說用Perl寫寫看,看看會不會有一樣的結果。
for($i = 0; $i <9; $i++)
{
$Y = $Y + 10**$i;
$b = $b + $Y;
$k = ($i + 1);
$s = ($b * 8) + $k;
print "$b * 8 + $k = $s\n";
}
程式出來的結過,雖然醜了一點,不過還算有模有樣。
1 * 8 + 1 = 9
12 * 8 + 2 = 98
123 * 8 + 3 = 987
1234 * 8 + 4 = 9876
12345 * 8 + 5 = 98765
123456 * 8 + 6 = 987654
1234567 * 8 + 7 = 9876543
12345678 * 8 + 8 = 98765432
123456789 * 8 + 9 = 987654321