Cody

# Recent Activity

1 – 50 of 1,056,872
 3 minutes ago 14 minutes ago 18 minutes ago 1 hour and 12 minutes ago 1 hour and 14 minutes ago 1 hour and 44 minutes ago sezer dede received Solver badge for Solution 2422383 1 hour and 44 minutes ago 1 hour and 56 minutes ago 1 hour and 59 minutes ago 2 hours and 1 minute ago 2 hours and 10 minutes ago Mark Posen submitted a Comment to Solution 2422207 This is far from elegant, but works! Is there a a vectorised way to approach this in a much more efficient way? 2 hours and 26 minutes ago Haoyu Dai submitted a Comment to Solution 2422203 function y = KaprekarSteps(x) y=0; while x<1000 x=x*10; end x1=floor(x/1000); x2=floor((x-x1*1000)/100); x3=floor((x-x1*1000-x2*100)/10); x4=mod(x,10); if x1==x2&&x2==x3&&x3==x4 y=Inf; elseif x==6174 y=0; else x_ori=[x1,x2,x3,x4]; x_ori=sort(x_ori); x_inv=fliplr(x_ori); dif=0; while dif ~=6174 x_1=1000*x_inv(1)+100*x_inv(2)+10*x_inv(3)+x_inv(4); x_2=1000*x_ori(1)+100*x_ori(2)+10*x_ori(3)+x_ori(4); dif=x_1-x_2; y=y+1; while dif<1000 dif=dif*10; end dif1=floor(dif/1000); dif2=floor((dif-dif1*1000)/100); dif3=floor((dif-dif1*1000-dif2*100)/10); dif4=mod(dif,10); dif_ori=[dif1,dif2,dif3,dif4]; x_ori=sort(dif_ori); x_inv=fliplr(x_ori); end end end 2 hours and 29 minutes ago 2 hours and 45 minutes ago 3 hours and 38 minutes ago 3 hours and 41 minutes ago 3 hours and 43 minutes ago 3 hours and 51 minutes ago 3 hours and 51 minutes ago 3 hours and 53 minutes ago 4 hours and 21 minutes ago Yusen LUO received Solver badge for Solution 2421487 4 hours and 21 minutes ago 4 hours and 31 minutes ago 4 hours and 35 minutes ago 4 hours and 36 minutes ago 4 hours and 38 minutes ago 4 hours and 47 minutes ago 4 hours and 49 minutes ago 5 hours and 13 minutes ago 5 hours and 14 minutes ago 5 hours and 18 minutes ago 5 hours and 18 minutes ago Ron Gorodnitsky received Solver badge for Solution 2421243 5 hours and 18 minutes ago 5 hours and 30 minutes ago 5 hours and 43 minutes ago 5 hours and 46 minutes ago 5 hours and 46 minutes ago
1 – 50 of 1,056,872