Skip to main content
deleted 1414 characters in body
Source Link
cleblanc
  • 3.5k
  • 10
  • 16

C (gcc), 67 63 6060 59 bytes

-1 bytes thanks to @JonathanFrech

i,s;f(n){for(s=i=0;++i<=n;s=i=0;i++<n;)s+=n%i?0:i*i;n=sqrt(s);n=n*n==s;}

Try it online!

I use cygwin gcc as follows. I have no need to use the -m32 or -lm flags on this platform either.Try it online!

Target: i686-pc-cygwin
Configured with: /cygdrive/i/szsz/tmpp/gcc/gcc-5.4.0-1.i686/src/gcc-5.4.0/configure --srcdir=/cygdrive/i/szsz/tmpp/gcc/gcc-5.4.0-1.i686/src/
gcc-5.4.0 --prefix=/usr --exec-prefix=/usr --localstatedir=/var --sysconfdir=/etc --docdir=/usr/share/doc/gcc --htmldir=/usr/share/doc/gcc/h
tml -C --build=i686-pc-cygwin --host=i686-pc-cygwin --target=i686-pc-cygwin --without-libiconv-prefix --without-libintl-prefix --libexecdir=
/usr/lib --enable-shared --enable-shared-libgcc --enable-static --enable-version-specific-runtime-libs --enable-bootstrap --enable-__cxa_ate
xit --with-dwarf2 --with-arch=i686 --with-tune=generic --disable-sjlj-exceptions --enable-languages=ada,c,c++,fortran,java,lto,objc,obj-c++
--enable-graphite --enable-threads=posix --enable-libatomic --enable-libcilkrts --enable-libgomp --enable-libitm --enable-libquadmath --enab
le-libquadmath-support --enable-libssp --enable-libada --enable-libjava --enable-libgcj-sublibs --disable-java-awt --disable-symvers --with-
ecj-jar=/usr/share/java/ecj.jar --with-gnu-ld --with-gnu-as --with-cloog-include=/usr/include/cloog-isl --without-libiconv-prefix --without-
libintl-prefix --with-system-zlib --enable-linker-build-id --with-default-libstdcxx-abi=gcc4-compatible
Thread model: posix
gcc version 5.4.0 (GCC)

C (gcc), 67 63 60 bytes

i,s;f(n){for(s=i=0;++i<=n;)s+=n%i?0:i*i;n=sqrt(s);n=n*n==s;}

Try it online!

I use cygwin gcc as follows. I have no need to use the -m32 or -lm flags on this platform either.

Target: i686-pc-cygwin
Configured with: /cygdrive/i/szsz/tmpp/gcc/gcc-5.4.0-1.i686/src/gcc-5.4.0/configure --srcdir=/cygdrive/i/szsz/tmpp/gcc/gcc-5.4.0-1.i686/src/
gcc-5.4.0 --prefix=/usr --exec-prefix=/usr --localstatedir=/var --sysconfdir=/etc --docdir=/usr/share/doc/gcc --htmldir=/usr/share/doc/gcc/h
tml -C --build=i686-pc-cygwin --host=i686-pc-cygwin --target=i686-pc-cygwin --without-libiconv-prefix --without-libintl-prefix --libexecdir=
/usr/lib --enable-shared --enable-shared-libgcc --enable-static --enable-version-specific-runtime-libs --enable-bootstrap --enable-__cxa_ate
xit --with-dwarf2 --with-arch=i686 --with-tune=generic --disable-sjlj-exceptions --enable-languages=ada,c,c++,fortran,java,lto,objc,obj-c++
--enable-graphite --enable-threads=posix --enable-libatomic --enable-libcilkrts --enable-libgomp --enable-libitm --enable-libquadmath --enab
le-libquadmath-support --enable-libssp --enable-libada --enable-libjava --enable-libgcj-sublibs --disable-java-awt --disable-symvers --with-
ecj-jar=/usr/share/java/ecj.jar --with-gnu-ld --with-gnu-as --with-cloog-include=/usr/include/cloog-isl --without-libiconv-prefix --without-
libintl-prefix --with-system-zlib --enable-linker-build-id --with-default-libstdcxx-abi=gcc4-compatible
Thread model: posix
gcc version 5.4.0 (GCC)

C (gcc), 67 63 60 59 bytes

-1 bytes thanks to @JonathanFrech

i,s;f(n){for(s=i=0;i++<n;)s+=n%i?0:i*i;n=sqrt(s);n=n*n==s;}

Try it online!

added 1462 characters in body
Source Link
cleblanc
  • 3.5k
  • 10
  • 16

C (gcc), 67 63 60 bytes

i,s;f(n){for(s=i=0;++i<=n;)s+=n%i?0:i*i;n=sqrt(s);n=n*n==s;}

Try it online!

I use cygwin gcc as follows. I have no need to use the -m32 or -lm flags on this platform either.

Target: i686-pc-cygwin
Configured with: /cygdrive/i/szsz/tmpp/gcc/gcc-5.4.0-1.i686/src/gcc-5.4.0/configure --srcdir=/cygdrive/i/szsz/tmpp/gcc/gcc-5.4.0-1.i686/src/
gcc-5.4.0 --prefix=/usr --exec-prefix=/usr --localstatedir=/var --sysconfdir=/etc --docdir=/usr/share/doc/gcc --htmldir=/usr/share/doc/gcc/h
tml -C --build=i686-pc-cygwin --host=i686-pc-cygwin --target=i686-pc-cygwin --without-libiconv-prefix --without-libintl-prefix --libexecdir=
/usr/lib --enable-shared --enable-shared-libgcc --enable-static --enable-version-specific-runtime-libs --enable-bootstrap --enable-__cxa_ate
xit --with-dwarf2 --with-arch=i686 --with-tune=generic --disable-sjlj-exceptions --enable-languages=ada,c,c++,fortran,java,lto,objc,obj-c++
--enable-graphite --enable-threads=posix --enable-libatomic --enable-libcilkrts --enable-libgomp --enable-libitm --enable-libquadmath --enab
le-libquadmath-support --enable-libssp --enable-libada --enable-libjava --enable-libgcj-sublibs --disable-java-awt --disable-symvers --with-
ecj-jar=/usr/share/java/ecj.jar --with-gnu-ld --with-gnu-as --with-cloog-include=/usr/include/cloog-isl --without-libiconv-prefix --without-
libintl-prefix --with-system-zlib --enable-linker-build-id --with-default-libstdcxx-abi=gcc4-compatible
Thread model: posix
gcc version 5.4.0 (GCC)

C (gcc), 67 63 60 bytes

i,s;f(n){for(s=i=0;++i<=n;)s+=n%i?0:i*i;n=sqrt(s);n=n*n==s;}

Try it online!

C (gcc), 67 63 60 bytes

i,s;f(n){for(s=i=0;++i<=n;)s+=n%i?0:i*i;n=sqrt(s);n=n*n==s;}

Try it online!

I use cygwin gcc as follows. I have no need to use the -m32 or -lm flags on this platform either.

Target: i686-pc-cygwin
Configured with: /cygdrive/i/szsz/tmpp/gcc/gcc-5.4.0-1.i686/src/gcc-5.4.0/configure --srcdir=/cygdrive/i/szsz/tmpp/gcc/gcc-5.4.0-1.i686/src/
gcc-5.4.0 --prefix=/usr --exec-prefix=/usr --localstatedir=/var --sysconfdir=/etc --docdir=/usr/share/doc/gcc --htmldir=/usr/share/doc/gcc/h
tml -C --build=i686-pc-cygwin --host=i686-pc-cygwin --target=i686-pc-cygwin --without-libiconv-prefix --without-libintl-prefix --libexecdir=
/usr/lib --enable-shared --enable-shared-libgcc --enable-static --enable-version-specific-runtime-libs --enable-bootstrap --enable-__cxa_ate
xit --with-dwarf2 --with-arch=i686 --with-tune=generic --disable-sjlj-exceptions --enable-languages=ada,c,c++,fortran,java,lto,objc,obj-c++
--enable-graphite --enable-threads=posix --enable-libatomic --enable-libcilkrts --enable-libgomp --enable-libitm --enable-libquadmath --enab
le-libquadmath-support --enable-libssp --enable-libada --enable-libjava --enable-libgcj-sublibs --disable-java-awt --disable-symvers --with-
ecj-jar=/usr/share/java/ecj.jar --with-gnu-ld --with-gnu-as --with-cloog-include=/usr/include/cloog-isl --without-libiconv-prefix --without-
libintl-prefix --with-system-zlib --enable-linker-build-id --with-default-libstdcxx-abi=gcc4-compatible
Thread model: posix
gcc version 5.4.0 (GCC)
added 10 characters in body
Source Link
cleblanc
  • 3.5k
  • 10
  • 16

C (gcc), 67 6363 60 bytes

i,s;f(n){for(s=i=0;++i<=n;is=i=0;++i<=n;)s+=n%i?0:i*i;n=sqrt(s)*sqrt(s)==s;;n=n*n==s;}

Try it online!Try it online!

C (gcc), 67 63 bytes

i,s;f(n){for(s=i=0;++i<=n;i)s+=n%i?0:i*i;n=sqrt(s)*sqrt(s)==s;}

Try it online!

C (gcc), 67 63 60 bytes

i,s;f(n){for(s=i=0;++i<=n;)s+=n%i?0:i*i;n=sqrt(s);n=n*n==s;}

Try it online!

Source Link
cleblanc
  • 3.5k
  • 10
  • 16
Loading