JSFiddle - React, Tailwind, and code Playground

by atesgoral

JavaScript

const dest = 456768696;
//const dest = 456768696009181;
const destLen = dest.toString().length;

for (var offs = 0; offs < dest; offs++) {
	const step = dest - offs;
  const logStep = Math.log(step);
  
  for (var p = 2; p < logStep; p++) {
    const n = Math.floor(logStep / Math.log(p));
    
    if (Math.pow(n, p) === step) {
      const str = '${' + `${n}**${p}+${offs}` + '}';
      if (str.length < destLen) {
	      console.log(str);
      }
    }
   }
}

console.log('Done');