Post History
JavaScript (Node.js), 86 bytes f=(a,b=2,c=(a,b=2)=>a-b?a%b&&c(a,b+1):1,d=a=>c(++a)?a:d(a))=>!c(b)|d(b)-b<a?f(a,b+1):b Try it online!
Answer
#1: Initial revision
# [JavaScript (Node.js)], 86 bytes <!-- language-all: lang-javascript --> f=(a,b=2,c=(a,b=2)=>a-b?a%b&&c(a,b+1):1,d=a=>c(++a)?a:d(a))=>!c(b)|d(b)-b<a?f(a,b+1):b [Try it online!][TIO-ki3k7tm0] [JavaScript (Node.js)]: https://nodejs.org [TIO-ki3k7tm0]: https://tio.run/##bcrLCsIwEIXhvW/hwjJDEiH1SmuaZ5lJGlFKI1Zc@e6xgm5kNofDx3@lJ03hfrk9zJhjX0pyQJpdrcP3oOvIsKcVV1X4kLLYWB0duS6AUoSemgiEc7gMwPiK8xg@kU@/nEsb8jjloV8P@QwJLGK7@LNasI1gW8F2gu0FOwh2nK28AQ "JavaScript (Node.js) – Try It Online"