Skip to main content
added 34 characters in body
Source Link
sinvec
  • 2k
  • 6
  • 28

C (gcc), 88 74 67 66 6464 53 bytes

a,b,g;fb;f(n){for(g=a=n;~a*g;aa=n;~a*n;b=b?--)for(b=n;~b*g;bb:--a)g=a*a+b*b-n;g=g;n*=a*a+b*b!=n;a=n;}

-14 bytes - thanks to Kevin Cruijssen
-7 bytes - by omitting return (using global variable)
-1 byte - by using - instead of !=
-2 bytes - thanks to AZTECCO
-11 bytes - thanks to AZTECCO x2

Try it online!Try it online!

C (gcc), 88 74 67 66 64 bytes

a,b,g;f(n){for(g=a=n;~a*g;a--)for(b=n;~b*g;b--)g=a*a+b*b-n;g=g;}

-14 bytes - thanks to Kevin Cruijssen
-7 bytes - by omitting return (using global variable)
-1 byte - by using - instead of !=
-2 bytes - thanks to AZTECCO

Try it online!

C (gcc), 88 74 67 66 64 53 bytes

a,b;f(n){for(a=n;~a*n;b=b?--b:--a)n*=a*a+b*b!=n;a=n;}

-14 bytes - thanks to Kevin Cruijssen
-7 bytes - by omitting return (using global variable)
-1 byte - by using - instead of !=
-2 bytes - thanks to AZTECCO
-11 bytes - thanks to AZTECCO x2

Try it online!

added 20 characters in body
Source Link
sinvec
  • 2k
  • 6
  • 28

C (gcc), 88 74 67 6666 64 bytes

a,b,g;f(n){g=1;forfor(a=n;a+1&&g;ag=a=n;~a*g;a--)for(b=n;b+1&&g;bb=n;~b*g;b--)g=a*a+b*b-n;n;g=g;}

-14 bytes - thanks to Kevin Cruijssen
-7 bytes - by omitting return (using global variable)
-1 byte - by using - instead of !=
-2 bytes - thanks to AZTECCO

Try it online!Try it online!

C (gcc), 88 74 67 66 bytes

a,b,g;f(n){g=1;for(a=n;a+1&&g;a--)for(b=n;b+1&&g;b--)g=a*a+b*b-n;}

-14 bytes - thanks Kevin Cruijssen
-7 bytes - by omitting return (using global variable)
-1 byte - by using - instead of !=

Try it online!

C (gcc), 88 74 67 66 64 bytes

a,b,g;f(n){for(g=a=n;~a*g;a--)for(b=n;~b*g;b--)g=a*a+b*b-n;g=g;}

-14 bytes - thanks to Kevin Cruijssen
-7 bytes - by omitting return (using global variable)
-1 byte - by using - instead of !=
-2 bytes - thanks to AZTECCO

Try it online!

added 51 characters in body
Source Link
sinvec
  • 2k
  • 6
  • 28

C (gcc), 88 74 6767 66 bytes

a,b,g;f(n){g=1;for(a=n;a+1&&g;a--)for(b=n;b+1&&g;b--)g=a*a+b*b!=n;-n;}

-14 bytes - thanks Kevin Cruijssen
-7 bytes - by omitting return (using global variable)
-1 byte - by using - instead of !=

Try it online!Try it online!

C (gcc), 88 74 67 bytes

a,b,g;f(n){g=1;for(a=n;a+1&&g;a--)for(b=n;b+1&&g;b--)g=a*a+b*b!=n;}

-14 bytes - thanks Kevin Cruijssen
-7 bytes - by omitting return (using global variable)

Try it online!

C (gcc), 88 74 67 66 bytes

a,b,g;f(n){g=1;for(a=n;a+1&&g;a--)for(b=n;b+1&&g;b--)g=a*a+b*b-n;}

-14 bytes - thanks Kevin Cruijssen
-7 bytes - by omitting return (using global variable)
-1 byte - by using - instead of !=

Try it online!

added 58 characters in body
Source Link
sinvec
  • 2k
  • 6
  • 28
Loading
deleted 126 characters in body
Source Link
sinvec
  • 2k
  • 6
  • 28
Loading
added 84 characters in body
Source Link
sinvec
  • 2k
  • 6
  • 28
Loading
added 70 characters in body
Source Link
sinvec
  • 2k
  • 6
  • 28
Loading
edited body
Source Link
sinvec
  • 2k
  • 6
  • 28
Loading
Source Link
sinvec
  • 2k
  • 6
  • 28
Loading