This is very simple question
Noah from IT Goes Click
newsuser at itgoesclick.com
Wed Apr 21 12:23:25 EDT 2004
I'm not sure those are factors? But then again I never was good at math
for say 13 you could just count up by two and then find the largest
number you can make of the twos and then move down until you find the
next one and then add 1 say you start with 13=[2,2,2,2,2,2,1] ?
then you know you have [12,1] 12 is a multiple of 2 or do you want
powers? if you want powers you could make the nessisary logic adjustments
Why exactly do you want this anyways?
Eric wrote:
> I would want to obtain a list of factors (multiples of 2) given a
> prime number in python.
>
> For example 13=[8,4,1], 5=[4,1], 7=[4,2,1], 15=[8,4,2,1]
>
> I would appreciate a fuction which would do this.
>
> Eric
More information about the Python-list
mailing list