PlanttPastes

euler 17

Jun 25th, 2026
25
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // https://en.wikipedia.org/wiki/English_numerals
  2. const ones = "onetwothreefourfivesixseveneightnine".length;
  3. const tens = "twentythirtyfortyfiftysixtyseventyeightyninety".length;
  4. const onetotwenty = ones + "teneleventwelvethirteenfourteenfifteensixteenseventeeneighteennineteen".length;
  5.  
  6. const twentytohundred = ones * 8 + tens * 10;
  7. const onetohundred = twentytohundred + onetotwenty;
  8. console.log(ones * 100 + "hundred".length * 900 + "and".length * 891 + onetohundred * 10 + "onethousand".length);
Advertisement
Add Comment
Please, Sign In to add comment