JSFiddle - React, Tailwind, and code Playground

by Mert Ener

HTML

<input type="text" id="prime">
<input type="button" id="run" value="Find!" onclick="nthPrime()">
<label id="result"></label>

JavaScript

function nthPrime() {
  
  for (i=1; ((i*i*i)-i)%6==0; i++ );
  document.getElementById("result").innerHTML = i;
}