View Single Post
Old 2018-06-14, 15:44   #24
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

20C016 Posts
Default

Code:
my(a=0,b=[]);for(x=1,n,if((a-x)>0&&setminus(b,[a-x])==[],b=concat(b,[a-x]);a-=x;print(a),if(setminus(b,[a+x])==[],b=concat(b,[a+x]);a+=x;print(a),print("fails at x="x);break())))
Fails at x=26 apparently.

Last fiddled with by science_man_88 on 2018-06-14 at 15:44
science_man_88 is offline