Skip to main content
added 149 characters in body
Source Link

C (gcc), 87, 76, 74 76 74 72 bytes

Optimization of innat3's C# (Visual C# Interactive Compiler), 100 bytes

f(n,i,t,r,m){for(t=0,m=n;r-2;t++)for(r=i=1,n+=n<m?t:-t;i<n;n%++i||r++);} 

Try it online!

C (gcc), 87, 76, 74 72 bytes

f(n,i,t,r,m){for(t=0,m=n;r-2;t++)for(r=i=1,n+=n<m?t:-t;i<n;n%++i||r++);} 

Try it online!

C (gcc), 87 76 74 72 bytes

Optimization of innat3's C# (Visual C# Interactive Compiler), 100 bytes

f(n,i,t,r,m){for(t=0,m=n;r-2;t++)for(r=i=1,n+=n<m?t:-t;i<n;n%++i||r++);} 

Try it online!

deleted 7 characters in body
Source Link

C (gcc), 87, 76, 76, 74, 74 72 bytes

f(n,i,t,r,m){for(t=0,m=n;r!=2;t++-2;t++)for(r=i=1,n+=n<m?t:-t;i<n;n%++i?0:r++t;i<n;n%++i||r++);} 

Try it online!Try it online!

C (gcc), 87, 76, 74 bytes

f(n,i,t,r,m){for(t=0,m=n;r!=2;t++)for(r=i=1,n+=n<m?t:-t;i<n;n%++i?0:r++);} 

Try it online!

C (gcc), 87, 76, 74 72 bytes

f(n,i,t,r,m){for(t=0,m=n;r-2;t++)for(r=i=1,n+=n<m?t:-t;i<n;n%++i||r++);} 

Try it online!

deleted 77 characters in body
Source Link

C (gcc), 87 76, 76, 74 bytes

This is an optimized version of "C# (Visual C# Interactive Compiler), 100 bytes"

f(n,i,t,r,m){for(t=0,m=n;r!=2;t++)for(r=i=1,n+=n<m?t:-t;i<n;)n%++i>0t;i<n;n%++i?0:r++;r++);} 

Try it online!Try it online!

C (gcc), 87 76 bytes

This is an optimized version of "C# (Visual C# Interactive Compiler), 100 bytes"

f(n,i,t,r,m){for(t=0,m=n;r!=2;t++)for(r=i=1,n+=n<m?t:-t;i<n;)n%++i>0?0:r++;} 

Try it online!

C (gcc), 87, 76, 74 bytes

f(n,i,t,r,m){for(t=0,m=n;r!=2;t++)for(r=i=1,n+=n<m?t:-t;i<n;n%++i?0:r++);} 

Try it online!

deleted 11 characters in body
Source Link
Loading
Source Link
Loading