Skip to main content
added 8 characters in body
Source Link
Noodle9
  • 20.3k
  • 3
  • 21
  • 46

C (gcc), 87 8686 84 bytes

Saved a byte thanks to the man himself Arnauld!!!

i;q;p;m;f(b){for(p=m=b;p|!q;++m)for(q=p=i=1;++i<m;p=p&&m%iq=p=i=1;++i<m;)q=m%iq=m%i<1?q:p=0,q&&b*~-b*~b%i;b*~b%i:q;--m;}

Try it online!Try it online!

Port of my Python answer.

C (gcc), 87 86 bytes

Saved a byte thanks to the man himself Arnauld!!!

i;q;p;m;f(b){for(p=m=b;p|!q;++m)for(q=p=i=1;++i<m;p=p&&m%i)q=m%i?q:q&&b*~-b*~b%i;--m;}

Try it online!

Port of my Python answer.

C (gcc), 87 86 84 bytes

Saved a byte thanks to the man himself Arnauld!!!

i;q;p;m;f(b){for(p=m=b;p|!q;++m)for(q=p=i=1;++i<m;)q=m%i<1?p=0,q&&b*~-b*~b%i:q;--m;}

Try it online!

Port of my Python answer.

added 122 characters in body
Source Link
Noodle9
  • 20.3k
  • 3
  • 21
  • 46

C (gcc), 8787 86 bytes

Saved a byte thanks to the man himself Arnauld!!!

i;q;p;m;f(b){for(p=m=b;p|!q;++m)for(q=p=i=1;++i<m;p=p&&m%i)q=m%i?q:q&&(b*b*bq&&b*~-b)%i;b*~b%i;--m;}

Try it online!Try it online!

Port of my Python answer.

C (gcc), 87 bytes

i;q;p;m;f(b){for(p=m=b;p|!q;++m)for(q=p=i=1;++i<m;p=p&&m%i)q=m%i?q:q&&(b*b*b-b)%i;--m;}

Try it online!

Port of my Python answer.

C (gcc), 87 86 bytes

Saved a byte thanks to the man himself Arnauld!!!

i;q;p;m;f(b){for(p=m=b;p|!q;++m)for(q=p=i=1;++i<m;p=p&&m%i)q=m%i?q:q&&b*~-b*~b%i;--m;}

Try it online!

Port of my Python answer.

deleted 5 characters in body
Source Link
Noodle9
  • 20.3k
  • 3
  • 21
  • 46

C (gcc), 9187 bytes

i;q;p;m;f(b){for(q=0,p=m=b;p|!q;++m)for(q=p=i=1;++i<m;p=p&&m%i)q=m%i?q:q&&(b*b*b-b)%i;--m;}

Try it online!Try it online!

Port of my Python answer.

C (gcc), 91 bytes

i;q;p;m;f(b){for(q=0,p=m=b;p|!q;++m)for(q=p=i=1;++i<m;p=p&&m%i)q=m%i?q:q&&(b*b*b-b)%i;--m;}

Try it online!

Port of my Python answer.

C (gcc), 87 bytes

i;q;p;m;f(b){for(p=m=b;p|!q;++m)for(q=p=i=1;++i<m;p=p&&m%i)q=m%i?q:q&&(b*b*b-b)%i;--m;}

Try it online!

Port of my Python answer.

Source Link
Noodle9
  • 20.3k
  • 3
  • 21
  • 46
Loading