Computer Science Canada Persistance of a number only one greater than 4 from 10-100 |
Author: | munt4life [ Sun Oct 09, 2011 6:52 pm ] |
Post subject: | Persistance of a number only one greater than 4 from 10-100 |
The persistance is a the number of times the product of a number is carried out ex. 56 becomes 5*6 30 becomes 3*0 becomes 3 so the persistance is 2 53~~~15~~~~5 So how do i find the persistance of a number greater than 3 from 10-100 i know its 77, i have to make a program like this so i have abc=False per=0 for i in range (1,100): if (i/10)*(i%10) > 9: abc==True per=1 if abc==True: i/10 * i%10 per+=1 if per<3: print i but im not really getting anything like this. please give me some tips |
Author: | Tony [ Sun Oct 09, 2011 7:01 pm ] |
Post subject: | Re: Persistance of a number only one greater than 4 from 10-100 |
munt4life @ Sun Oct 09, 2011 6:52 pm wrote: 56 becomes 5*6 30 becomes 3*0 becomes 3 (did you mean 0?) so the persistance is 2
Easy. Persistence of 56 is 1 + persistence of 30. |