View Single Post
Old 2016-12-03, 18:30   #5
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

Quote:
Originally Posted by a1call View Post
Too late to edit so posing with corrections:


Here is a pseudocode for clarification:

My array tasks[26]
forstep (j=0, 2197, step =13)
. {
. Print j in binary
. Flag=0
. Exp=0
. While(flag=0)
. {
. Exp= exp +1
. If(j/(2^ exp)!=j\(2^ exp))
. {
. Tasks[Exp]=+
. Flag=1
. }
. }
. }

For (k=1,26)
. {
. Print tasks[k]
. }


I would expect only tasks 1 to 13 to be nonzero and equal in proportion to total, to the value if the step was equal to 1
tried to make an equivalent PARI/gp code:

Code:
my(task=vector(26));forstep (j=0, 2197,13,print(binary(j));Flag=0;Exp=0;while(Flag==0,Exp+=1;if(j/(2^Exp)!=j\(2^Exp),task[Exp]+=1;Flag=1)));for(k=1,26,print(task[k]","k))
once I got it all equivalent without changing case it basically only printed once before I lost patience.edit:of course only j that aren't divisible by powers of two will happen to be increased in task okay something still doesn't allow it to compute any being worked ot 1

Last fiddled with by science_man_88 on 2016-12-03 at 18:52
science_man_88 is offline   Reply With Quote