Last active
          October 13, 2023 06:46 
        
      - 
      
- 
        Save KrishnaPravin/bb02a18bcc07738bf6dd08c4b0fec161 to your computer and use it in GitHub Desktop. 
Revisions
- 
        KrishnaPravin revised this gist Oct 13, 2023 . 1 changed file with 29 additions and 1 deletion.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1 +1,29 @@ const letters = { 'A': 1, 'T': 4, 'M': 4, 'N': 5, } // tn = 9, 42 = 6, am = 5 // tn42am = 2 const ns0 = [1,3,5,6,9,10,14,15,16,18,21,24,27,32,33,36,42,46,50,51] const ns1 = [19,23,37,41,45] const ns2 = [20,52,55] function reduce(numStr) { const n = numStr.split('').reduce((acc,c) => acc += Number(letters[c] || c), 0) return n < 58 ? n : reduce(n.toString()) } let n = 3900, k = [], j = [], l = []; while(n <= 4900) { const str = 'TN42AM' + n const r = reduce(str) ns1.includes(r) && k.push([str, r, 'ns1'].join('-')); ns0.includes(r) && j.push([str, r, 'ns0'].join('-')); ns2.includes(r) && l.push([str, r, 'ns2'].join('-')); n++; } console.log(k, j, l) 
- 
        KrishnaPravin created this gist Oct 13, 2023 .There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ function krs() {}