數字運算,判斷一個數是否接近素數
A Niven number is a number such that the sum of its digits divides itself. For example, 111 is a Niven number because the sum of its digits is 3, which divides 111. We can also specify a number in another base b, and a number in base b is a Niven number if the sum of its digits divides its value.
Given b (2 <= b <= 10) and a number in base b, determine whether it is a Niven number or not.
Input
Each line of input contains the base b, followed by a string of digits representing a positive integer in that base. There are no leading zeroes. The input is terminated by a line consisting of 0 alone.
Output
For each case, print "yes" on a line if the given number is a Niven number, and "no" otherwise.
Sample Input
10 111
2 110
10 123
6 1000
8 2314
0
Sample Output
yes
yes
no
yes
no
This paper investigates the design of joint frequency
offset and carrier phase estimation of a multi-frequency time division
multiple access (MF-TDMA) demodulator that is applied to
a digital video broadcasting—return channel system via satellite
(DVB-RCS). The proposed joint estimation algorithm is based on
the interpolation technique for two correlation values in the frequency
and phase domains. This simple interpolation technique
can significantly improve frequency and phase resolution capabilities
of the proposed technique without increasing the number of
the correlation values. In addition, the overall block diagram of a
digital communications receiver for DVB-RCS is presented, which
was designed using the proposed estimation algorithms.
Index Terms—Carrier phase estimation, DVB-RCS, frequency
offset estimation, interpolation, joint estimation, MF-TDMA.
漢諾塔!!!
Simulate the movement of the Towers of Hanoi puzzle Bonus is possible for using animation
eg. if n = 2 A→B A→C B→C
if n = 3 A→C A→B C→B A→C B→A B→C A→C