{"id":"rosetta/100-doors","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/100_doors","title":"100 doors","kind":"fixed","tests":[{"input":"","output":"1 4 9 16 25 36 49 64 81 100"}],"match":"numbers","minTerms":null,"tags":["classic","number","rosetta"]} {"id":"rosetta/99-bottles-of-beer","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/99_bottles_of_beer","title":"99 bottles of beer","kind":"fixed","tests":[{"input":"","output":"99 bottles of beer on the wall\n99 bottles of beer\nTake one down, pass it around\n98 bottles of beer on the wall\n\n98 bottles of beer on the wall\n98 bottles of beer\nTake one down, pass it around\n97 bottles of beer on the wall\n\n97 bottles of beer on the wall\n97 bottles of beer\nTake one down, pass it around\n96 bottles of beer on the wall\n\n96 bottles of beer on the wall\n96 bottles of beer\nTake one down, pass it around\n95 bottles of beer on the wall\n\n95 bottles of beer on the wall\n95 bottles of beer\nTake one down, pass it around\n94 bottles of beer on the wall\n\n94 bottles of beer on the wall\n94 bottles of beer\nTake one down, pass it around\n93 bottles of beer on the wall\n\n93 bottles of beer on the wall\n93 bottles of beer\nTake one down, pass it around\n92 bottles of beer on the wall\n\n92 bottles of beer on the wall\n92 bottles of beer\nTake one down, pass it around\n91 bottles of beer on the wall\n\n91 bottles of beer on the wall\n91 bottles of beer\nTake one down, pass it around\n90 bottles of beer on the wall\n\n90 bottles of beer on the wall\n90 bottles of beer\nTake one down, pass it around\n89 bottles of beer on the wall\n\n89 bottles of beer on the wall\n89 bottles of beer\nTake one down, pass it around\n88 bottles of beer on the wall\n\n88 bottles of beer on the wall\n88 bottles of beer\nTake one down, pass it around\n87 bottles of beer on the wall\n\n87 bottles of beer on the wall\n87 bottles of beer\nTake one down, pass it around\n86 bottles of beer on the wall\n\n86 bottles of beer on the wall\n86 bottles of beer\nTake one down, pass it around\n85 bottles of beer on the wall\n\n85 bottles of beer on the wall\n85 bottles of beer\nTake one down, pass it around\n84 bottles of beer on the wall\n\n84 bottles of beer on the wall\n84 bottles of beer\nTake one down, pass it around\n83 bottles of beer on the wall\n\n83 bottles of beer on the wall\n83 bottles of beer\nTake one down, pass it around\n82 bottles of beer on the wall\n\n82 bottles of beer on the wall\n82 bottles of beer\nTake one down, pass it around\n81 bottles of beer on the wall\n\n81 bottles of beer on the wall\n81 bottles of beer\nTake one down, pass it around\n80 bottles of beer on the wall\n\n80 bottles of beer on the wall\n80 bottles of beer\nTake one down, pass it around\n79 bottles of beer on the wall\n\n79 bottles of beer on the wall\n79 bottles of beer\nTake one down, pass it around\n78 bottles of beer on the wall\n\n78 bottles of beer on the wall\n78 bottles of beer\nTake one down, pass it around\n77 bottles of beer on the wall\n\n77 bottles of beer on the wall\n77 bottles of beer\nTake one down, pass it around\n76 bottles of beer on the wall\n\n76 bottles of beer on the wall\n76 bottles of beer\nTake one down, pass it around\n75 bottles of beer on the wall\n\n75 bottles of beer on the wall\n75 bottles of beer\nTake one down, pass it around\n74 bottles of beer on the wall\n\n74 bottles of beer on the wall\n74 bottles of beer\nTake one down, pass it around\n73 bottles of beer on the wall\n\n73 bottles of beer on the wall\n73 bottles of beer\nTake one down, pass it around\n72 bottles of beer on the wall\n\n72 bottles of beer on the wall\n72 bottles of beer\nTake one down, pass it around\n71 bottles of beer on the wall\n\n71 bottles of beer on the wall\n71 bottles of beer\nTake one down, pass it around\n70 bottles of beer on the wall\n\n70 bottles of beer on the wall\n70 bottles of beer\nTake one down, pass it around\n69 bottles of beer on the wall\n\n69 bottles of beer on the wall\n69 bottles of beer\nTake one down, pass it around\n68 bottles of beer on the wall\n\n68 bottles of beer on the wall\n68 bottles of beer\nTake one down, pass it around\n67 bottles of beer on the wall\n\n67 bottles of beer on the wall\n67 bottles of beer\nTake one down, pass it around\n66 bottles of beer on the wall\n\n66 bottles of beer on the wall\n66 bottles of beer\nTake one down, pass it around\n65 bottles of beer on the wall\n\n65 bottles of beer on the wall\n65 bottles of beer\nTake one down, pass it around\n64 bottles of beer on the wall\n\n64 bottles of beer on the wall\n64 bottles of beer\nTake one down, pass it around\n63 bottles of beer on the wall\n\n63 bottles of beer on the wall\n63 bottles of beer\nTake one down, pass it around\n62 bottles of beer on the wall\n\n62 bottles of beer on the wall\n62 bottles of beer\nTake one down, pass it around\n61 bottles of beer on the wall\n\n61 bottles of beer on the wall\n61 bottles of beer\nTake one down, pass it around\n60 bottles of beer on the wall\n\n60 bottles of beer on the wall\n60 bottles of beer\nTake one down, pass it around\n59 bottles of beer on the wall\n\n59 bottles of beer on the wall\n59 bottles of beer\nTake one down, pass it around\n58 bottles of beer on the wall\n\n58 bottles of beer on the wall\n58 bottles of beer\nTake one down, pass it around\n57 bottles of beer on the wall\n\n57 bottles of beer on the wall\n57 bottles of beer\nTake one down, pass it around\n56 bottles of beer on the wall\n\n56 bottles of beer on the wall\n56 bottles of beer\nTake one down, pass it around\n55 bottles of beer on the wall\n\n55 bottles of beer on the wall\n55 bottles of beer\nTake one down, pass it around\n54 bottles of beer on the wall\n\n54 bottles of beer on the wall\n54 bottles of beer\nTake one down, pass it around\n53 bottles of beer on the wall\n\n53 bottles of beer on the wall\n53 bottles of beer\nTake one down, pass it around\n52 bottles of beer on the wall\n\n52 bottles of beer on the wall\n52 bottles of beer\nTake one down, pass it around\n51 bottles of beer on the wall\n\n51 bottles of beer on the wall\n51 bottles of beer\nTake one down, pass it around\n50 bottles of beer on the wall\n\n50 bottles of beer on the wall\n50 bottles of beer\nTake one down, pass it around\n49 bottles of beer on the wall\n\n49 bottles of beer on the wall\n49 bottles of beer\nTake one down, pass it around\n48 bottles of beer on the wall\n\n48 bottles of beer on the wall\n48 bottles of beer\nTake one down, pass it around\n47 bottles of beer on the wall\n\n47 bottles of beer on the wall\n47 bottles of beer\nTake one down, pass it around\n46 bottles of beer on the wall\n\n46 bottles of beer on the wall\n46 bottles of beer\nTake one down, pass it around\n45 bottles of beer on the wall\n\n45 bottles of beer on the wall\n45 bottles of beer\nTake one down, pass it around\n44 bottles of beer on the wall\n\n44 bottles of beer on the wall\n44 bottles of beer\nTake one down, pass it around\n43 bottles of beer on the wall\n\n43 bottles of beer on the wall\n43 bottles of beer\nTake one down, pass it around\n42 bottles of beer on the wall\n\n42 bottles of beer on the wall\n42 bottles of beer\nTake one down, pass it around\n41 bottles of beer on the wall\n\n41 bottles of beer on the wall\n41 bottles of beer\nTake one down, pass it around\n40 bottles of beer on the wall\n\n40 bottles of beer on the wall\n40 bottles of beer\nTake one down, pass it around\n39 bottles of beer on the wall\n\n39 bottles of beer on the wall\n39 bottles of beer\nTake one down, pass it around\n38 bottles of beer on the wall\n\n38 bottles of beer on the wall\n38 bottles of beer\nTake one down, pass it around\n37 bottles of beer on the wall\n\n37 bottles of beer on the wall\n37 bottles of beer\nTake one down, pass it around\n36 bottles of beer on the wall\n\n36 bottles of beer on the wall\n36 bottles of beer\nTake one down, pass it around\n35 bottles of beer on the wall\n\n35 bottles of beer on the wall\n35 bottles of beer\nTake one down, pass it around\n34 bottles of beer on the wall\n\n34 bottles of beer on the wall\n34 bottles of beer\nTake one down, pass it around\n33 bottles of beer on the wall\n\n33 bottles of beer on the wall\n33 bottles of beer\nTake one down, pass it around\n32 bottles of beer on the wall\n\n32 bottles of beer on the wall\n32 bottles of beer\nTake one down, pass it around\n31 bottles of beer on the wall\n\n31 bottles of beer on the wall\n31 bottles of beer\nTake one down, pass it around\n30 bottles of beer on the wall\n\n30 bottles of beer on the wall\n30 bottles of beer\nTake one down, pass it around\n29 bottles of beer on the wall\n\n29 bottles of beer on the wall\n29 bottles of beer\nTake one down, pass it around\n28 bottles of beer on the wall\n\n28 bottles of beer on the wall\n28 bottles of beer\nTake one down, pass it around\n27 bottles of beer on the wall\n\n27 bottles of beer on the wall\n27 bottles of beer\nTake one down, pass it around\n26 bottles of beer on the wall\n\n26 bottles of beer on the wall\n26 bottles of beer\nTake one down, pass it around\n25 bottles of beer on the wall\n\n25 bottles of beer on the wall\n25 bottles of beer\nTake one down, pass it around\n24 bottles of beer on the wall\n\n24 bottles of beer on the wall\n24 bottles of beer\nTake one down, pass it around\n23 bottles of beer on the wall\n\n23 bottles of beer on the wall\n23 bottles of beer\nTake one down, pass it around\n22 bottles of beer on the wall\n\n22 bottles of beer on the wall\n22 bottles of beer\nTake one down, pass it around\n21 bottles of beer on the wall\n\n21 bottles of beer on the wall\n21 bottles of beer\nTake one down, pass it around\n20 bottles of beer on the wall\n\n20 bottles of beer on the wall\n20 bottles of beer\nTake one down, pass it around\n19 bottles of beer on the wall\n\n19 bottles of beer on the wall\n19 bottles of beer\nTake one down, pass it around\n18 bottles of beer on the wall\n\n18 bottles of beer on the wall\n18 bottles of beer\nTake one down, pass it around\n17 bottles of beer on the wall\n\n17 bottles of beer on the wall\n17 bottles of beer\nTake one down, pass it around\n16 bottles of beer on the wall\n\n16 bottles of beer on the wall\n16 bottles of beer\nTake one down, pass it around\n15 bottles of beer on the wall\n\n15 bottles of beer on the wall\n15 bottles of beer\nTake one down, pass it around\n14 bottles of beer on the wall\n\n14 bottles of beer on the wall\n14 bottles of beer\nTake one down, pass it around\n13 bottles of beer on the wall\n\n13 bottles of beer on the wall\n13 bottles of beer\nTake one down, pass it around\n12 bottles of beer on the wall\n\n12 bottles of beer on the wall\n12 bottles of beer\nTake one down, pass it around\n11 bottles of beer on the wall\n\n11 bottles of beer on the wall\n11 bottles of beer\nTake one down, pass it around\n10 bottles of beer on the wall\n\n10 bottles of beer on the wall\n10 bottles of beer\nTake one down, pass it around\n9 bottles of beer on the wall\n\n9 bottles of beer on the wall\n9 bottles of beer\nTake one down, pass it around\n8 bottles of beer on the wall\n\n8 bottles of beer on the wall\n8 bottles of beer\nTake one down, pass it around\n7 bottles of beer on the wall\n\n7 bottles of beer on the wall\n7 bottles of beer\nTake one down, pass it around\n6 bottles of beer on the wall\n\n6 bottles of beer on the wall\n6 bottles of beer\nTake one down, pass it around\n5 bottles of beer on the wall\n\n5 bottles of beer on the wall\n5 bottles of beer\nTake one down, pass it around\n4 bottles of beer on the wall\n\n4 bottles of beer on the wall\n4 bottles of beer\nTake one down, pass it around\n3 bottles of beer on the wall\n\n3 bottles of beer on the wall\n3 bottles of beer\nTake one down, pass it around\n2 bottles of beer on the wall\n\n2 bottles of beer on the wall\n2 bottles of beer\nTake one down, pass it around\n1 bottles of beer on the wall\n\n1 bottles of beer on the wall\n1 bottles of beer\nTake one down, pass it around\n0 bottles of beer on the wall"}],"match":"exact","minTerms":null,"tags":["classic","no-grammar","rosetta","string","trailing-ws-ok"]} {"id":"rosetta/a-b","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/A%2BB","title":"A+B","kind":"io","tests":[{"input":"2 2","output":"4"},{"input":"3 2","output":"5"},{"input":"-5 3","output":"-2"},{"input":"0 0","output":"0"},{"input":"1000 1000","output":"2000"},{"input":"-1000 -1000","output":"-2000"},{"input":"17 -4","output":"13"}],"match":"numbers","minTerms":null,"tags":["classic","number","rosetta"]} {"id":"rosetta/abc-problem","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/ABC_problem","title":"ABC problem: 1 if the word can be spelled with the blocks, else 0","kind":"io","tests":[{"input":"A","output":"1"},{"input":"BARK","output":"1"},{"input":"BOOK","output":"0"},{"input":"TREAT","output":"1"},{"input":"COMMON","output":"0"},{"input":"SQUAD","output":"1"},{"input":"CONFUSE","output":"1"}],"match":"numbers","minTerms":null,"tags":["decision","rosetta","search","string"]} {"id":"rosetta/abundant-deficient-and-perfect-number-classifications","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Abundant,_deficient_and_perfect_number_classifications","title":"Abundant, deficient and perfect number classifications","kind":"fixed","tests":[{"input":"","output":"15043\n4\n4953"}],"match":"numbers","minTerms":null,"tags":["number","rosetta"]} {"id":"rosetta/ackermann-function","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Ackermann_function","title":"Ackermann function","kind":"io","tests":[{"input":"0 0","output":"1"},{"input":"0 5","output":"6"},{"input":"1 0","output":"2"},{"input":"1 2","output":"4"},{"input":"2 0","output":"3"},{"input":"2 3","output":"9"},{"input":"3 3","output":"61"},{"input":"3 4","output":"125"},{"input":"1 5","output":"7"},{"input":"3 5","output":"253"}],"match":"numbers","minTerms":null,"tags":["number","recursion","rosetta"]} {"id":"rosetta/additive-primes","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Additive_primes","title":"Additive primes","kind":"fixed","tests":[{"input":"","output":"2 3 5 7 11 23 29 41 43 47 61 67 83 89 101 113 131 137 139 151 157 173 179 191 193 197 199 223 227 229 241 263 269 281 283 311 313 317 331 337 353 359 373 379 397 401 409 421 443 449 461 463 467 487"}],"match":"numbers","minTerms":null,"tags":["number","prime","rosetta"]} {"id":"rosetta/amicable-pairs","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Amicable_pairs","title":"Amicable pairs","kind":"fixed","tests":[{"input":"","output":"220 284\n1184 1210\n2620 2924\n5020 5564\n6232 6368\n10744 10856\n12285 14595\n17296 18416"}],"match":"numbers","minTerms":null,"tags":["number","rosetta"]} {"id":"rosetta/arithmetic-integer","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Arithmetic/Integer","title":"Arithmetic/Integer: sum, difference, product, quotient and remainder of two positive integers","kind":"io","tests":[{"input":"7 3","output":"10 4 21 2 1"},{"input":"20 4","output":"24 16 80 5 0"},{"input":"9 10","output":"19 -1 90 0 9"},{"input":"100 7","output":"107 93 700 14 2"},{"input":"1 1","output":"2 0 1 1 0"}],"match":"numbers","minTerms":null,"tags":["number","rosetta"]} {"id":"rosetta/attractive-numbers","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Attractive_numbers","title":"Attractive numbers","kind":"fixed","tests":[{"input":"","output":"4 6 8 9 10 12 14 15 18 20 21 22 25 26 27 28 30 32 33 34 35 38 39 42 44 45 46 48 49 50 51 52 55 57 58 62 63 65 66 68 69 70 72 74 75 76 77 78 80 82 85 86 87 91 92 93 94 95 98 99 102 105 106 108 110 111 112 114 115 116 117 118 119 120"}],"match":"numbers","minTerms":null,"tags":["number","prime","rosetta"]} {"id":"rosetta/balanced-brackets","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Balanced_brackets","title":"Balanced brackets: OK or NOT OK","kind":"io","tests":[{"input":"","output":"OK"},{"input":"[]","output":"OK"},{"input":"][","output":"NOT OK"},{"input":"[][]","output":"OK"},{"input":"][][","output":"NOT OK"},{"input":"[[][]]","output":"OK"},{"input":"[]][[]","output":"NOT OK"},{"input":"[[[]]]","output":"OK"},{"input":"]]][[[","output":"NOT OK"},{"input":"[","output":"NOT OK"}],"match":"exact","minTerms":null,"tags":["brackets","decision","rosetta","string"]} {"id":"rosetta/binary-digits","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Binary_digits","title":"Binary digits","kind":"io","tests":[{"input":"0","output":"0"},{"input":"1","output":"1"},{"input":"2","output":"10"},{"input":"5","output":"101"},{"input":"50","output":"110010"},{"input":"255","output":"11111111"},{"input":"256","output":"100000000"},{"input":"9000","output":"10001100101000"}],"match":"exact","minTerms":null,"tags":["binary","number","rosetta"]} {"id":"rosetta/caesar-cipher","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Caesar_cipher","title":"Caesar cipher: key on the first line, text on the second, encoded","kind":"io","tests":[{"input":"3\nThe quick brown fox Jumped over the lazy Dog","output":"Wkh txlfn eurzq ira Mxpshg ryhu wkh odcb Grj"},{"input":"13\nHello, World!","output":"Uryyb, Jbeyq!"},{"input":"25\nabc XYZ","output":"zab WXY"},{"input":"1\nzZ","output":"aA"}],"match":"exact","minTerms":null,"tags":["cipher","rosetta","string"]} {"id":"rosetta/catalan-numbers","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Catalan_numbers","title":"Catalan numbers","kind":"fixed","tests":[{"input":"","output":"1 1 2 5 14 42 132 429 1430 4862 16796 58786 208012 742900 2674440"}],"match":"numbers","minTerms":null,"tags":["number","rosetta","sequence"]} {"id":"rosetta/character-codes","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Character_codes","title":"Character codes: the code of a character","kind":"io","tests":[{"input":"a","output":"97"},{"input":"A","output":"65"},{"input":"0","output":"48"},{"input":" ","output":"32"},{"input":"~","output":"126"},{"input":"z","output":"122"}],"match":"numbers","minTerms":null,"tags":["number","rosetta","string"]} {"id":"rosetta/combinations","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Combinations","title":"Combinations: all m-element subsets of 0 .. n-1 in sorted order","kind":"io","tests":[{"input":"3 5","output":"0 1 2\n0 1 3\n0 1 4\n0 2 3\n0 2 4\n0 3 4\n1 2 3\n1 2 4\n1 3 4\n2 3 4"},{"input":"1 3","output":"0\n1\n2"},{"input":"2 4","output":"0 1\n0 2\n0 3\n1 2\n1 3\n2 3"},{"input":"4 4","output":"0 1 2 3"}],"match":"numbers","minTerms":null,"tags":["combinatorics","number","rosetta"]} {"id":"rosetta/comma-quibbling","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Comma_quibbling","title":"Comma quibbling: words separated by spaces","kind":"io","tests":[{"input":"","output":"{}"},{"input":"ABC","output":"{ABC}"},{"input":"ABC DEF","output":"{ABC and DEF}"},{"input":"ABC DEF G H","output":"{ABC, DEF, G and H}"}],"match":"exact","minTerms":null,"tags":["rosetta","string"]} {"id":"rosetta/convert-seconds-to-compound-duration","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Convert_seconds_to_compound_duration","title":"Convert seconds to compound duration","kind":"io","tests":[{"input":"7259","output":"2 hr, 59 sec"},{"input":"86400","output":"1 d"},{"input":"6000000","output":"9 wk, 6 d, 10 hr, 40 min"},{"input":"1","output":"1 sec"},{"input":"60","output":"1 min"},{"input":"3661","output":"1 hr, 1 min, 1 sec"},{"input":"604800","output":"1 wk"},{"input":"694861","output":"1 wk, 1 d, 1 hr, 1 min, 1 sec"}],"match":"exact","minTerms":null,"tags":["number","rosetta","string"]} {"id":"rosetta/count-in-octal","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Count_in_octal","title":"Count in octal","kind":"fixed","tests":[{"input":"","output":"0\n1\n2\n3\n4\n5\n6\n7\n10\n11\n12\n13\n14\n15\n16\n17\n20\n21\n22\n23\n24\n25\n26\n27\n30\n31\n32\n33\n34\n35\n36\n37\n40\n41\n42\n43\n44\n45\n46\n47\n50\n51\n52\n53\n54\n55\n56\n57\n60\n61\n62\n63\n64\n65\n66\n67\n70\n71\n72\n73\n74\n75\n76\n77\n100\n101\n102\n103\n104\n105\n106\n107\n110\n111\n112\n113\n114\n115\n116\n117\n120\n121\n122\n123\n124\n125\n126\n127\n130\n131\n132\n133\n134\n135\n136\n137\n140\n141\n142\n143\n144\n145\n146\n147\n150\n151\n152\n153\n154\n155\n156\n157\n160\n161\n162\n163\n164\n165\n166\n167\n170\n171\n172\n173\n174\n175\n176\n177\n200\n201\n202\n203\n204\n205\n206\n207\n210\n211\n212\n213\n214\n215\n216\n217\n220\n221\n222\n223\n224\n225\n226\n227\n230\n231\n232\n233\n234\n235\n236\n237\n240\n241\n242\n243\n244\n245\n246\n247\n250\n251\n252\n253\n254\n255\n256\n257\n260\n261\n262\n263\n264\n265\n266\n267\n270\n271\n272\n273\n274\n275\n276\n277\n300\n301\n302\n303\n304\n305\n306\n307"}],"match":"prefix-numbers","minTerms":64,"tags":["infinite","number","rosetta","sequence"]} {"id":"rosetta/count-occurrences-of-a-substring","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Count_occurrences_of_a_substring","title":"Count occurrences of a substring (non-overlapping): text, then the substring","kind":"io","tests":[{"input":"the three truths\nth","output":"3"},{"input":"ababababab\nabab","output":"2"},{"input":"aaaa\naa","output":"2"},{"input":"abc\nd","output":"0"}],"match":"numbers","minTerms":null,"tags":["number","rosetta","string"]} {"id":"rosetta/count-the-coins","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Count_the_coins","title":"Count the coins","kind":"fixed","tests":[{"input":"","output":"242"}],"match":"numbers","minTerms":null,"tags":["number","rosetta"]} {"id":"rosetta/day-of-the-week","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Day_of_the_week","title":"Day of the week","kind":"fixed","tests":[{"input":"","output":"2011 2016 2022 2033 2039 2044 2050 2061 2067 2072 2078 2089 2095 2101 2107 2112 2118"}],"match":"numbers","minTerms":null,"tags":["date","number","rosetta"]} {"id":"rosetta/digital-root","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Digital_root","title":"Digital root: additive persistence, then the root","kind":"io","tests":[{"input":"627615","output":"2 9"},{"input":"39390","output":"2 6"},{"input":"588225","output":"2 3"},{"input":"393900588225","output":"2 9"},{"input":"0","output":"0 0"},{"input":"5","output":"0 5"},{"input":"10","output":"1 1"},{"input":"99","output":"2 9"}],"match":"numbers","minTerms":null,"tags":["number","rosetta"]} {"id":"rosetta/disarium-numbers","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Disarium_numbers","title":"Disarium numbers","kind":"fixed","tests":[{"input":"","output":"0 1 2 3 4 5 6 7 8 9 89 135 175 518 598 1306 1676 2427"}],"match":"numbers","minTerms":null,"tags":["number","rosetta","sequence"]} {"id":"rosetta/dot-product","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Dot_product","title":"Dot product of two vectors, one per line","kind":"io","tests":[{"input":"1 3 -5\n4 -2 -1","output":"3"},{"input":"1 2\n3 4","output":"11"},{"input":"0\n0","output":"0"},{"input":"2 2 2\n-1 -1 -1","output":"-6"}],"match":"numbers","minTerms":null,"tags":["list","number","rosetta"]} {"id":"rosetta/emirp-primes","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Emirp_primes","title":"Emirp primes","kind":"fixed","tests":[{"input":"","output":"13 17 31 37 71 73 79 97 107 113 149 157 167 179 199 311 337 347 359 389\n7717 7757 7817 7841 7867 7879 7901 7927 7949 7951 7963\n948349"}],"match":"numbers","minTerms":null,"tags":["number","prime","rosetta"]} {"id":"rosetta/ethiopian-multiplication","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Ethiopian_multiplication","title":"Ethiopian multiplication","kind":"io","tests":[{"input":"17 34","output":"578"},{"input":"0 5","output":"0"},{"input":"5 0","output":"0"},{"input":"1 1","output":"1"},{"input":"12 12","output":"144"},{"input":"255 255","output":"65025"},{"input":"99 101","output":"9999"}],"match":"numbers","minTerms":null,"tags":["number","rosetta"]} {"id":"rosetta/eulers-sum-of-powers-conjecture","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Euler%27s_sum_of_powers_conjecture","title":"Euler's sum of powers conjecture","kind":"fixed","tests":[{"input":"","output":"27 84 110 133 144"}],"match":"numbers","minTerms":null,"tags":["number","rosetta"]} {"id":"rosetta/evaluate-binomial-coefficients","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Evaluate_binomial_coefficients","title":"Evaluate binomial coefficients: n choose k","kind":"io","tests":[{"input":"5 3","output":"10"},{"input":"10 0","output":"1"},{"input":"10 10","output":"1"},{"input":"20 10","output":"184756"},{"input":"30 15","output":"155117520"},{"input":"6 2","output":"15"}],"match":"numbers","minTerms":null,"tags":["number","rosetta"]} {"id":"rosetta/factorial","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Factorial","title":"Factorial","kind":"io","tests":[{"input":"0","output":"1"},{"input":"1","output":"1"},{"input":"2","output":"2"},{"input":"3","output":"6"},{"input":"5","output":"120"},{"input":"10","output":"3628800"},{"input":"12","output":"479001600"},{"input":"13","output":"6227020800"},{"input":"18","output":"6402373705728000"}],"match":"numbers","minTerms":null,"tags":["classic","number","rosetta"]} {"id":"rosetta/factors-of-an-integer","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Factors_of_an_integer","title":"Factors of an integer","kind":"io","tests":[{"input":"1","output":"1"},{"input":"12","output":"1 2 3 4 6 12"},{"input":"45","output":"1 3 5 9 15 45"},{"input":"53","output":"1 53"},{"input":"64","output":"1 2 4 8 16 32 64"},{"input":"100","output":"1 2 4 5 10 20 25 50 100"}],"match":"numbers","minTerms":null,"tags":["number","rosetta"]} {"id":"rosetta/fibonacci-n-step-number-sequences","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Fibonacci_n-step_number_sequences","title":"Fibonacci n-step number sequences","kind":"fixed","tests":[{"input":"","output":"1 1 2 3 5 8 13 21 34 55\n1 1 2 4 7 13 24 44 81 149\n1 1 2 4 8 15 29 56 108 208\n2 1 3 4 7 11 18 29 47 76"}],"match":"numbers","minTerms":null,"tags":["number","rosetta","sequence"]} {"id":"rosetta/fibonacci-sequence","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Fibonacci_sequence","title":"Fibonacci sequence","kind":"io","tests":[{"input":"0","output":"0"},{"input":"1","output":"1"},{"input":"2","output":"1"},{"input":"3","output":"2"},{"input":"10","output":"55"},{"input":"20","output":"6765"},{"input":"30","output":"832040"},{"input":"40","output":"102334155"},{"input":"46","output":"1836311903"}],"match":"numbers","minTerms":null,"tags":["classic","number","rosetta","sequence"]} {"id":"rosetta/fizzbuzz","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/FizzBuzz","title":"FizzBuzz","kind":"fixed","tests":[{"input":"","output":"1\n2\nFizz\n4\nBuzz\nFizz\n7\n8\nFizz\nBuzz\n11\nFizz\n13\n14\nFizzBuzz\n16\n17\nFizz\n19\nBuzz\nFizz\n22\n23\nFizz\nBuzz\n26\nFizz\n28\n29\nFizzBuzz\n31\n32\nFizz\n34\nBuzz\nFizz\n37\n38\nFizz\nBuzz\n41\nFizz\n43\n44\nFizzBuzz\n46\n47\nFizz\n49\nBuzz\nFizz\n52\n53\nFizz\nBuzz\n56\nFizz\n58\n59\nFizzBuzz\n61\n62\nFizz\n64\nBuzz\nFizz\n67\n68\nFizz\nBuzz\n71\nFizz\n73\n74\nFizzBuzz\n76\n77\nFizz\n79\nBuzz\nFizz\n82\n83\nFizz\nBuzz\n86\nFizz\n88\n89\nFizzBuzz\n91\n92\nFizz\n94\nBuzz\nFizz\n97\n98\nFizz\nBuzz"}],"match":"exact","minTerms":null,"tags":["classic","rosetta","string","trailing-ws-ok"]} {"id":"rosetta/fusc-sequence","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Fusc_sequence","title":"Fusc sequence","kind":"fixed","tests":[{"input":"","output":"0 1 1 2 1 3 2 3 1 4 3 5 2 5 3 4 1 5 4 7 3 8 5 7 2 7 5 8 3 7 4 5 1 6 5 9 4 11 7 10 3 11 8 13 5 12 7 9 2 9 7 12 5 13 8 11 3 10 7 11 4"}],"match":"numbers","minTerms":null,"tags":["number","rosetta","sequence"]} {"id":"rosetta/general-fizzbuzz","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/General_FizzBuzz","title":"General FizzBuzz","kind":"io","tests":[{"input":"20\n3 Fizz\n5 Buzz\n7 Baxx","output":"1\n2\nFizz\n4\nBuzz\nFizz\nBaxx\n8\nFizz\nBuzz\n11\nFizz\n13\nBaxx\nFizzBuzz\n16\n17\nFizz\n19\nBuzz"},{"input":"15\n3 Fizz\n5 Buzz","output":"1\n2\nFizz\n4\nBuzz\nFizz\n7\n8\nFizz\nBuzz\n11\nFizz\n13\n14\nFizzBuzz"},{"input":"10\n2 Even","output":"1\nEven\n3\nEven\n5\nEven\n7\nEven\n9\nEven"},{"input":"12\n2 A\n3 B\n4 C","output":"1\nA\nB\nAC\n5\nAB\n7\nAC\nB\nA\n11\nABC"}],"match":"exact","minTerms":null,"tags":["classic","rosetta","string"]} {"id":"rosetta/generate-lower-case-ascii-alphabet","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Generate_lower_case_ASCII_alphabet","title":"Generate lower case ASCII alphabet","kind":"fixed","tests":[{"input":"","output":"abcdefghijklmnopqrstuvwxyz"}],"match":"exact","minTerms":null,"tags":["rosetta","string","trailing-ws-ok"]} {"id":"rosetta/gray-code","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Gray_code","title":"Gray code: the encoding of n, in decimal","kind":"io","tests":[{"input":"0","output":"0"},{"input":"1","output":"1"},{"input":"2","output":"3"},{"input":"3","output":"2"},{"input":"4","output":"6"},{"input":"7","output":"4"},{"input":"8","output":"12"},{"input":"15","output":"8"},{"input":"31","output":"16"}],"match":"numbers","minTerms":null,"tags":["binary","number","rosetta"]} {"id":"rosetta/greatest-common-divisor","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Greatest_common_divisor","title":"Greatest common divisor","kind":"io","tests":[{"input":"12 18","output":"6"},{"input":"48 180","output":"12"},{"input":"17 5","output":"1"},{"input":"0 7","output":"7"},{"input":"100 75","output":"25"},{"input":"7 7","output":"7"},{"input":"1071 462","output":"21"}],"match":"numbers","minTerms":null,"tags":["number","rosetta"]} {"id":"rosetta/hailstone-sequence","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Hailstone_sequence","title":"Hailstone sequence (Collatz) starting at n","kind":"io","tests":[{"input":"1","output":"1"},{"input":"2","output":"2 1"},{"input":"3","output":"3 10 5 16 8 4 2 1"},{"input":"7","output":"7 22 11 34 17 52 26 13 40 20 10 5 16 8 4 2 1"},{"input":"27","output":"27 82 41 124 62 31 94 47 142 71 214 107 322 161 484 242 121 364 182 91 274 137 412 206 103 310 155 466 233 700 350 175 526 263 790 395 1186 593 1780 890 445 1336 668 334 167 502 251 754 377 1132 566 283 850 425 1276 638 319 958 479 1438 719 2158 1079 3238 1619 4858 2429 7288 3644 1822 911 2734 1367 4102 2051 6154 3077 9232 4616 2308 1154 577 1732 866 433 1300 650 325 976 488 244 122 61 184 92 46 23 70 35 106 53 160 80 40 20 10 5 16 8 4 2 1"},{"input":"97","output":"97 292 146 73 220 110 55 166 83 250 125 376 188 94 47 142 71 214 107 322 161 484 242 121 364 182 91 274 137 412 206 103 310 155 466 233 700 350 175 526 263 790 395 1186 593 1780 890 445 1336 668 334 167 502 251 754 377 1132 566 283 850 425 1276 638 319 958 479 1438 719 2158 1079 3238 1619 4858 2429 7288 3644 1822 911 2734 1367 4102 2051 6154 3077 9232 4616 2308 1154 577 1732 866 433 1300 650 325 976 488 244 122 61 184 92 46 23 70 35 106 53 160 80 40 20 10 5 16 8 4 2 1"}],"match":"numbers","minTerms":null,"tags":["classic","number","rosetta","sequence"]} {"id":"rosetta/hamming-numbers","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Hamming_numbers","title":"Hamming numbers","kind":"fixed","tests":[{"input":"","output":"1 2 3 4 5 6 8 9 10 12 15 16 18 20 24 25 27 30 32 36\n2125764000"}],"match":"numbers","minTerms":null,"tags":["number","rosetta","sequence"]} {"id":"rosetta/happy-numbers","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Happy_numbers","title":"Happy numbers","kind":"fixed","tests":[{"input":"","output":"1 7 10 13 19 23 28 31"}],"match":"numbers","minTerms":null,"tags":["number","rosetta","sequence"]} {"id":"rosetta/harshad-or-niven-series","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Harshad_or_Niven_series","title":"Harshad or Niven series","kind":"fixed","tests":[{"input":"","output":"1 2 3 4 5 6 7 8 9 10 12 18 20 21 24 27 30 36 40 42\n1002"}],"match":"numbers","minTerms":null,"tags":["number","rosetta","sequence"]} {"id":"rosetta/hello-world-newline-omission","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Hello_world/Newline_omission","title":"Hello world/Newline omission","kind":"fixed","tests":[{"input":"","output":"Goodbye, World!"}],"match":"exact","minTerms":null,"tags":["classic","no-final-newline","rosetta","string"]} {"id":"rosetta/hello-world-text","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Hello_world/Text","title":"Hello world/Text","kind":"fixed","tests":[{"input":"","output":"Hello world!"}],"match":"exact","minTerms":null,"tags":["classic","rosetta","string","trailing-ws-ok"]} {"id":"rosetta/hofstadter-figure-figure-sequences","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Hofstadter_Figure-Figure_sequences","title":"Hofstadter Figure-Figure sequences","kind":"fixed","tests":[{"input":"","output":"1 3 7 12 18 26 35 45 56 69"}],"match":"numbers","minTerms":null,"tags":["number","rosetta","sequence"]} {"id":"rosetta/hofstadter-q-sequence","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Hofstadter_Q_sequence","title":"Hofstadter Q sequence","kind":"fixed","tests":[{"input":"","output":"1 1 2 3 3 4 5 5 6 6\n502"}],"match":"numbers","minTerms":null,"tags":["number","rosetta","sequence"]} {"id":"rosetta/identity-matrix","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Identity_matrix","title":"Identity matrix","kind":"io","tests":[{"input":"1","output":"1"},{"input":"2","output":"1 0\n0 1"},{"input":"3","output":"1 0 0\n0 1 0\n0 0 1"},{"input":"4","output":"1 0 0 0\n0 1 0 0\n0 0 1 0\n0 0 0 1"}],"match":"numbers","minTerms":null,"tags":["matrix","number","rosetta"]} {"id":"rosetta/increment-a-numerical-string","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Increment_a_numerical_string","title":"Increment a numerical string","kind":"io","tests":[{"input":"12345","output":"12346"},{"input":"0","output":"1"},{"input":"999","output":"1000"},{"input":"-5","output":"-4"}],"match":"numbers","minTerms":null,"tags":["number","rosetta","string"]} {"id":"rosetta/integer-sequence","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Integer_sequence","title":"Integer sequence","kind":"fixed","tests":[{"input":"","output":"1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n42\n43\n44\n45\n46\n47\n48\n49\n50\n51\n52\n53\n54\n55\n56\n57\n58\n59\n60\n61\n62\n63\n64\n65\n66\n67\n68\n69\n70\n71\n72\n73\n74\n75\n76\n77\n78\n79\n80\n81\n82\n83\n84\n85\n86\n87\n88\n89\n90\n91\n92\n93\n94\n95\n96\n97\n98\n99\n100\n101\n102\n103\n104\n105\n106\n107\n108\n109\n110\n111\n112\n113\n114\n115\n116\n117\n118\n119\n120\n121\n122\n123\n124\n125\n126\n127\n128\n129\n130\n131\n132\n133\n134\n135\n136\n137\n138\n139\n140\n141\n142\n143\n144\n145\n146\n147\n148\n149\n150\n151\n152\n153\n154\n155\n156\n157\n158\n159\n160\n161\n162\n163\n164\n165\n166\n167\n168\n169\n170\n171\n172\n173\n174\n175\n176\n177\n178\n179\n180\n181\n182\n183\n184\n185\n186\n187\n188\n189\n190\n191\n192\n193\n194\n195\n196\n197\n198\n199\n200"}],"match":"prefix-numbers","minTerms":64,"tags":["infinite","number","rosetta","sequence"]} {"id":"rosetta/isbn13-check-digit","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/ISBN13_check_digit","title":"ISBN13 check digit: 1 if valid, else 0","kind":"io","tests":[{"input":"978-0596528126","output":"1"},{"input":"978-0596528120","output":"0"},{"input":"978-1788399081","output":"1"},{"input":"978-1788399083","output":"0"}],"match":"numbers","minTerms":null,"tags":["checksum","decision","number","rosetta"]} {"id":"rosetta/isqrt-integer-square-root-of-x","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Isqrt_(integer_square_root)_of_X","title":"Isqrt: the integer square root of n","kind":"io","tests":[{"input":"0","output":"0"},{"input":"1","output":"1"},{"input":"2","output":"1"},{"input":"3","output":"1"},{"input":"4","output":"2"},{"input":"15","output":"3"},{"input":"16","output":"4"},{"input":"17","output":"4"},{"input":"65","output":"8"},{"input":"1000000","output":"1000"},{"input":"2147395600","output":"46340"},{"input":"2147483647","output":"46340"}],"match":"numbers","minTerms":null,"tags":["number","rosetta"]} {"id":"rosetta/jacobsthal-numbers","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Jacobsthal_numbers","title":"Jacobsthal numbers","kind":"fixed","tests":[{"input":"","output":"0 1 1 3 5 11 21 43 85 171 341 683 1365 2731 5461 10923 21845 43691 87381 174763 349525 699051 1398101 2796203 5592405 11184811 22369621 44739243 89478485 178956971\n2 1 5 7 17 31 65 127 257 511 1025 2047 4097 8191 16385 32767 65537 131071 262145 524287 1048577 2097151 4194305 8388607 16777217 33554431 67108865 134217727 268435457 536870911\n0 1 3 15 55 231 903 3655 14535 58311 232903 932295 3727815 14913991 59650503 238612935 954429895 3817763271 15270965703 61084037575\n3 5 11 43 683 2731 43691 174763 2796203 715827883"}],"match":"numbers","minTerms":null,"tags":["number","prime","rosetta","sequence"]} {"id":"rosetta/jewels-and-stones","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Jewels_and_stones","title":"Jewels and stones: stones on the first line, jewels on the second","kind":"io","tests":[{"input":"aAAbbbb\naA","output":"3"},{"input":"ZZ\nz","output":"0"},{"input":"Mississippi\nsp","output":"6"},{"input":"abc\nabc","output":"3"}],"match":"numbers","minTerms":null,"tags":["number","rosetta","string"]} {"id":"rosetta/josephus-problem","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Josephus_problem","title":"Josephus problem: the survivor (numbered from 0) of n prisoners, every k-th killed","kind":"io","tests":[{"input":"41 3","output":"30"},{"input":"5 2","output":"2"},{"input":"7 3","output":"3"},{"input":"1 1","output":"0"},{"input":"10 1","output":"9"}],"match":"numbers","minTerms":null,"tags":["number","rosetta"]} {"id":"rosetta/kaprekar-numbers","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Kaprekar_numbers","title":"Kaprekar numbers","kind":"fixed","tests":[{"input":"","output":"1 9 45 55 99 297 703 999 2223 2728 4879 4950 5050 5292 7272 7777 9999"}],"match":"numbers","minTerms":null,"tags":["number","rosetta","sequence"]} {"id":"rosetta/leap-year","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Leap_year","title":"Leap year: 1 if a leap year (Gregorian), else 0","kind":"io","tests":[{"input":"1900","output":"0"},{"input":"2000","output":"1"},{"input":"2004","output":"1"},{"input":"2023","output":"0"},{"input":"2100","output":"0"},{"input":"2400","output":"1"},{"input":"1996","output":"1"}],"match":"numbers","minTerms":null,"tags":["date","decision","number","rosetta"]} {"id":"rosetta/least-common-multiple","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Least_common_multiple","title":"Least common multiple","kind":"io","tests":[{"input":"12 18","output":"36"},{"input":"4 6","output":"12"},{"input":"1 1","output":"1"},{"input":"7 13","output":"91"},{"input":"21 6","output":"42"},{"input":"100 75","output":"300"}],"match":"numbers","minTerms":null,"tags":["number","rosetta"]} {"id":"rosetta/leonardo-numbers","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Leonardo_numbers","title":"Leonardo numbers","kind":"fixed","tests":[{"input":"","output":"1 1 3 5 9 15 25 41 67 109 177 287 465 753 1219 1973 3193 5167 8361 13529 21891 35421 57313 92735 150049\n0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 6765 10946 17711 28657 46368"}],"match":"numbers","minTerms":null,"tags":["number","rosetta","sequence"]} {"id":"rosetta/levenshtein-distance","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Levenshtein_distance","title":"Levenshtein distance between two lines","kind":"io","tests":[{"input":"kitten\nsitting","output":"3"},{"input":"rosettacode\nraisethysword","output":"8"},{"input":"saturday\nsunday","output":"3"},{"input":"abc\nabc","output":"0"},{"input":"\nabc","output":"3"},{"input":"a\nb","output":"1"}],"match":"numbers","minTerms":null,"tags":["number","rosetta","string"]} {"id":"rosetta/long-multiplication","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Long_multiplication","title":"Long multiplication","kind":"fixed","tests":[{"input":"","output":"340282366920938463463374607431768211456"}],"match":"exact","minTerms":null,"tags":["bignum","number","rosetta","trailing-ws-ok"]} {"id":"rosetta/longest-common-prefix","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Longest_common_prefix","title":"Longest common prefix of the input lines","kind":"io","tests":[{"input":"interspecies\ninterstellar\ninterstate","output":"inters"},{"input":"throne\nthrone","output":"throne"},{"input":"throne\ndungeon","output":""},{"input":"throne\n\nthrone","output":""},{"input":"cheese","output":"cheese"},{"input":"prefix\nsuffix","output":""},{"input":"foo\nfoobar","output":"foo"}],"match":"exact","minTerms":null,"tags":["rosetta","string"]} {"id":"rosetta/longest-common-substring","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Longest_common_substring","title":"Longest common substring of two lines","kind":"io","tests":[{"input":"thisisatest\ntesting123testing","output":"test"},{"input":"abcdef\nzcdemf","output":"cde"},{"input":"xyz\nabc","output":""},{"input":"abc\nabc","output":"abc"}],"match":"exact","minTerms":null,"tags":["rosetta","string"]} {"id":"rosetta/look-and-say-sequence","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Look-and-say_sequence","title":"Look-and-say sequence","kind":"fixed","tests":[{"input":"","output":"1\n11\n21\n1211\n111221\n312211\n13112221\n1113213211\n31131211131221\n13211311123113112211"}],"match":"exact","minTerms":null,"tags":["rosetta","sequence","string","trailing-ws-ok"]} {"id":"rosetta/look-and-say-sequence-next","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Look-and-say_sequence","title":"Look-and-say sequence: the next term of a digit string","kind":"io","tests":[{"input":"1","output":"11"},{"input":"11","output":"21"},{"input":"21","output":"1211"},{"input":"1211","output":"111221"},{"input":"111221","output":"312211"},{"input":"3","output":"13"},{"input":"2222","output":"42"},{"input":"1113","output":"3113"},{"input":"3333333333","output":"103"},{"input":"","output":""}],"match":"exact","minTerms":null,"tags":["rosetta","string"]} {"id":"rosetta/loop-over-multiple-arrays-simultaneously","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Loop_over_multiple_arrays_simultaneously","title":"Loop over multiple arrays simultaneously","kind":"fixed","tests":[{"input":"","output":"aA1\nbB2\ncC3"}],"match":"exact","minTerms":null,"tags":["loop","rosetta","string","trailing-ws-ok"]} {"id":"rosetta/loops-continue","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Loops/Continue","title":"Loops/Continue","kind":"fixed","tests":[{"input":"","output":"1, 2, 3, 4, 5\n6, 7, 8, 9, 10"}],"match":"exact","minTerms":null,"tags":["loop","rosetta","string","trailing-ws-ok"]} {"id":"rosetta/loops-do-while","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Loops/Do-while","title":"Loops/Do-while","kind":"fixed","tests":[{"input":"","output":"1\n2\n3\n4\n5\n6"}],"match":"numbers","minTerms":null,"tags":["loop","number","rosetta"]} {"id":"rosetta/loops-downward-for","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Loops/Downward_for","title":"Loops/Downward for","kind":"fixed","tests":[{"input":"","output":"10\n9\n8\n7\n6\n5\n4\n3\n2\n1\n0"}],"match":"numbers","minTerms":null,"tags":["loop","number","rosetta"]} {"id":"rosetta/loops-for","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Loops/For","title":"Loops/For","kind":"fixed","tests":[{"input":"","output":"*\n**\n***\n****\n*****"}],"match":"exact","minTerms":null,"tags":["ascii-art","loop","rosetta","trailing-ws-ok"]} {"id":"rosetta/loops-n-plus-one-half","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Loops/N_plus_one_half","title":"Loops/N plus one half","kind":"fixed","tests":[{"input":"","output":"1, 2, 3, 4, 5, 6, 7, 8, 9, 10"}],"match":"exact","minTerms":null,"tags":["loop","rosetta","string","trailing-ws-ok"]} {"id":"rosetta/loops-while","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Loops/While","title":"Loops/While","kind":"fixed","tests":[{"input":"","output":"1024\n512\n256\n128\n64\n32\n16\n8\n4\n2\n1"}],"match":"numbers","minTerms":null,"tags":["loop","number","rosetta"]} {"id":"rosetta/ludic-numbers","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Ludic_numbers","title":"Ludic numbers","kind":"fixed","tests":[{"input":"","output":"1 2 3 5 7 11 13 17 23 25 29 37 41 43 47 53 61 67 71 77 83 89 91 97 107\n142\n21475 21481 21487 21493 21503 21511\n1 3 7\n5 7 11\n11 13 17\n23 25 29\n41 43 47\n173 175 179\n221 223 227\n233 235 239"}],"match":"numbers","minTerms":null,"tags":["number","rosetta","sequence"]} {"id":"rosetta/luhn-test-of-credit-card-numbers","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Luhn_test_of_credit_card_numbers","title":"Luhn test: 1 if the digits pass, else 0","kind":"io","tests":[{"input":"49927398716","output":"1"},{"input":"49927398717","output":"0"},{"input":"1234567812345678","output":"0"},{"input":"1234567812345670","output":"1"}],"match":"numbers","minTerms":null,"tags":["checksum","decision","number","rosetta"]} {"id":"rosetta/middle-three-digits","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Middle_three_digits","title":"Middle three digits","kind":"io","tests":[{"input":"123","output":"123"},{"input":"12345","output":"234"},{"input":"1234567","output":"345"},{"input":"987654321","output":"654"},{"input":"10001","output":"000"},{"input":"-10001","output":"000"},{"input":"-123","output":"123"},{"input":"-100","output":"100"},{"input":"100","output":"100"},{"input":"-12345","output":"234"}],"match":"exact","minTerms":null,"tags":["number","rosetta","string"]} {"id":"rosetta/mobius-function","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/M%C3%B6bius_function","title":"M\u00f6bius function","kind":"fixed","tests":[{"input":"","output":"1 -1 -1 0 -1 1 -1 0 0 1 -1 0 -1 1 1 0 -1 0 -1 0 1 1 -1 0 0 1 0 0 -1 -1 -1 0 1 1 1 0 -1 1 1 0 -1 -1 -1 0 0 1 -1 0 0 0 1 0 -1 0 1 0 1 1 -1 0 -1 1 0 0 1 -1 -1 0 1 -1 -1 0 -1 1 0 0 1 -1 -1 0 0 1 -1 0 1 1 1 0 -1 0 1 0 1 1 1 0 -1 0 0 0 -1 -1 -1 0 -1 1 -1 0 -1 -1 1 0 -1 -1 1 0 0 1 1 0 0 1 1 0 0 0 -1 0 1 -1 -1 0 1 1 0 0 -1 -1 -1 0 1 1 1 0 1 1 0 0 -1 0 -1 0 0 -1 1 0 -1 1 1 0 1 0 -1 0 -1 1 -1 0 0 -1 0 0 -1 -1 0 0 1 1 -1 0 -1 -1 1 0 1 -1 1 0 0 -1 -1 0 -1 1 -1 0 -1 0 -1"}],"match":"numbers","minTerms":null,"tags":["number","rosetta","sequence"]} {"id":"rosetta/munchausen-numbers","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Munchausen_numbers","title":"Munchausen numbers","kind":"fixed","tests":[{"input":"","output":"1 3435"}],"match":"numbers","minTerms":null,"tags":["number","rosetta"]} {"id":"rosetta/mutual-recursion","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Mutual_recursion","title":"Mutual recursion","kind":"fixed","tests":[{"input":"","output":"1 1 2 2 3 3 4 5 5 6 6 7 8 8 9 9 10 11 11 12\n0 0 1 2 2 3 4 4 5 6 6 7 7 8 9 9 10 11 11 12"}],"match":"numbers","minTerms":null,"tags":["number","recursion","rosetta","sequence"]} {"id":"rosetta/n-queens-problem","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/N-queens_problem","title":"N-queens problem: the number of solutions for an n by n board","kind":"io","tests":[{"input":"1","output":"1"},{"input":"2","output":"0"},{"input":"3","output":"0"},{"input":"4","output":"2"},{"input":"5","output":"10"},{"input":"6","output":"4"},{"input":"7","output":"40"},{"input":"8","output":"92"}],"match":"numbers","minTerms":null,"tags":["number","rosetta","search"]} {"id":"rosetta/narcissistic-decimal-number","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Narcissistic_decimal_number","title":"Narcissistic decimal number","kind":"fixed","tests":[{"input":"","output":"0 1 2 3 4 5 6 7 8 9 153 370 371 407 1634 8208 9474 54748 92727 93084 548834 1741725 4210818 9800817 9926315"}],"match":"numbers","minTerms":null,"tags":["number","rosetta","sequence"]} {"id":"rosetta/palindrome-detection","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Palindrome_detection","title":"Palindrome detection (exact): 1 if a palindrome, else 0","kind":"io","tests":[{"input":"racecar","output":"1"},{"input":"a","output":"1"},{"input":"","output":"1"},{"input":"ab","output":"0"},{"input":"abba","output":"1"},{"input":"abca","output":"0"},{"input":"In girum imus nocte et consumimur igni","output":"0"}],"match":"numbers","minTerms":null,"tags":["decision","rosetta","string"]} {"id":"rosetta/pangram-checker","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Pangram_checker","title":"Pangram checker: 1 if every letter a-z occurs, else 0","kind":"io","tests":[{"input":"The quick brown fox jumps over the lazy dog","output":"1"},{"input":"abc","output":"0"},{"input":"Pack my box with five dozen liquor jugs","output":"1"},{"input":"","output":"0"},{"input":"The quick brown fox jumped over the lazy dog","output":"0"}],"match":"numbers","minTerms":null,"tags":["decision","rosetta","string"]} {"id":"rosetta/pascals-triangle","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Pascal%27s_triangle","title":"Pascal's triangle: the first n rows","kind":"io","tests":[{"input":"1","output":"1"},{"input":"2","output":"1\n1 1"},{"input":"5","output":"1\n1 1\n1 2 1\n1 3 3 1\n1 4 6 4 1"},{"input":"10","output":"1\n1 1\n1 2 1\n1 3 3 1\n1 4 6 4 1\n1 5 10 10 5 1\n1 6 15 20 15 6 1\n1 7 21 35 35 21 7 1\n1 8 28 56 70 56 28 8 1\n1 9 36 84 126 126 84 36 9 1"}],"match":"numbers","minTerms":null,"tags":["classic","number","rosetta"]} {"id":"rosetta/perfect-numbers","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Perfect_numbers","title":"Perfect numbers: 1 if n is perfect, else 0","kind":"io","tests":[{"input":"6","output":"1"},{"input":"28","output":"1"},{"input":"496","output":"1"},{"input":"8128","output":"1"},{"input":"1","output":"0"},{"input":"12","output":"0"},{"input":"27","output":"0"},{"input":"100","output":"0"},{"input":"33550336","output":"1"}],"match":"numbers","minTerms":null,"tags":["decision","number","rosetta"]} {"id":"rosetta/perfect-shuffle","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Perfect_shuffle","title":"Perfect shuffle: how many shuffles restore a deck of n cards","kind":"io","tests":[{"input":"2","output":"1"},{"input":"8","output":"3"},{"input":"24","output":"11"},{"input":"52","output":"8"},{"input":"100","output":"30"},{"input":"1020","output":"1018"},{"input":"1024","output":"10"},{"input":"10000","output":"300"}],"match":"numbers","minTerms":null,"tags":["number","rosetta"]} {"id":"rosetta/pernicious-numbers","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Pernicious_numbers","title":"Pernicious numbers","kind":"fixed","tests":[{"input":"","output":"3 5 6 7 9 10 11 12 13 14 17 18 19 20 21 22 24 25 26 28 31 33 34 35 36\n888888877 888888878 888888880 888888883 888888885 888888886"}],"match":"numbers","minTerms":null,"tags":["binary","number","prime","rosetta"]} {"id":"rosetta/population-count","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Population_count","title":"Population count","kind":"fixed","tests":[{"input":"","output":"1 2 2 4 3 6 6 5 6 8 9 13 10 11 14 15 11 14 14 17 17 20 19 22 16 18 24 30 25 25\n0 3 5 6 9 10 12 15 17 18 20 23 24 27 29 30 33 34 36 39 40 43 45 46 48 51 53 54 57 58\n1 2 4 7 8 11 13 14 16 19 21 22 25 26 28 31 32 35 37 38 41 42 44 47 49 50 52 55 56 59"}],"match":"numbers","minTerms":null,"tags":["binary","number","rosetta","sequence"]} {"id":"rosetta/primality-by-trial-division","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Primality_by_trial_division","title":"Primality by trial division: 1 if n is prime, else 0","kind":"io","tests":[{"input":"1","output":"0"},{"input":"2","output":"1"},{"input":"9","output":"0"},{"input":"97","output":"1"},{"input":"7919","output":"1"},{"input":"1000000","output":"0"},{"input":"2147483647","output":"1"}],"match":"numbers","minTerms":null,"tags":["decision","number","prime","rosetta"]} {"id":"rosetta/prime-decomposition","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Prime_decomposition","title":"Prime decomposition","kind":"io","tests":[{"input":"2","output":"2"},{"input":"12","output":"2 2 3"},{"input":"97","output":"97"},{"input":"1001","output":"7 11 13"},{"input":"1024","output":"2 2 2 2 2 2 2 2 2 2"},{"input":"2147483647","output":"2147483647"},{"input":"600851475143","output":"71 839 1471 6857"}],"match":"numbers","minTerms":null,"tags":["number","prime","rosetta"]} {"id":"rosetta/primorial-numbers","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Primorial_numbers","title":"Primorial numbers","kind":"fixed","tests":[{"input":"","output":"1 2 6 30 210 2310 30030 510510 9699690 223092870"}],"match":"numbers","minTerms":null,"tags":["number","prime","rosetta","sequence"]} {"id":"rosetta/product-of-divisors","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Product_of_divisors","title":"Product of divisors","kind":"fixed","tests":[{"input":"","output":"1 2 3 8 5 36 7 64 27 100 11 1728 13 196 225 1024 17 5832 19 8000 441 484 23 331776 125 676 729 21952 29 810000 31 32768 1089 1156 1225 10077696 37 1444 1521 2560000 41 3111696 43 85184 91125 2116 47 254803968 343 125000"}],"match":"numbers","minTerms":null,"tags":["number","rosetta","sequence"]} {"id":"rosetta/proper-divisors","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Proper_divisors","title":"Proper divisors of n","kind":"io","tests":[{"input":"2","output":"1"},{"input":"6","output":"1 2 3"},{"input":"10","output":"1 2 5"},{"input":"12","output":"1 2 3 4 6"},{"input":"28","output":"1 2 4 7 14"},{"input":"97","output":"1"}],"match":"numbers","minTerms":null,"tags":["number","rosetta"]} {"id":"rosetta/pythagorean-triples","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Pythagorean_triples","title":"Pythagorean triples","kind":"fixed","tests":[{"input":"","output":"17\n7"}],"match":"numbers","minTerms":null,"tags":["number","rosetta"]} {"id":"rosetta/recamans-sequence","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Recaman%27s_sequence","title":"Recaman's sequence","kind":"fixed","tests":[{"input":"","output":"0 1 3 6 2 7 13 20 12 21 11 22 10 23 9\n42"}],"match":"numbers","minTerms":null,"tags":["number","rosetta","sequence"]} {"id":"rosetta/remove-vowels-from-a-string","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Remove_vowels_from_a_string","title":"Remove vowels from a string","kind":"io","tests":[{"input":"Rosetta Code","output":"Rstt Cd"},{"input":"AEIOUaeiou","output":""},{"input":"rhythm","output":"rhythm"},{"input":"Programming is fun!","output":"Prgrmmng s fn!"}],"match":"exact","minTerms":null,"tags":["rosetta","string"]} {"id":"rosetta/repeat-a-string","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Repeat_a_string","title":"Repeat a string","kind":"fixed","tests":[{"input":"","output":"hahahahaha"}],"match":"exact","minTerms":null,"tags":["rosetta","string","trailing-ws-ok"]} {"id":"rosetta/reverse-a-string","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Reverse_a_string","title":"Reverse a string","kind":"io","tests":[{"input":"asdf","output":"fdsa"},{"input":"a","output":"a"},{"input":"","output":""},{"input":"ab","output":"ba"},{"input":"Hello, World!","output":"!dlroW ,olleH"},{"input":"racecar","output":"racecar"},{"input":"12345 6789","output":"9876 54321"}],"match":"exact","minTerms":null,"tags":["classic","rosetta","string","trivial:reverse"]} {"id":"rosetta/roman-numerals-decode","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Roman_numerals/Decode","title":"Roman numerals/Decode","kind":"io","tests":[{"input":"I","output":"1"},{"input":"IV","output":"4"},{"input":"IX","output":"9"},{"input":"XIV","output":"14"},{"input":"XL","output":"40"},{"input":"XC","output":"90"},{"input":"CD","output":"400"},{"input":"MCMXC","output":"1990"},{"input":"MMVIII","output":"2008"},{"input":"MDCLXVI","output":"1666"},{"input":"MMMCMXCIX","output":"3999"}],"match":"numbers","minTerms":null,"tags":["number","rosetta","string"]} {"id":"rosetta/roman-numerals-encode","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Roman_numerals/Encode","title":"Roman numerals/Encode","kind":"io","tests":[{"input":"1","output":"I"},{"input":"3","output":"III"},{"input":"4","output":"IV"},{"input":"9","output":"IX"},{"input":"14","output":"XIV"},{"input":"40","output":"XL"},{"input":"90","output":"XC"},{"input":"400","output":"CD"},{"input":"1666","output":"MDCLXVI"},{"input":"1990","output":"MCMXC"},{"input":"2008","output":"MMVIII"},{"input":"2024","output":"MMXXIV"},{"input":"3999","output":"MMMCMXCIX"}],"match":"exact","minTerms":null,"tags":["number","rosetta","string"]} {"id":"rosetta/rot-13","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Rot-13","title":"Rot-13","kind":"io","tests":[{"input":"Hello, World!","output":"Uryyb, Jbeyq!"},{"input":"abcdefghijklmnopqrstuvwxyz","output":"nopqrstuvwxyzabcdefghijklm"},{"input":"ABCDEFGHIJKLMNOPQRSTUVWXYZ","output":"NOPQRSTUVWXYZABCDEFGHIJKLM"},{"input":"Why did the chicken cross the road?","output":"Jul qvq gur puvpxra pebff gur ebnq?"},{"input":"","output":""},{"input":"12345","output":"12345"}],"match":"exact","minTerms":null,"tags":["cipher","classic","rosetta","string"]} {"id":"rosetta/run-length-encoding","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Run-length_encoding","title":"Run-length encoding: encode","kind":"io","tests":[{"input":"WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWBWWWWWWWWWWWWWW","output":"12W1B12W3B24W1B14W"},{"input":"A","output":"1A"},{"input":"AAAB","output":"3A1B"},{"input":"ABCD","output":"1A1B1C1D"},{"input":"","output":""}],"match":"exact","minTerms":null,"tags":["compression","rosetta","string"]} {"id":"rosetta/run-length-encoding-decode","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Run-length_encoding","title":"Run-length encoding: decode","kind":"io","tests":[{"input":"12W1B12W3B24W1B14W","output":"WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWBWWWWWWWWWWWWWW"},{"input":"1A","output":"A"},{"input":"3A1B","output":"AAAB"},{"input":"1A1B1C1D","output":"ABCD"},{"input":"10Z","output":"ZZZZZZZZZZ"}],"match":"exact","minTerms":null,"tags":["compression","rosetta","string"]} {"id":"rosetta/self-numbers","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Self_numbers","title":"Self numbers","kind":"fixed","tests":[{"input":"","output":"1 3 5 7 9 20 31 42 53 64 75 86 97 108 110 121 132 143 154 165 176 187 198 209 211 222 233 244 255 266 277 288 299 310 312 323 334 345 356 367 378 389 400 411 413 424 435 446 457 468"}],"match":"numbers","minTerms":null,"tags":["number","rosetta","sequence"]} {"id":"rosetta/sequence-of-non-squares","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Sequence_of_non-squares","title":"Sequence of non-squares","kind":"fixed","tests":[{"input":"","output":"2 3 5 6 7 8 10 11 12 13 14 15 17 18 19 20 21 22 23 24 26 27"}],"match":"numbers","minTerms":null,"tags":["number","rosetta","sequence"]} {"id":"rosetta/sierpinski-triangle","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Sierpinski_triangle","title":"Sierpinski triangle","kind":"fixed","tests":[{"input":"","output":" *\n * *\n * *\n * * * *\n * *\n * * * *\n * * * *\n * * * * * * * *\n * *\n * * * *\n * * * *\n * * * * * * * *\n * * * *\n * * * * * * * *\n * * * * * * * *\n* * * * * * * * * * * * * * * *"}],"match":"exact","minTerms":null,"tags":["ascii-art","rosetta","trailing-ws-ok"]} {"id":"rosetta/sieve-of-eratosthenes","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Sieve_of_Eratosthenes","title":"Sieve of Eratosthenes","kind":"io","tests":[{"input":"2","output":"2"},{"input":"3","output":"2 3"},{"input":"10","output":"2 3 5 7"},{"input":"30","output":"2 3 5 7 11 13 17 19 23 29"},{"input":"100","output":"2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97"},{"input":"250","output":"2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 241"}],"match":"numbers","minTerms":null,"tags":["number","prime","rosetta"]} {"id":"rosetta/smith-numbers","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Smith_numbers","title":"Smith numbers","kind":"fixed","tests":[{"input":"","output":"4 22 27 58 85 94 121 166 202 265 274 319 346 355 378 382 391 438 454 483 517 526 535 562 576 588 627 634 636 645 648 654 663 666 690 706 728 729 762 778 825 852 861 895 913 915 922 958 985 1086 1111 1165 1219 1255 1282 1284 1376 1449 1507 1581 1626 1633 1642 1678 1736 1755 1776 1795 1822 1842 1858 1872 1881 1894 1903 1908 1921 1935 1952 1962 1966 2038 2067 2079 2155 2173 2182 2218 2227 2265 2286 2326 2362 2366 2373 2409 2434 2461 2475 2484 2515 2556 2576 2578 2583 2605 2614 2679 2688 2722 2745 2751 2785 2839 2888 2902 2911 2934 2944 2958 2964 2965 2970 2974 3046 3091 3138 3168 3174 3226 3246 3258 3294 3345 3366 3390 3442 3505 3564 3595 3615 3622 3649 3663 3690 3694 3802 3852 3864 3865 3930 3946 3973 4054 4126 4162 4173 4185 4189 4191 4198 4209 4279 4306 4369 4414 4428 4464 4472 4557 4592 4594 4702 4743 4765 4788 4794 4832 4855 4880 4918 4954 4959 4960 4974 4981 5062 5071 5088 5098 5172 5242 5248 5253 5269 5298 5305 5386 5388 5397 5422 5458 5485 5526 5539 5602 5638 5642 5674 5772 5818 5854 5874 5915 5926 5935 5936 5946 5998 6036 6054 6084 6096 6115 6171 6178 6187 6188 6252 6259 6295 6315 6344 6385 6439 6457 6502 6531 6567 6583 6585 6603 6684 6693 6702 6718 6760 6816 6835 6855 6880 6934 6981 7026 7051 7062 7068 7078 7089 7119 7136 7186 7195 7227 7249 7287 7339 7402 7438 7447 7465 7503 7627 7674 7683 7695 7712 7726 7762 7764 7782 7784 7809 7824 7834 7915 7952 7978 8005 8014 8023 8073 8077 8095 8149 8154 8158 8185 8196 8253 8257 8277 8307 8347 8372 8412 8421 8466 8518 8545 8568 8628 8653 8680 8736 8754 8766 8790 8792 8851 8864 8874 8883 8901 8914 9015 9031 9036 9094 9166 9184 9193 9229 9274 9276 9285 9294 9296 9301 9330 9346 9355 9382 9386 9387 9396 9414 9427 9483 9522 9535 9571 9598 9633 9634 9639 9648 9657 9684 9708 9717 9735 9742 9760 9778 9840 9843 9849 9861 9880 9895 9924 9942 9968 9975 9985"}],"match":"numbers","minTerms":null,"tags":["number","prime","rosetta"]} {"id":"rosetta/sort-an-integer-array","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Sort_an_integer_array","title":"Sort an integer array","kind":"io","tests":[{"input":"3 1 2","output":"1 2 3"},{"input":"5 -2 9 0 -2","output":"-2 -2 0 5 9"},{"input":"1","output":"1"},{"input":"10 9 8 7 6 5 4 3 2 1","output":"1 2 3 4 5 6 7 8 9 10"}],"match":"numbers","minTerms":null,"tags":["list","number","rosetta","sorting"]} {"id":"rosetta/spiral-matrix","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Spiral_matrix","title":"Spiral matrix","kind":"io","tests":[{"input":"1","output":"0"},{"input":"2","output":"0 1\n3 2"},{"input":"3","output":"0 1 2\n7 8 3\n6 5 4"},{"input":"5","output":"0 1 2 3 4\n15 16 17 18 5\n14 23 24 19 6\n13 22 21 20 7\n12 11 10 9 8"}],"match":"numbers","minTerms":null,"tags":["matrix","number","rosetta"]} {"id":"rosetta/split-a-character-string-based-on-change-of-character","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Split_a_character_string_based_on_change_of_character","title":"Split a character string based on change of character","kind":"io","tests":[{"input":"gHHH5YY++///\\","output":"g, HHH, 5, YY, ++, ///, \\"},{"input":"a","output":"a"},{"input":"aab","output":"aa, b"},{"input":"abc","output":"a, b, c"},{"input":"aaa","output":"aaa"}],"match":"exact","minTerms":null,"tags":["rosetta","string"]} {"id":"rosetta/stern-brocot-sequence","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Stern-Brocot_sequence","title":"Stern-Brocot sequence","kind":"fixed","tests":[{"input":"","output":"1 1 2 1 3 2 3 1 4 3 5 2 5 3 4\n1 3 5 9 11 33 19 21 35 39\n1179"}],"match":"numbers","minTerms":null,"tags":["number","rosetta","sequence"]} {"id":"rosetta/string-case-lower","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/String_case","title":"String case: lower case","kind":"io","tests":[{"input":"alphaBETA","output":"alphabeta"},{"input":"ABC","output":"abc"},{"input":"Hello, World!","output":"hello, world!"},{"input":"","output":""}],"match":"exact","minTerms":null,"tags":["rosetta","string"]} {"id":"rosetta/string-case-upper","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/String_case","title":"String case: upper case","kind":"io","tests":[{"input":"alphaBETA","output":"ALPHABETA"},{"input":"abc","output":"ABC"},{"input":"Hello, World!","output":"HELLO, WORLD!"},{"input":"","output":""}],"match":"exact","minTerms":null,"tags":["rosetta","string","trivial:upper"]} {"id":"rosetta/string-length","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/String_length","title":"String length in UTF-8 bytes","kind":"io","tests":[{"input":"m\u00c3\u00b8\u00c3\u00b8se","output":"7"},{"input":"abc","output":"3"},{"input":"","output":"0"},{"input":"\u00f0\u009d\u0094\u0098\u00f0\u009d\u0094\u00ab\u00f0\u009d\u0094\u00a6\u00f0\u009d\u0094\u00a0\u00f0\u009d\u0094\u00ac\u00f0\u009d\u0094\u00a1\u00f0\u009d\u0094\u00a2","output":"28"}],"match":"numbers","minTerms":null,"tags":["number","rosetta","string","unicode"]} {"id":"rosetta/strip-a-set-of-characters-from-a-string","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Strip_a_set_of_characters_from_a_string","title":"Strip a set of characters: text on the first line, characters on the second","kind":"io","tests":[{"input":"She was a soul stripper. She took my heart!\naei","output":"Sh ws soul strppr. Sh took my hrt!"},{"input":"hello world\nlo","output":"he wrd"},{"input":"abc\nxyz","output":"abc"}],"match":"exact","minTerms":null,"tags":["rosetta","string"]} {"id":"rosetta/strip-comments-from-a-string","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Strip_comments_from_a_string","title":"Strip comments from a string","kind":"io","tests":[{"input":"apples, pears # and bananas","output":"apples, pears"},{"input":"apples, pears ; and bananas","output":"apples, pears"},{"input":"no comment here","output":"no comment here"},{"input":" # only comment","output":""},{"input":" padded ","output":"padded"}],"match":"exact","minTerms":null,"tags":["rosetta","string"]} {"id":"rosetta/sum-and-product-of-an-array","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Sum_and_product_of_an_array","title":"Sum and product of an array","kind":"io","tests":[{"input":"1 2 3 4 5","output":"15 120"},{"input":"7","output":"7 7"},{"input":"2 -3","output":"-1 -6"},{"input":"1 2 3 4 5 6 7 8 9 10","output":"55 3628800"}],"match":"numbers","minTerms":null,"tags":["list","number","rosetta"]} {"id":"rosetta/sum-digits-of-an-integer","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Sum_digits_of_an_integer","title":"Sum digits of an integer (base 10)","kind":"io","tests":[{"input":"1","output":"1"},{"input":"1234","output":"10"},{"input":"0","output":"0"},{"input":"99999","output":"45"},{"input":"1000000","output":"1"},{"input":"987654321","output":"45"}],"match":"numbers","minTerms":null,"tags":["number","rosetta"]} {"id":"rosetta/sum-multiples-of-3-and-5","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Sum_multiples_of_3_and_5","title":"Sum multiples of 3 and 5 below n","kind":"io","tests":[{"input":"1","output":"0"},{"input":"10","output":"23"},{"input":"16","output":"60"},{"input":"100","output":"2318"},{"input":"1000","output":"233168"}],"match":"numbers","minTerms":null,"tags":["number","rosetta"]} {"id":"rosetta/sum-of-divisors","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Sum_of_divisors","title":"Sum of divisors","kind":"fixed","tests":[{"input":"","output":"1 3 4 7 6 12 8 15 13 18 12 28 14 24 24 31 18 39 20 42 32 36 24 60 31 42 40 56 30 72 32 63 48 54 48 91 38 60 56 90 42 96 44 84 78 72 48 124 57 93 72 98 54 120 72 120 80 90 60 168 62 96 104 127 84 144 68 126 96 144 72 195 74 114 124 140 96 168 80 186 121 126 84 224 108 132 120 180 90 234 112 168 128 144 120 252 98 171 156 217"}],"match":"numbers","minTerms":null,"tags":["number","rosetta","sequence"]} {"id":"rosetta/sum-of-first-n-cubes","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Sum_of_first_n_cubes","title":"Sum of first n cubes","kind":"fixed","tests":[{"input":"","output":"0 1 9 36 100 225 441 784 1296 2025 3025 4356 6084 8281 11025 14400 18496 23409 29241 36100 44100 53361 64009 76176 90000 105625 123201 142884 164836 189225 216225 246016 278784 314721 354025 396900 443556 494209 549081 608400 672400 741321 815409 894916 980100 1071225 1168561 1272384 1382976 1500625"}],"match":"numbers","minTerms":null,"tags":["number","rosetta","sequence"]} {"id":"rosetta/sum-of-squares","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Sum_of_squares","title":"Sum of squares","kind":"io","tests":[{"input":"1 2 3","output":"14"},{"input":"","output":"0"},{"input":"3 1 4 1 5 9","output":"133"},{"input":"-2 2","output":"8"}],"match":"numbers","minTerms":null,"tags":["list","number","rosetta"]} {"id":"rosetta/tau-function","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Tau_function","title":"Tau function","kind":"fixed","tests":[{"input":"","output":"1 2 2 3 2 4 2 4 3 4 2 6 2 4 4 5 2 6 2 6 4 4 2 8 3 4 4 6 2 8 2 6 4 4 4 9 2 4 4 8 2 8 2 6 6 4 2 10 3 6 4 6 2 8 4 8 4 4 2 12 2 4 6 7 4 8 2 6 4 8 2 12 2 4 6 6 4 8 2 10 5 4 2 12 4 4 4 8 2 12 4 6 4 4 4 12 2 6 6 9"}],"match":"numbers","minTerms":null,"tags":["number","rosetta","sequence"]} {"id":"rosetta/thue-morse","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Thue-Morse","title":"Thue-Morse: the first n terms as a digit string","kind":"io","tests":[{"input":"1","output":"0"},{"input":"2","output":"01"},{"input":"4","output":"0110"},{"input":"8","output":"01101001"},{"input":"16","output":"0110100110010110"},{"input":"32","output":"01101001100101101001011001101001"},{"input":"64","output":"0110100110010110100101100110100110010110011010010110100110010110"}],"match":"exact","minTerms":null,"tags":["binary","rosetta","sequence","string"]} {"id":"rosetta/tokenize-a-string","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Tokenize_a_string","title":"Tokenize a string: split on commas, join with periods","kind":"io","tests":[{"input":"Hello,How,Are,You,Today","output":"Hello.How.Are.You.Today"},{"input":"a,b","output":"a.b"},{"input":"single","output":"single"}],"match":"exact","minTerms":null,"tags":["rosetta","string"]} {"id":"rosetta/topswops","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Topswops","title":"Topswops","kind":"fixed","tests":[{"input":"","output":"1 0\n2 1\n3 2\n4 4\n5 7\n6 10\n7 16\n8 22\n9 30\n10 38"}],"match":"numbers","minTerms":null,"tags":["number","rosetta"]} {"id":"rosetta/towers-of-hanoi","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Towers_of_Hanoi","title":"Towers of Hanoi: the moves for n disks from peg 1 to peg 3, one \"from to\" pair per line","kind":"io","tests":[{"input":"1","output":"1 3"},{"input":"2","output":"1 2\n1 3\n2 3"},{"input":"3","output":"1 3\n1 2\n3 2\n1 3\n2 1\n2 3\n1 3"},{"input":"4","output":"1 2\n1 3\n2 3\n1 2\n3 1\n3 2\n1 2\n1 3\n2 3\n2 1\n3 1\n2 3\n1 2\n1 3\n2 3"},{"input":"5","output":"1 3\n1 2\n3 2\n1 3\n2 1\n2 3\n1 3\n1 2\n3 2\n3 1\n2 1\n3 2\n1 3\n1 2\n3 2\n1 3\n2 1\n2 3\n1 3\n2 1\n3 2\n3 1\n2 1\n2 3\n1 3\n1 2\n3 2\n1 3\n2 1\n2 3\n1 3"}],"match":"numbers","minTerms":null,"tags":["number","recursion","rosetta"]} {"id":"rosetta/truncatable-primes","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Truncatable_primes","title":"Truncatable primes","kind":"fixed","tests":[{"input":"","output":"998443\n739399"}],"match":"numbers","minTerms":null,"tags":["number","prime","rosetta"]} {"id":"rosetta/van-eck-sequence","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Van_Eck_sequence","title":"Van Eck sequence","kind":"fixed","tests":[{"input":"","output":"0 0 1 0 2 0 2 2 1 6\n4 7 30 25 67 225 488 0 10 136"}],"match":"numbers","minTerms":null,"tags":["number","rosetta","sequence"]} {"id":"rosetta/vigenere-cipher","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Vigen%C3%A8re_cipher","title":"Vigen\u00e8re cipher: key on the first line, text on the second; letters only, upper case","kind":"io","tests":[{"input":"VIGENERECIPHER\nBeware the Jabberwock, my son! The jaws that bite, the claws that catch!","output":"WMCEEIKLGRPIFVMEUGXQPWQVIOIAVEYXUEKFKBTALVXTGAFXYEVKPAGY"},{"input":"LEMON\nATTACK AT DAWN","output":"LXFOPVEFRNHR"},{"input":"A\nhello","output":"HELLO"},{"input":"B\nxyz","output":"YZA"}],"match":"exact","minTerms":null,"tags":["cipher","rosetta","string"]} {"id":"rosetta/zig-zag-matrix","source":"rosetta","license":"GFDL-1.3","url":"https://rosettacode.org/wiki/Zig-zag_matrix","title":"Zig-zag matrix","kind":"io","tests":[{"input":"1","output":"0"},{"input":"2","output":"0 1\n2 3"},{"input":"3","output":"0 1 5\n2 4 6\n3 7 8"},{"input":"5","output":"0 1 5 6 14\n2 4 7 13 15\n3 8 12 16 21\n9 11 17 20 22\n10 18 19 23 24"}],"match":"numbers","minTerms":null,"tags":["matrix","number","rosetta"]}