Skip to main content
added 91 characters in body
Source Link

Scala, 97 9696 91 bytes

b=>defb=>{def g(i:Int=>Int={i=>ifInt):Int=if(BigInt(b*b*b-b).gcd(i)<2&&2>1|2.to(i-1).existsforall(i%_==0i%_>0))i else g(i+1)}else i
g(b)}

Try it online!Try it online!

Thanks to Sisyphus for -1!

Scala, 97 96 bytes

b=>def g:Int=>Int={i=>if(BigInt(b*b*b-b).gcd(i)<2&&2.to(i-1).exists(i%_==0))i else g(i+1)}
g(b)}

Try it online!

Thanks to Sisyphus for -1!

Scala, 97 96 91 bytes

b=>{def g(i:Int):Int=if(BigInt(b*b*b-b).gcd(i)>1|2.to(i-1).forall(i%_>0))g(i+1)else i
g(b)}

Try it online!

added 112 characters in body
Source Link

Scala, 9797 96 bytes

b=>def g:Int=>Int={i=>if(BigInt(b*b*b-b).gcd(i)==1&&2<2&&2.to(i-1).exists(i%_==0))i else g(i+1)}
g(b)}

Try it online!Try it online!

Thanks to Sisyphus for -1!

Scala, 97 bytes

b=>def g:Int=>Int={i=>if(BigInt(b*b*b-b).gcd(i)==1&&2.to(i-1).exists(i%_==0))i else g(i+1)}
g(b)}

Try it online!

Scala, 97 96 bytes

b=>def g:Int=>Int={i=>if(BigInt(b*b*b-b).gcd(i)<2&&2.to(i-1).exists(i%_==0))i else g(i+1)}
g(b)}

Try it online!

Thanks to Sisyphus for -1!

Source Link

Scala, 97 bytes

b=>def g:Int=>Int={i=>if(BigInt(b*b*b-b).gcd(i)==1&&2.to(i-1).exists(i%_==0))i else g(i+1)}
g(b)}

Try it online!