Abstract
This article explores various optimizations that can be used to speed the discovery of Armstrong numbers (also known as Narcissistic numbers), which are n-digit numbers that are the sum of the nth powers of their digits. Optimizations include comparing the parity of the least-significant digit of the number and that of the sum of its digits, using a dynamic programming approach for the powers of digits, examining the parity of the sum of digits excluding the least-significant digit, and computing forward bounds on the possible numbers and on the possible sums of dn. The final optimization completes in about 2% of the time of the initial implementation.
- Weisstein, Eric W. "Narcissistic Number." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/NarcissisticNumber.html. Accessed 2010 December 15.Google Scholar
- G.H. Hardy, A Mathematician's Apology (First Electronic Edition, Version 1.0; University of Alberta Mathematical Sciences Society, March 2005), pp. 24--25. Accessible through http://www.math.ualberta.ca/~mss/misc/A%20Mathematician's%20Apology.pdf. Accessed 2010 December 20.Google Scholar
- John 21:11, taken from The Complete Bible: An American Translation, Old Testament translation by J.M.Powis Smith et al., the Apocrypha and New Testament translated by Edgar J. Goodspeed (The University of Chicago Press, 1939), New Testament p. 109.Google Scholar
- Lionel Deimel, http://www.deimel.org/rec_math/DI_0.htm. Access 2010 December 20.Google Scholar
- Martin Gardner, The Incredible Dr. Matrix (Charles Scribner's Sons, 1976) p. 36, but especially pp. 205--209.Google Scholar
- Lionel Deimel, http://www.deimel.org/rec_math/DI_6.htm. Accessed 2010 December 20.Google Scholar
- http://www.deimel.org/rec_math/armstrong.pdf. Accessed 2010 December 20.Google Scholar
- Anany Levitin, Introduction to the Design and Analysis of Algorithms (2nd edition; Pearson Education, Inc., 2007) p. 159. Also discussed in Thomas H. Cormen et al., Introduction to Algorithms (3rd edition; MIT Press, 2009), pp. 956--58. Google ScholarDigital Library
- Sanjoy Dasgupta et al., Algorithms (McGraw Hill Higher Education, 2008) pp. 272 ff. Google ScholarDigital Library
- http://en.wikipedia.org/wiki/Narcissistic_number. Accessed 2010 December 20.Google Scholar
Index Terms
- Optimizations generating Armstrong numbers
Recommendations
A study of decimal left shifters for binary numbers
The importance of decimal floating-point (DFP) arithmetic has been growing in the last years, and specifications for it are included in the revised IEEE 754 Standard for Floating-Point Arithmetic (IEEE 754-2008). IEEE 754-2008 specifies a binary ...
Development and investigation of efficient artificial bee colony algorithm for numerical function optimization
Artificial bee colony algorithm (ABC), which is inspired by the foraging behavior of honey bee swarm, is a biological-inspired optimization. It shows more effective than genetic algorithm (GA), particle swarm optimization (PSO) and ant colony ...
Synthesis and optimization of multiple-valued combinational and sequential reversible circuits with don't cares
In this paper, a synthesis method for combinational multiple-valued reversible logic (MVRL) circuits is proposed. This algorithm can use the don't care values in the synthesis process to obtain the optimal circuit with respect to quantum cost. The ...
Comments