Numbers of Armstong WP34s
|
12-01-2015, 10:11 AM
Post: #5
|
|||
|
|||
RE: Numbers of Armstong WP34s
(12-01-2015 06:35 AM)ggauny@live.fr Wrote: also the program of Thomas for 42s, but I am a bit with difficulty to apprehend Python approach. You can just replace the exponent 3 by 4: Click run Code: for a in range(10): Result: 0 1 1634 8208 9474 => None Cheers Thomas PS: If you want to go further with n you might extract that loop into a function that can be called recursively: Click run Code: def armstrong(n, i, a, b): Result: n = 1 0 1 2 3 4 5 6 7 8 9 n = 2 0 1 n = 3 0 1 153 370 371 407 n = 4 0 1 1634 8208 9474 n = 5 0 1 4150 4151 54748 92727 93084 n = 6 0 1 548834 => None |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
Numbers of Armstong WP34s - ggauny@live.fr - 11-30-2015, 07:02 PM
RE: Numbers of Armstong WP34s - Thomas Klemm - 11-30-2015, 08:27 PM
RE: Numbers of Armstong WP34s - Dave Frederickson - 11-30-2015, 09:21 PM
RE: Numbers of Armstong WP34s - ggauny@live.fr - 12-01-2015, 06:35 AM
RE: Numbers of Armstong WP34s - Thomas Klemm - 12-01-2015 10:11 AM
RE: Numbers of Armstong WP34s - ggauny@live.fr - 12-01-2015, 11:14 AM
RE: Numbers of Armstong WP34s - Thomas Klemm - 12-01-2015, 01:07 PM
RE: Numbers of Armstong WP34s - Albert Chan - 07-30-2018, 12:58 AM
|
User(s) browsing this thread: 2 Guest(s)