[Question]
      [
As I'm applying for some jobs whose job advert doesn't state the salary, I imagined a particularly evil interviewer that would give the candidate the possibility to decide their own salary ...by "golfing" it!
So it goes simply like that:
>
> Without using numbers, write a code that outputs the annual salary you'd like to be offered.
>
>
>
However, being able to write concise code is a cornerstone of this company. So they have implemented a very tight seniority ladder where
>
> employers that write code that is *b* bytes long can earn a maximum of ($1'000'000) ¬∑ *b*-0.75.
>
>
>
we are looking at (these are the integer parts, just for display reasons):
```
   1 byte  ‚Üí $1'000'000       15 bytes ‚Üí $131'199
   2 bytes ‚Üí   $594'603       20 bytes ‚Üí $105'737
   3 bytes ‚Üí   $438'691       30 bytes ‚Üí  $78'011
   4 bytes ‚Üí   $353'553       40 bytes ‚Üí  $62'871
  10 bytes ‚Üí   $177'827       50 bytes ‚Üí  $53'182
```
### The challenge
Write a program or function that takes no input and outputs a text containing a dollar sign (`$`, U+0024) and a decimal representation of a number (integer or real).
* Your code cannot contain the characters `0123456789`.
In the output:
* There may optionally be a single space between the dollar sign and the number.
* Trailing and leading white spaces and new lines are acceptable, but any other output is forbidden.
* The number must be expressed as a decimal number using only the characters `0123456789.`. This excludes the use of scientific notation.
* Any number of decimal places are allowed.
**An entry is valid if** the value it outputs is not greater than ($1'000'000) ¬∑ *b*-0.75, where *b* is the byte length of the source code.
### Example output (the quotes should not be output)
```
"$ 428000"            good if code is not longer than 3 bytes
"$321023.32"          good if code is not longer than 4 bytes
"  $ 22155.0"         good if code is not longer than 160 bytes
"$ 92367.15 \n"       good if code is not longer than 23 bytes
"300000 $"            bad
" lorem $ 550612.89"  bad
"¬£109824"             bad
"$ -273256.21"        bad
"$2.448E5"            bad
```
### The score
The value you output is your score! (Highest salary wins, of course.)
---
## Leaderboard
Here is a Stack Snippet to generate both a regular leaderboard and an overview of winners by language.
To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:
```
# Language Name, $X (Y bytes)
```
where `X` is your salary and `Y` is the size of your submission. (The `Y bytes` can be anywhere in your answer.) If you improve your score, you *can* keep old scores in the headline, by striking them through. For instance:
```
# Ruby, <s>$111111.111... (18 bytes)</s> <s>$111999 (17 bytes)</s> $123456 (16 bytes)
```
You can also make the language name a link, which will then show up in the leaderboard snippet:
```
# [><>](http://esolangs.org/wiki/Fish), $126,126 (13 bytes)
```
```
var QUESTION_ID=171168,OVERRIDE_USER=77736;function answersUrl(e){return"https://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"https://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body.replace(/<(s|strike)>.*?<\/\1>/g,"");s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="<h1>"+e.body.replace(OVERRIDE_REG,"")+"</h1>")});var a1=r.match(SCORE_REG),a2=r.match(LANG_REG),a3=r.match(BYTES_REG);a1&&a2&&e.push({user:getAuthorName(s),size:a3?+a3[1]:0,score:+a1[1].replace(/[^\d.]/g,""),lang:a2[1],rawlang:(/<a/.test(a2[1])?jQuery(a2[1]).text():a2[1]).toLowerCase(),link:s.share_link})}),e.sort(function(e,s){var r=e.score,a=s.score;return a-r});var s={},r=1,a=null,n=1;e.forEach(function(e){e.score!=a&&(n=r),a=e.score,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.lang).replace("{{SCORE}}","$"+e.score.toFixed(2)).replace("{{SIZE}}",e.size||"?").replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);s[e.rawlang]=s[e.rawlang]||e});var t=[];for(var o in s)s.hasOwnProperty(o)&&t.push(s[o]);t.sort(function(e,s){var r=e.rawlang,a=s.rawlang;return r>a?1:r<a?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SCORE}}","$"+o.score.toFixed(2)).replace("{{SIZE}}",o.size||"?").replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var LANG_REG=/<h\d>\s*((?:[^\n,](?!\s*\(?\d+\s*bytes))*[^\s,:-])/,BYTES_REG=/(\d+)\s*(?:<a[^>]+>|<\/a>)?\s*bytes/i,SCORE_REG=/\$\s*([\d',]+\.?\d*)/,OVERRIDE_REG=/^Override\s*header:\s*/i;
```
```
body{text-align:left!important}#answer-list,#language-list{padding:10px;width:520px;float:left}table thead{font-weight:700}table td{padding:5px}
```
```
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b"> <div id="answer-list"> <h2>Leaderboard</h2> <table class="answer-list"> <thead> <tr><td></td><td>Author</td><td>Language</td><td>Score</td><td>Size</td></tr></thead> <tbody id="answers"> </tbody> </table> </div><div id="language-list"> <h2>Winners by Language</h2> <table class="language-list"> <thead> <tr><td>Language</td><td>User</td><td>Score</td><td>Size</td></tr></thead> <tbody id="languages"> </tbody> </table> </div><table style="display: none"> <tbody id="answer-template"> <tr><td>{{PLACE}}</td><td>{{NAME}}</td><td>{{LANGUAGE}}</td><td>{{SCORE}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr></tbody> </table> <table style="display: none"> <tbody id="language-template"> <tr><td>{{LANGUAGE}}</td><td>{{NAME}}</td><td>{{SCORE}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr></tbody> </table>
```
---
Edit: (rounded) maximum allowed score per byte count, for a quicker reference - [text here](https://tio.run/##HcFBCoAgEADAryySsIqKi0jRob8EZe1FQ7z0@g2aed5xt5pESuvAwBX6Xq8TyVEmsz6d60Cl0wHebzBpWgLFojSyo/izbC36GOZsjBH5AA):
[![enter image description here](https://i.stack.imgur.com/HpQNN.png)](https://i.stack.imgur.com/HpQNN.png)

[Answer]
# bash, $127127
```
x;echo \$$?$?
```
[Try it online!](https://tio.run/##S0oszvj/v8I6NTkjXyFGRcVexf7/fwA)
Since the `x` command doesn't exist, it errors and sets the exit code to `127`.
Then, the code outputs a dollar sign followed by `$?` twice. The `$?` variable stores the exit code of the previous command, so this outputs `$127127` in **13 bytes**.
[Answer]
# Java 8, $131,199.00 (15 bytes)
```
v->"$"+'e'*'‘ì'
```
[Try it online.](https://tio.run/##LY1BCsIwEEX3PcVQhKRKe4GiN7AbwY24GNMoqem0NJOASE/h1bxPTLGbD/Pn8V@HAcuufUZl0Tk4oqF3BmCI9XRHpaFZToATT4YeoOR5MC2Eok7tnKVwjGwUNECwhxjKQ77Jd0KLrfh@RKwXZPQ3m5CVDMtAnzzyv3m5Ahar5OVY99XguRrTiy1JqpQkb22xGuf4Aw)
**Explanation:**
```
v->            // Method with empty unused parameter and String return-type
  "$"+         //  Return a dollar sign, concatted with:
      'e'*'‘ì'  //  131199 (101 * 1299)
```
\$131,199.00 < 131,199.31\$
I used [a program to generate](https://tio.run/##XZBba4NAEIXf/RXDkuJa0bINFIJNIL28NU@hpVBL2aqJk3oJOgqh@NvtbmLU9GV3Z77DOTO7k7V0duFP2waJLEtYScx@DYB99Z1gACVJUledYwipQnxNBWbbj0@QlpYBBLEsQJYB4qN@zcEE0xtIWiWEDweKxvSIw1xFRECy2EakiJgKMZuF3himmCnydCzc1fL962358vp8kmzygmNGgHNxe@cBLqZCnY7TzdV7BLGy6FJuAL1LWstEYaW5AnFGuOG6fa/jezfohlHE61vjvbne18IB/l/9JAjis6IxhnN9KClK3bwid68@mJKMs9pZ@GziM9tkdh9kM1PXF96q55NPfMJs3guvLySWzSxm6eTGaNr2Dw) a printable ASCII character in the range `[32, 126]` which, when dividing `131199`, would have the lowest amount of decimal values. Since `101` can divide `131199` evenly, resulting in `1299`, I'm only 31 cents short of my maximum possible salary based on my byte-count of 15.
[Answer]
# [CJam](https://sourceforge.net/p/cjam), (5 bytes) $294204.018...
```
'$PB#
```
[Try it online!](https://tio.run/##S85KzP3/X10lwEn5/38A "CJam ‚Äì Try It Online")
Explanation:
I derived it from Dennis' answer, but looked for combinations of numbers which would yield a higher result. I almost gave up, but I saw that `P` is the variable for \$\pi\$, and that \$\pi^{11} \approx 294000\$. The letter `B` has a value of 11 in CJam, giving the code above.
[Answer]
# [CJam](https://sourceforge.net/p/cjam), 5 bytes, $262'144
```
'$YI#
```
[Try it online!](https://tio.run/##S85KzP3/X10l0lP5/38A "CJam ‚Äì Try It Online")
### How it works
```
'$     Push '$'.
  Y    Push 2.
   I   Push 18.
    #  Pop 2 and 18 and perform exponentiation, pushing 262144.
```
[Answer]
# [R](https://www.r-project.org/), 20 bytes, `$103540.9`
```
T=pi+pi;cat("$",T^T)
```
[Try it online!](https://tio.run/##K/pvmGqmZWQQp6tnbvo/xLYgU7sg0zo5sURDSUVJJyQuRPP/fwA "R ‚Äì Try It Online")
The max for 20 bytes is `$105737.1`, so this is quite close to the salary cap!
This would be a nice raise, and if I get paid to do code golf......
[Answer]
# [GS2](https://github.com/nooodl/gs2), (5 bytes) $292,929
```
‚Ä¢$‚ò∫‚ÜîA
```
A full program (shown here using [code-page 437](https://en.wikipedia.org/wiki/Code_page_437#Character_set)). (Maximum achievable salary @ 5 bytes is $299069.75)
**[Try it online!](https://tio.run/##Sy82@v//UcMilUczdj1qm@L4/z8A "GS2 ‚Äì Try It Online")**
Builds upon Dennis's [GS2 answer](https://codegolf.stackexchange.com/a/171179/53748)...
```
‚Ä¢$‚ò∫‚ÜîA                             []
‚Ä¢$    - push '$'                  ['$']
  ‚ò∫   - push unsigned byte:
   ‚Üî  -   0x1d = 29               ['$',29]
    A - push top of stack twice   ['$',29,29,29]
      - implicit print            $292929
```
[Answer]
# [Self-modifying Brainfuck](https://soulsphere.org/hacks/smbf/), 16 bytes, $124444
```
<.<++.+.++..../$
```
[Try it online!](https://tio.run/##K85NSvv/30bPRltbDwi19YBAX@X/fwA "Self-modifying Brainfuck ‚Äì Try It Online")
[Answer]
# [R](https://www.r-project.org/), 21 bytes $99649.9
```
cat("$",min(lynx^pi))
```
[Try it online!](https://tio.run/##K/qfnJSZl6JhaGFlZKxjmGqmBWFqxunqmZtq/k9OLNFQUlHSyc3M08ipzKuIK8jU1Pz/HwA "R ‚Äì Try It Online")
A different `R` approach - see also [Giuseppe's answer](https://codegolf.stackexchange.com/a/171171/80010)
Very close to the maximum of $101937 for this bytecount.
## Bonus: `object.size()`
### [R](https://www.r-project.org/), 24 bytes $89096
```
cat("$",object.size(ls))
```
[Try it online!](https://tio.run/##K/qfnJSZl6JhaGFlZKpjmGqmBWFqxunqmZtq/k9OLNFQUlHSyU/KSk0u0SvOrErVyCnW1Pz/HwA "R ‚Äì Try It Online")
This is probably system-dependent, but when I ra this on TIO I got $89096 - close to the limit of 92223 for 24 bytes.
[Answer]
# JavaScript (ES6), 19 bytes, $109,839
```
_=>atob`JDEwOTgzOQ`
```
[Try it online!](https://tio.run/##FcwxDoIwFADQnVP8rW3Ushi3MhhdHCRGdym1hZLaT9oCwcsj7C@vk6OMKtg@HTx@9GLE8haFTFhXt8t1Kl/Nr3xUS55Dj2421jkwGIBsgjKyh6m1qgUbwWMCCV4mO2q4rxfvIpjBq2TRZ5sHARFEAefBGB24CfilEXZA1obUMurTkTCe8JmC9Q0ltfUyzIRlmUIf0WnusKGGMrb8AQ "JavaScript (Node.js) ‚Äì Try It Online")
\$109839\$ is the highest integer \$\le 109884\$ which does not produce any digit when prefixed with **'$'** and encoded in base64.
---
# Without `atob()` (Node.js), 26 bytes, $86,126
```
_=>'$'+Buffer('V~').join``
```
[Try it online!](https://tio.run/##y0osSyxOLsosKNHNy09J/Z9m@z/e1k5dRV3bqTQtLbVIQz2sTl1TLys/My8h4X9yfl5xfk6qXk5@ukaahqbmfwA "JavaScript (Node.js) ‚Äì Try It Online")
The concatenation of **'$'** with the ASCII codes of **'V'** (86) and **'~'** (126).
[Answer]
# PHP, $131116 (8 bytes)
Didn't see one for php and wanted to throw one up. I know someplace in php is a bad typecast that would cut this in half but I can't find it right now.
```
$<?=ERA;
```
This just takes advantage of PHP short tags and the PHP built in constants.
**[Try it online!](https://tio.run/##K8go@P9fxcbe1jXI0fr/fwA)**
[Answer]
# [GS2](https://github.com/nooodl/gs2), 5 bytes, $291'000
```
‚Ä¢$‚ò∫‚Üî‚àü
```
This is a [CP437](https://en.wikipedia.org/wiki/Code_page_437#Character_set) representation of the binary source code.
[Try it online!](https://tio.run/##Sy82@v//UcMilUczdj1qm/KoY/7//wA "GS2 ‚Äì Try It Online")
### How it works
```
‚Ä¢$     Push '$'.
  ‚ò∫‚Üî   Push 29.
    ‚àü  Push 1000.
```
[Answer]
## Excel 19 bytes $107899.616068361
```
="$"&CODE("(")^PI()
```
**Explanation:**
```
     CODE("(")        // find ASCII code of ( which is 40
              ^PI()   // raise to power of Pi  (40^3.141592654)
 "$"&                 // append $ to the front of it
=                     // set it to the cell value and display
```
[Answer]
## vim, ~~$99999~~ ~~$110000~~ $120000
```
i$=&pvh*&ur
```
[Try it online!](https://tio.run/##K/v/P1NFyFatoCxDS620iOv/fwA)
Uses the expression register (note that there is a <C-r> character, which is invisible in most fonts, between the `$` and `=`, for a total of **13 bytes**) to insert the value of the `'pvh'` option times the value of the `'ur'` option.
`'previewheight'` is the option that controls the height of preview windows, which is 12 by default.
`'undoreload'` is the maximum number of lines a buffer can have before vim gives up on storing it in memory for undo, and it defaults to 10,000.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~$256000 $256256~~ (6 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)) $257256
```
‚Åπ‚Äò‚Äù$;;
```
A full program. (Maximum achievable salary @ 6 bytes is $260847.43)
**[Try it online!](https://tio.run/##y0rNyan8//9R485HDTMeNcxVsbb@/x8A "Jelly ‚Äì Try It Online")**
### How?
```
‚Åπ‚Äò‚Äù$;; - Main Link: no arguments
‚Åπ      - Literal 256                            256
 ‚Äò     - increment                              257
  ‚Äù$   - single '$' character                   '$'
    ;  - concatenate                            ['$',257]
     ; - concatenate                            ['$',257,256]
       - implicit print                      -> $257256
```
---
Previous...
5 bytes $256256
```
‚Äù$;‚Åπ‚Å∫
```
('$' concatenate 256, repeat 256 - causing interim implicit printing)
6 bytes $256000:
```
‚Åπ√ó»∑·π≠‚Äù$
```
(256 √ó 1000 ·π≠ack '$')
[Answer]
# C#
## Full program, ~~72 bytes, $40448~~ 66 bytes, $43008
```
class P{static void Main()=>System.Console.Write("$"+('T'<<'i'));}
```
[Try it online!](https://tio.run/##Sy7WTc4vSv3/PzknsbhYIaC6uCSxJDNZoSw/M0XBNzEzT0PT1i64srgkNVfPOT@vOD8nVS@8KLMkVUNJRUlbQz1E3cZGPVNdU9O69v9/AA "C# (.NET Core) ‚Äì Try It Online")
### Explanation
Left-shift operator treats chars `'T'` and `'i'` as integers 84 and 105 respectively and performs shift
## Lambda, ~~19 bytes, $109568~~ 17 bytes, $118784
```
o=>"$"+('t'<<'j')
```
[Try it online!](https://tio.run/##JcpLCsIwEADQq4QiJMHPBZJ2I7gTCi5chzHISJyBzEQopWePgqu3eSBH4Jp7E6SnuS2i@R2gJBEzr6JJEcyH8WGuCcn59dIIomj97YP5O6Wx8zgNu2HvrNoY7cv6Hs5MwiWf7hU1u@SoleJ92Lb@BQ "C# (.NET Core) ‚Äì Try It Online")
**Edit** Thanks to @LegionMammal978 and @Kevin for saving 2 bytes
[Answer]
# PHP, 13 Bytes, $144000 Salary
Unfortunately for this job, moving to Mauritius is required (well, I could move slightly less far eastward, however every timezone less would yield at $36k drop in salary.) To compensate for the inconvenience, my salary increases by $1 every leap year.
```
$<?=date(ZL);
```
This just puts out `Z` the timezone in seconds and appends whether or not it's a leap year.
[Answer]
# [brainfuck](https://esolangs.org/wiki/Brainfuck), 43 bytes, $58888
```
++++++[>++++++<-]>.<++++[>++++<-]>+.+++....
```
[Try it online!](https://tio.run/##SypKzMxLK03O/v9fGwyi7SC0jW6snZ4NQgTE19YDMvSA4P9/AA "brainfuck ‚Äì Try It Online")
### How it works
```
++++++[>++++++<-]>.  write 36 to cell one and print (36 is ASCII for $)
<++++[>++++<-]>+.    add 17 to cell 1 and print (cell 1 is now 53, ASCII for 5)
+++....              add 3 to cell 1 and print 4 times (cell 1 is now 56, ASCII for 8)
```
[Answer]
# [Python 3](https://docs.python.org/3/), (22 bytes) $ 98,442
```
print('$',ord('òÇä'))
```
**[Try it online!](https://tio.run/##K6gsycjPM/7/v6AoM69EQ11FXSe/KEVD/cOMpi51Tc3//wE "Python 3 ‚Äì Try It Online")**
Much like Doorknob's [Ruby answer](https://codegolf.stackexchange.com/a/171180/53748), the 4 byte Unicode character used here, `òÇä`, has an ordinal value of the maximal integer salary achievable in 22 bytes.
Note that `print()` prints its unnamed arguments separated by spaces by default (`sep` is an optional named argument).
[Answer]
# [Gol><>](https://github.com/Sp3000/Golfish), $207680 in 8 bytes
```
'o**n; $
```
[Try it online!](https://tio.run/##S8/PScsszvj/Xz1fSyvPWkHl/38A "Gol><> ‚Äì Try It Online")
### How it works:
```
'        Start string interpretation. Pushes the ASCII value of every character until it wraps back around to this character
 o       Output the top stack value as ASCII. This is the $ at the end of the code
  **     Multiply the top 3 stack values (This is the ASCII of 'n; ', 110*59*32
    n    Output top of stack as integer.
     ;   Terminate program
       $ (Not run, used for printing the $)
```
Interestingly enough, you can use `h` instead of `n;`, which yields `'o**h5$` with a score of $231504, but you can't use 0-9, and there isn't another 1-byte way to push 53, the ASCII value of `5`
[Answer]
# Mathematica, 18 bytes, $107,163.49
```
$~Print~N[E^(E!E)]
```
Full program; run using `MathematicaScipt -script`. Outputs `$107163.4882807548` followed by a trailing newline. I have verified that this is the highest-scoring solution of the form `$~Print~N[*expr*]` where `*expr*` is comprised of `Pi`, `E`, `I`, and `+-* /()!`.
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E) (5 bytes), $262626
```
'$‚ÇÇ√êJ
```
[Try it online!](https://tio.run/##yy9OTMpM/f9fXeVRU9PhCV7//wMA "05AB1E ‚Äì Try It Online")
\$262626 < 299069\$. Pushes the character `$` to the stack, then pushes the integer \$26\$. From here, the program triplicates the integer, leaving the stack as `["$", 26, 26, 26]` and joins (`J`) the stack.
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), 23 bytes, $65535
```
_=>"$"+ +(~~[]+`xFFFF`)
```
[Try it online!](https://tio.run/##y0osSyxOLsosKNHNy09J/Z9m@z/e1k5JRUlbQVujri46Vjuhwg0IEjT/Wyfn5xXn56Tq5eSna6RpaOooGKaaaWkoKWmnaerlpOall2RoaenqmZtq/gcA "JavaScript (Node.js) ‚Äì Try It Online")
This is the best I can get without `atob`, though there is a large improvement space tbh
You know, having no short character to ascii conversion function sucks A LOT.
***AFTER A WHOLE DAY***
# [JavaScript (Node.js)](https://nodejs.org), 30 bytes, $78011
```
_=>"$"+`ìÇª`.codePointAt(![])
```
[Try it online!](https://tio.run/##y0osSyxOLsosKNHNy09J/Z9m@z/e1k5JRUk74cPkpt0JeslA0YD8zLwSxxINxehYzf/J@XnF@Tmpejn56RppGpqa/wE "JavaScript (Node.js) ‚Äì Try It Online")
## or: 29 bytes, $80020
```
_=>"$"+`ÚÄÄ†`.codePointAt(!_)
```
Where `ÚÄÄ†` is `U+13894 INVALID CHARACTER`
Oh `String.codePointAt`! I've just completely forgotten this!
## A joke one (15B, $130000), not vaild at all but just for fun
```
_=>"$ÂçÅ‰∏âËê¨"
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 8 bytes, $210176.48625619375
```
‚ÅΩ¬Ω"√ó¬Ω‚Äù$,
```
3535 (`‚ÅΩ¬Ω"`) multipli(`√ó`)ed by its sqrt (`¬Ω`).
[Try it online!](https://tio.run/##y0rNyan8//9R495De5UOTz@091HDXBWd//8B "Jelly ‚Äì Try It Online")
[Answer]
# Perl 5.26.2, 12 bytes, $146002
```
say$]^"\x11\x0e\x01\x06"
```
Hex escapes only shown because ASCII control chars are filtered out.
[Try it online!](https://tio.run/##K0gtyjH9/784sVIlNk5dkI@RTf3//3/5BSWZ@XnF/3V9TfUMDA0A "Perl 5 ‚Äì Try It Online")
You can get a bit more with different Perl versions, for example $155012 with 5.25.12.
[Answer]
## MATLAB, 17 bytes, $112222
```
['$','..////'+pi]
```
Old answer:
```
['$','RRUUTR'-'!']
```
[Answer]
# [brainfuck](https://github.com/TryItOnline/brainfuck), 34 bytes, $69999
```
+[->-[---<]>-]>.[-->+++<]>.+++....
```
[Try it online!](https://tio.run/##SypKzMxLK03O/v9fO1rXTjdaV1fXJtZON9ZOD8i009bWBvL0gJQeEPz/DwA "brainfuck ‚Äì Try It Online")
### Explanation:
```
+[->-[---<]>-]>.   Generate and print 36 ($)
[-->+++<]>         Divide by 2 and multiply by 3 to get 54 (6)
          .        Print 6
           +++.... Print 9999
```
[Answer]
## Ruby, $119443
```
$><<?$<<?ùäì.ord
```
[Try it online!](https://tio.run/##KypNqvz/X8XOxsZeBYg/zO2arJdflPL/PwA)
The maximum integer output for 17 bytes. The Unicode character is U+1D293, which is 119443 in hex.
[Answer]
# [MathGolf](https://github.com/maxbergmark/mathgolf), $353535 (4 bytes)
```
'$W‚àô
```
[Try it online!](https://tio.run/##y00syUjPz0n7/19dJfxRx8z//wE "MathGolf ‚Äì Try It Online")
## Explanation
```
'$    Push "$"
  W   Push 35
   ‚àô  Triplicate top of stack
```
## Disclaimer
This language was created after the posting of this question. While the language is a general language, it is designed with numerical questions in mind. It contains a lot of 1-byte number literals, and other nifty things for number-related questions. It is still a work in progress.
[Answer]
# [dc](https://www.gnu.org/software/bc/manual/dc-1.05/html_mono/dc.html), $169169 10 bytes
```
Dd*d[$]nnn
```
[Try it online!](https://tio.run/##S0n@/98lRSslWiU2Ly/v/38A "dc ‚Äì Try It Online")
This prints 13 (`D`) squared, twice
[Answer]
# Japt, 5 bytes, $262144
```
'$+I¬≥
```
[Test it](https://ethproductions.github.io/japt/?v=1.4.6&code=JyQrSbM=)
---
Explanation
`I` is the Japt constant for `64`, `¬≥` cubes it and then `'$+` concatenates that with the dollar symbol.
]


[Question]
      [
Background: the Ramsey number \$R(r,s)\$ gives the minimum number of vertices \$v\$ in the complete graph \$K\_v\$ such that a red/blue edge coloring of \$K\_v\$ has at least one red \$K\_r\$ or one blue \$K\_s\$. Bounds for larger \$r, s\$ are very difficult to establish.
Your task is to output the number \$R(r,s)\$ for \$1 \le r,s \le 5\$.
## Input
Two integers \$r, s\$ with \$1 \le r \le 5\$ and \$1 \le s \le 5 \$.
## Output
\$R(r,s)\$ as given in this table:
```
  s   1    2    3    4      5
r +--------------------------
1 |   1    1    1    1      1
2 |   1    2    3    4      5
3 |   1    3    6    9     14
4 |   1    4    9   18     25
5 |   1    5   14   25  43-48
```
Note that \$r\$ and \$s\$ are interchangeable: \$R(r,s) = R(s,r)\$.
For \$R(5,5)\$ you may output any integer between \$43\$ and \$48\$, inclusive. At the time of this question being posted these are the best known bounds.

[Answer]
# JavaScript (ES6), ~~51~~ 49 bytes
Takes input in currying syntax `(r)(s)`.
```
r=>s=>--r*--s+[9,1,,13,2,,3,27,6][r<2|s<2||r*s%9]
```
[Try it online!](https://tio.run/##HYjdCoIwHEfvfYr/TbDZb8K0D6S2FxkjhmkY5mSLUPDdl3VxDofzdB8Xm9BPbzH6e5s6lYLSUWkhQi5E3JsaEpAVSmDTGSdrwrVc48Ya8rirbWr8GP3QFoN/sIzISFAJqkAH0NEWLzcxNoNuIMdJaXL/tfyyYzNnC@c845f0BQ "JavaScript (Node.js) – Try It Online")
### How?
As a first approximation, we use the formula:
$$(r-1)(s-1)$$
```
 0  0  0  0  0
 0  1  2  3  4
 0  2  4  6  8
 0  3  6  9 12
 0  4  8 12 16
```
If we have \$\min(r,s)<3\$, we simply add \$1\$:
```
 1  1  1  1  1
 1  2  3  4  5
 1  3  -  -  -
 1  4  -  -  -
 1  5  -  -  -
```
Otherwise, we add a value picked from a lookup table whose key \$k\$ is defined by:
$$k=(r-1)(s-1)\bmod9$$
```
 k:                    table[k]:           (r-1)(s-1):         output:
 -  -  -  -  -         -  -  -  -  -       -  -  -  -  -       -  -  -  -  -
 -  -  -  -  -         -  -  -  -  -       -  -  -  -  -       -  -  -  -  -
 -  -  4  6  8   -->   -  -  2  3  6   +   -  -  4  6  8   =   -  -  6  9 14
 -  -  6  0  3         -  -  3  9 13       -  -  6  9 12       -  -  9 18 25
 -  -  8  3  7         -  -  6 13 27       -  -  8 12 16       -  - 14 25 43
```
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), ~~56~~ 55 bytes
```
f=(x,y)=>x<2|y<2||f(x,y-1)+f(x-1,y)-(x*y==12)-7*(x+y>8)
```
[Try it online!](https://tio.run/##NY3hCsIwDIRfJ1mbQAdDQTvwOUQkzE2UuY5OpIW9e5f98OAgd4Hv3vKTpYuv@UtTePSlDB6SzejbdK7XrF6HvSCHRg9y@iNIVfbe1UiHCpLJ7RFLF6YljD2P4QlXZr7EKBkavPFHZoC7TVaUKv@4TyjQKNA4VJ3KBg "JavaScript (Node.js) – Try It Online") I noticed that the table resembles Pascal's triangle but with correction factors. Edit: Saved 1 byte thanks to @sundar.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~17~~ 16 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
```
’ScḢƊ_:¥9“ ı?0‘y
```
**[Try it online!](https://tio.run/##y0rNyan8//9Rw8zg5Ic7Fh3rirc6tNTyUcMchSMb7Q0eNcwASv6PNtUxiQUA "Jelly – Try It Online")** Or see a [test-suite](https://tio.run/##y0rNyan8//9Rw8zg5Ic7Fh3rirc6tNTyUcMchSMb7Q0eNcyo/G8aZH24/dDSw/sSwh41rQEi9/8A "Jelly – Try It Online").
Replace the `0` with `+`, `,`, `-`, `.`, or `/` to set \$R(5,5)\$ equal to \$43\$, \$44\$, \$45\$, \$46\$, or \$47\$ respectively (rather than the \$48\$ here).
### How?
Since \$R(r,s)\leq R(r-1,s)+R(r,s-1)\$ we may find that:
$$R(r,s)\leq \binom{r+s-2}{r-1}$$
This is `’ScḢƊ` and would produce:
```
 1  1  1  1  1
 1  2  3  4  5
 1  3  6 10 15
 1  4 10 20 35
 1  5 15 35 70
```
If we subtract one for each time nine goes into the result we align three more with our goal (this is achieved with `_:¥9`):
```
 1  1  1  1  1
 1  2  3  4  5
 1  3  6  9 14
 1  4  9 18 32
 1  5 14 32 63
```
The remaining two incorrect values, \$32\$ and \$63\$ may then be translated using Jelly's `y` atom and code-page indices with `“ ı?0‘y`.
```
’ScḢƊ_:¥9“ ı?0‘y - Link: list of integers [r, s]
’                - decrement              [r-1, s-1]
    Ɗ            - last 3 links as a monad i.e. f([r-1, s-1]):
 S               -   sum                  r-1+s-1 = r+s-2
   Ḣ             -   head                 r-1
  c              -   binomial             r+s-2 choose r-1
        9        - literal nine
       ¥         - last 2 links as a dyad i.e. f(r+s-2 choose r-1, 9):
      :          -   integer division     (r+s-2 choose r-1)//9
     _           -   subtract             (r+s-2 choose r-1)-((r+s-2 choose r-1)//9)
         “ ı?0‘  - code-page index list   [32,25,63,48]
               y - translate              change 32->25 and 63->48
```
[Answer]
# [Python 2](https://docs.python.org/2/), 62 bytes
```
def f(c):M=max(c);u=M<5;print[48,25-u*7,3*M+~u-u,M,1][-min(c)]
```
[Try it online!](https://tio.run/##K6gsycjPM/r/PyU1TSFNI1nTytc2N7ECyLAutfW1MbUuKMrMK4k2sdAxMtUt1TLXMdby1a4r1S3V8dUxjI3Wzc3MA6qN/Z@WX6RQpJCZp1CUmJeeqmGoo2CmacXFCRIuRggXQYU5waYqALnFOgpKtnZKOgrWQNuji3SKYzX/AwA "Python 2 – Try It Online")
---
### [Python 2](https://docs.python.org/2/), 63 bytes
```
def f(c):M=max(c);print[48,M%2*7+18,3*~-M+2*(M>4),M,1][-min(c)]
```
[Try it online!](https://tio.run/##K6gsycjPM/r/PyU1TSFNI1nTytc2N7ECyLAuKMrMK4k2sdDxVTXSMtc2tNAx1qrT9dU20tLwtTPR1PHVMYyN1s3NzAMqjv2fll@kUKSQmadQlJiXnqphqKNgpmnFxQkSLkYIF0GFOcGGKwC5xToKSrZ2SjoK1kDro4t0imM1/wMA "Python 2 – Try It Online")
This is ridiculous, I will soon regret having posted this... But eh, ¯\\_(ツ)\_/¯. Shaved off 1 byte thanks to our kind [Jonathan Allan](https://codegolf.stackexchange.com/users/53748/jonathan-allan) :). Will probably be outgolfed by about 20 bytes shortly though...
[Answer]
# [Julia 0.6](http://julialang.org/), ~~71~~ ~~61~~ ~~59~~ 57 bytes
```
A->((r,s)=sort(A);r<3?s^~-r:3r+(s^2-4s+3)*((r==s)+r-2)-3)
```
[Try it online!](https://tio.run/##LcoxDoMwDEbhq3i0CR5KSgcgIM6BQOoSKagC9JuuvXpg6Pb06a3fT3q/cqRAedSeGaVJsB0nj9Ki84MtP0Xj4diWSp/mvBT3FoKJg1aiXvKBtJ08RZ5Qks1CcQeB0kaPpr7lX7PkCw "Julia 0.6 – Try It Online")
### Ungolfed (well, a bit more readable):
```
function f_(A)
  (r, s) = sort(A)
  if r < 3
    result = s^(r-1)
  else
    result = 3*r +
               (s^2 - 4*s + 3) * ((r == s) + r - 2) -
               3
  end
  return result
end
```
### What does it do?
Takes input as array `A` containing r and s. Unpacks the array into r and s with the smaller number as r, using `(r,s)=sort(A)`.
If r is 1, output should be 1. If r is 2, output should be whatever s is.
\$ s^{r - 1} \$ will be \$ s^0 = 1 \$ for r=1, and \$ s^1 = s \$ for r = 2.
So, `r<3?s^(r-1)` or shorter, `r<3?s^~-r`
For the others, I started with noticing that the output is:
* for r = 3, \$ 2\times3 + [0, 3, 8] \$ (for s = 3, 4, 5 respectively).
* for r = 4, \$ 2\times4 + \ \ [10, 17] \$ (for s = 4, 5 respectively)
* for r = 5, \$ 2\times5 + \ \ \ \ \ [35] \$ (for s = 5)
(I initially worked with f(5,5)=45 for convenience.)
This looked like a potentially usable pattern - they all have `2r` in common, 17 is 8\*2+1, 35 is 17\*2+1, 10 is 3\*3+1. I started with extracting the base value from [0, 3, 8], as `[0 3 8][s-2]` (this later became the shorter `(s^2-4s+3)`).
Attempting to get correct values for r = 3, 4, and 5 with this went through many stages, including
```
2r+[0 3 8][s-2]*(r>3?3-s+r:1)+(r-3)^3+(r>4?1:0)
```
and
```
2r+(v=[0 3 8][s-2])+(r-3)*(v+1)+(r==s)v
```
Expanding the latter and simplifying it led to the posted code.
[Answer]
# x86, ~~49~~ 37 bytes
Not very optimized, just exploiting the properties of the first three rows of the table. While I was writing this I realized the code is basically a jump table so a jump table could save many bytes. Input in `eax` and `ebx`, output in `eax`.
-12 by combining cases of `r >= 3` into a lookup table (originally just `r >= 4`) and using Peter Cordes's suggestion of `cmp`/`jae`/`jne` with the flags still set so that `r1,r2,r3` are distinguished by only one `cmp`! Also indexing into the table smartly using a constant offset.
```
start:
        cmp     %ebx, %eax
        jbe     r1
        xchg    %eax, %ebx              # ensure r <= s
r1:
        cmp     $2, %al
        jae     r2                      # if r == 1: ret r
        ret
r2:
        jne     r3                      # if r == 2: ret s
        mov     %ebx, %eax
        ret
r3:
        mov     table-6(%ebx,%eax),%al  # use r+s-6 as index
        sub     %al, %bl                # temp = s - table_val
        cmp     $-10, %bl               # equal if s == 4, table_val == 14
        jne     exit
        add     $4, %al                 # ret 18 instead of 14
exit:
        ret
table:
        .byte   6, 9, 14, 25, 43
```
Hexdump
```
00000507  39 d8 76 01 93 3c 02 73  01 c3 75 03 89 d8 c3 8a  |9.v..<.s..u.....|
00000517  84 03 21 05 00 00 28 c3  80 fb f6 75 02 04 04 c3  |..!...(....u....|
00000527  06 09 0e 19 2b                                    |....+|
```
[Answer]
# [Python 2](https://docs.python.org/2/), 70 bytes
```
f=lambda R,S:R<=S and[1,S,[6,9,14][S-3],[18,25][S&1],45][R-1]or f(S,R)
```
[Try it online!](https://tio.run/##VcuxDsIgFEDRWb/iTRaS1ya0tdHG/gSMhKSYitIoNICDX484up073O2THt61OZvpqV/XRQNHMfLLJEC7RTIUKAc8I@uVFHWnULITtscSB6awL@A1Uz6AIQI5zaYwgHUQtLvfCMOBjvvdFqxLUFXN6q0jsyEBI52bsL5jIh2F3xX/L5q/ "Python 2 – Try It Online")
[Answer]
# MATL, ~~25~~ 21 bytes
```
+2-lGqXnt8/k-t20/k6*-
```
[Try it on MATL Online](https://matl.io/?code=%2B2-lGqXnt8%2Fk-t20%2Fk6%2a-&inputs=4%0A3&version=20.9.1)
Attempt to port Jonathan Allan's [Jelly answer](https://codegolf.stackexchange.com/a/168624/8774) to MATL.
`+2-lGqXn` - same as that answer: compute \$ \binom{r+s-2}{r-1} \$
`t8/k` - duplicate that, divide by 8 and floor
`-` - subtract that from previous result (We subtract how many times 8 goes in the number, instead of 9 in the Jelly answer. The result is the same for all but the 35 and 70, which here give 31 and 62.)
`t20/k` - duplicate that result too, divide that by 20 and floor (gives 0 for already correct results, 1 for 31, 3 for 62)
`6*` - multiply that by 6
`-` - subtract that from the result (31 - 6 = 25, 62 - 18 = 44)
---
Older:
```
+t2-lGqXntb9<Q3w^/k-t20>+
```
[Try it on MATL Online](https://matl.io/?code=%2Bt2-lGqXntb9%3CQ3w%5E%2Fk-t20%3E%2B&inputs=5%0A5&version=20.9.1)
[Answer]
# [Python 3](https://docs.python.org/3/), 74 bytes
```
lambda *a:[[1]*5,[2,3,4,5],[6,9,14],[18,25],[43]][min(a)-1][max(a)-min(a)]
```
[Try it online!](https://tio.run/##bVDRbsIgFH3nK258Ku5uEVsXZ9af8JURwzrcmrXUAMYZ47d3UK20RgjJveeee84Ju6P7aXTarvOPtpL155eEqVxxzsR0gXyOKWa4EMhf8Q1Z5gu2xHkAslQIXpc6kfSZ@Ur@heoCiFZqe1Bm86uOkAMn4A9neL0Ce@Cm3wMp9kY9koX@4tlDC0/wQMiA2VIIIggpGmNU4bzbjJR62G0bAxbBNAcoNSi9r5WRTiUxIgKjq048cA1CoapqTPbbkdUx97rYGGX3VXBZJxYNvQ1Lu4kJOrE8H25E4hbccaeSwKGBVJXWRZOHWnwm4H0kF9puwsRQOW6OFXu5pxzYbaAqq@6M9UNiODtTapdMDqbR3yswpzNY/0KE/HTGLpovJi/@O2vpEoMWwxAHmSklF5WrCUY/OvIi7T8 "Python 3 – Try It Online")
[Answer]
# [Proton](https://github.com/alexander-liao/proton), 52 bytes
Near-port of my [Python answer](https://codegolf.stackexchange.com/a/168620/59487).
```
c=>[48,(M=max(c))%2*7+18,3*M-(M>4?1:3),M,1][-min(c)]
```
[Try it online!](https://tio.run/##PcoxCoMwFADQOTnFRygk9iukSitC0hPkBCFDEQIOJvLjIIhnT@3S9fFWSluKJYAukzauH1BYvXx2MUl5e9Svuxqwq20jrOnfauwkWlTeNcscr@JLSAQEIyhoW3jCwdlP8iX0F7bSHDdBCBmh0qZCCMIRZi8lZyc/yxc "Proton – Try It Online")
[Answer]
# Java 8, 62 bytes
```
(r,s)->--r*--s+new int[]{9,1,0,13,2,0,3,27,6}[r<2|s<2?1:r*s%9]
```
Lambda function, port of [Arnauld](https://codegolf.stackexchange.com/users/58563/arnauld)'s JavaScript [answer](https://codegolf.stackexchange.com/a/168633/79343). Try it online [here](https://tio.run/##RVLbToNAEH2Gr5iQmEBZGulNW1obEzUxakzsI@FhS7cNlVt2F7VBvh1nuxQJzMyeOTkzO8ORflGvKFl@3H22ZbVNkxjilAoBbzTJoTaNJJeM72nM4INmgp0UpkDIq2zLuK1CTkA54QSm0ZhGpyMklei@imQHGarZG8mT/BBGQPlBOGehTpNrt4LW5kQ43p3n8YHnCTdn30o6jOo58ck18cdkhA7tDZk1IV@OfsVytPYXfCCu5lFrGIFuL4ywjm5RoG6vg2hd@wT@34aAAkYExgQmBKYdgKcZgTkyJh0y0cdbJF9IU5VWZ8yOm0YV3xfdULCsH6BbrmAagOtyfeWeIDRB9IRuJnq87KdksWQ71by@Rsg9PwoFmqBn0VhWNEWOnuCwWwou5LwMfDYnIVk2LCo5LHH8Ms1tDi5YxEIrVLQAFXZKLtj2RXTVN@HAGiz7/cWxANn20/3z6@MD6dNaoe8YNR3L0fXxd1BfYzbtHw).
# Java, 83 bytes
```
int f(int x,int y){return x<2|y<2?1:f(x,y-1)+f(x-1,y)-(x*y==12?1:0)-7*(x+y>8?1:0);}
```
Recursive function, port of [Neil](https://codegolf.stackexchange.com/users/17602/neil)'s JavaScript [answer](https://codegolf.stackexchange.com/a/168619/79343). Try it online [here](https://tio.run/##RVJNb8IwDD2XX2H1lKwpWhlsjNJ9SNukaZuQxhFxCBBQGRSUpKwV629nThNK1Tq239Oza2fNDzzc7UW2Xvyc9vlsk85hvuFKwRdPMzi2PD5TWvK5BqW5btBvvlWiNPiFkGYalsRYyepA0bjlVS3P6TqBwy5dwBbVyVjLNFtNpsDlStFazOlKeySQiV9XiyDhaXQQUqYLcbrUKpixJT1KoXOZQTHs/JXDzmM0WJKClWFEA3TCiJU0JMVVmSSRAa9peHdFiqB86NdRXJ08r8J@PZSbTLGpLN/OhFSuiXP2eIwYXN6KgUl0GNww6DLouQRGtwzukdF1ma4N@0g@k3oGNjGiN1VdfLmTdoJYNorxGCbQiyEIpJ1PQ1CWoBqCG2DdP4hiL@ZaLEzz9jcmMoymE4Umbli4tJxvkGPH3V4SXFy9NHzGpdJi297lur3HNelNRiQE4DMfrTLeAIzrRAIg5KyXNPUpPIJPRh/UB2STt@f3z9cX1sBWoWkWNalPbX28NuarWtXpHw).
[Answer]
# C (gcc), 57 bytes
```
f(x,y){x=x<2|y<2?:f(x,y-1)+f(x-1,y)-(x*y==12)-7*(x+y>8);}
```
Recursive function, port of [Neil](https://codegolf.stackexchange.com/users/17602/neil)'s JavaScript [answer](https://codegolf.stackexchange.com/a/168619/79343). Try it online [here](https://tio.run/##RY5va4MwEMZf109xCEJST2hs3bpaVwbboGywD9D1hbOxK6yuJBYU52d3F/8VjiT3/J7LPYl3TJKmSVmBJa@KqFj7f@Xa36xaxRPcpYcnCHqsmJZRJHzu3U9Z4ZaPSx7WzSnL4RyfMsahsiamy67nL6n0LthTQQRVJRBuVSMYwUeYIywQgl6g7g7hgRyLXll07ZLMgykw2PRE53UdWpP0VzGzVdEmEdK1jiAIwXVVG2jkuuN65LrjbWRZXGSSywN5hvTKE/udpiMcTHGSX@MfsqRMIWjeguQ7VnCWWsdHuROzWWfXF0UTKesBAmPDdDQu47ABm328cRtW9Hh92r6/POOIV@AcuM1vQrew/9l2Dui0HnD0Z2YjmEzYh8QhUjtTW6aUzK8qg1lo1c0/).
# C (gcc), 63 bytes
```
f(r,s){r=--r*--s+(int[]){9,1,0,13,2,0,3,27,6}[r<2|s<2?:r*s%9];}
```
Port of [Arnauld](https://codegolf.stackexchange.com/users/58563/arnauld)'s JavaScript [answer](https://codegolf.stackexchange.com/a/168633/79343). Try it online [here](https://tio.run/##RZBva4NADMZf108RBOGujaBWu7VWymAbjA32AZwvnLVdYXUlZ2Hg7rO7nP8KIXfJ78nl4Qr3WBRtexCESjaUuC7NXVctxKmq00w2a/TRQ3@JAR@c73ClU9oGf2ob7DY0V846i3XLajjnp0pIaKyZqarr@bMklUYZByTQND7CLTSCaQQIS4QQIRoaXK0Q1qwIh07Yl/csHkWRwaZmutQ6tmaHHzKOgXiTH/OxTSCKYbGgztDEVc/VxFXPO8vl76Us6nLPmtE9uX6WKk7xKMqL@pp/s8R8GSjZgeIrJziXSuXHMvU9r5erC/HEQQwAQYhxOpmWSdiBLd5fpQ0bvjw/vLw9PeKEN@DspS1vjX7h8LLt7NHpNOCoj8pGMJ5wMImjpW5GWyaorK9UgRdbuv0H).
]


[Question]
      [
*This challenge is based on, and contains test cases from, [a programming course](http://mooc.aalto.fi/ohjelmointi/scala_2017.html) I took at Aalto University. The material is used with permission.*
Two and a half years ago there was a challenge about [spoonerisms in English](https://codegolf.stackexchange.com/questions/69385/spoonerise-words). However, in Finnish spoonerisms are much more complicated.
## Spoonerisms in Finnish
In Finnish, the vowels are `aeiouyäö` and the consonants are `bcdfghjklmnpqrstvwxz`. (`å` is technically part of Finnish, but is not considered here.)
The most basic spoonerisms only take the first vowel of each word, and any consonants preceding them, and exchange the parts:
```
**he**nri **ko**ntinen -> **ko**nri **he**ntinen
**ta**rja **ha**lonen -> **ha**rja **ta**lonen
**fra**kki **ko**ntti -> **ko**kki **fra**ntti
**o**vi **ke**llo -> **ke**vi **o**llo
```
### Long vowels
Some words contain two of the same consecutive vowel. In those cases, the vowel pair must be swapped with the other word's first vowel, shortening or lengthening vowels to keep the length same.
```
**haa**mu **ko**ntti -> **koo**mu **ha**ntti
**ki**sko **kaa**ppi -> **ka**sko **kii**ppi
```
In the case of two *different* consecutive vowels this does not apply:
```
**ha**uva **ko**ntti -> **ko**uva **ha**ntti
**pu**oskari **ko**ntti -> **ko**oskari **pu**ntti
```
Three or more of the same consecutive letter will **not** appear in the input.
### Vowel harmony
Finnish has this lovely thing called [vowel harmony](https://en.wikipedia.org/wiki/Vowel_harmony#Finnish). Basically, it means that the *back vowels* `aou` and *front vowels* `äöy` should not appear in the same word.
When swapping front or back vowels into a word, all vowels of the other kind in the rest of the word should be changed to match the new beginning of the word (`a <-> ä`, `o <-> ö`, `u <-> y`):
```
**kö***y*h*ä* **ko**ntti -> **ko***u*h*a* **kö**ntti
**ha***u*v*a* **lää**h*ä*tt*ää* -> **lä***y*v*ä* **haa**h*a*tt*aa*
```
`e` and `i` are neutral and may appear with all other letters; swapping them into a word *must not* cause changes to the rest of the word.
### Special cases
Vowel harmony does not apply to some words, including many loan words and compound words. These cases are not required to be handled "correctly".
## Challenge
Given two words, output the words spoonerised.
The input words will only contain the characters `a-z` and `äö`. You may choose to use uppercase or lowercase, but your choice must be consistent between both words and input/output.
I/O may be done [in any convenient format](http://meta.codegolf.stackexchange.com/q/2447/42963). (Words should be considered strings or arrays of characters.)
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so the shortest solution in bytes wins.
## Test cases
```
henri kontinen -> konri hentinen
tarja halonen -> harja talonen
frakki kontti -> kokki frantti
ovi kello -> kevi ollo
haamu kontti -> koomu hantti
hauva kontti -> kouva hantti
puoskari kontti -> kooskari puntti
köyhä kontti -> kouha köntti
hauva läähättää -> läyvä haahattaa
frakki stressi -> strekki frassi
äyskäri kontti -> kouskari äntti
hattu sfääri -> sfätty haari
ovi silmä -> sivi olma
haamu prätkä -> präämy hatka
puoskari sfääri -> sfäöskäri puuri
puoskari äyskäri -> äöskäri puuskari
uimapuku hajoa -> haimapuku ujoa
ihme baletti -> bahme iletti
uhka lima -> lihka uma
osuma makkara -> masuma okkara
makkara fakta -> fakkara makta
lapsi laiva -> lapsi laiva
firma hajoa -> harma fijoa
dimensio bitti -> bimensio ditti
flamingo joustava -> jomingo flaustava
globaali latomo -> labaali glotomo
trilogia fakta -> falogia trikta
printti maksa -> mantti priksa
riisi bitti -> biisi ritti
sini riisi -> rini siisi
aarre nyrkki -> nyyrre arkki
laavu laki -> laavu laki
kliininen parveke -> paaninen klirveke
priimus kahvi -> kaamus prihvi
spriinen lasta -> laanen sprista
kliimaksi mammona -> maamaksi klimmona
hylky hupsu -> hulku hypsy
kehys fiksu -> fihys keksu
levy huhu -> huvu lehu
tiheys guru -> guheus tiru
nyrkki heiluri -> herkki nyilyri
latomo hajoa -> hatomo lajoa
prisma lehti -> lesma prihti
viina baletti -> baana viletti
```

[Answer]
# JavaScript (ES6), ~~196~~ 175 bytes
Takes the words as two strings in currying syntax `(a)(b)`. Returns an array of two arrays of characters.
```
a=>b=>[(e=/(.*?)([eiäaöoyu])(\2?)(.*)/,g=(a,[,c,v])=>[...c+v+(a[3]&&v)+a[4]].map(c=>(j=e.search(v),i=e.search(c))>9&j>9?e[i&~1|j&1]:c))(a=e.exec(a),b=e.exec(b),e+=e),g(b,a)]
```
[Try it online!](https://tio.run/##bVRLjuM2EN3PKQq9sMVptQeTZDMDyI1sAgQJkAM4XpTdtEmLEg1@NBEQ5DQ@Q19AB@sUP5LVdq9UfPVYqnpVxRN2aPdGnt1Tq1/426F6w2q9q9abgldfitXnZ1ZsuBwuOLzq3m9Z8fdPBK0@sy/lsSqw3JT7stsyurBarfaP3WOBm5@3i0XHHnHzy3a7avBc7Kt1car4ynI0e1F0rJTX056x9bfFaf3tmW/k4r@v/54WX7ffCS2QSPwfvi@QlbvR3rGSP1aclcdiVyLbvjluHVRAucCuBMMtg2oNe91arfhK6WP2LJ@e1ssSLHEPFJECxdx@BPaP1UnLtlguGcsWLFnkViEiPMOy@OsPtoTvZPz26@9/siX79Cn8uXgQvDXyoYSHWrdOtrzNtpFAroSwzHVoThj8ApXOVBEwcBkYmQeDdT2FddkiCMgTgZGpu@TkSulkdBJ0OIwMgdj421C68SDeRxLoO7zlEXTLO3ttazR32SUUzv4dux5eezFc7uIKBHJ9nIAaLsOFLjkXjIz03XChVFCgc4gfKGUd9cpOZhYrICOXgth6uNyn7lPqw@UmH@eicPYQ8kjXgu1cHzIxd12wUjUpYStjGxq8b8PZUIQ60YI9XJoQztX4ocS3Px9eUw0ktDcfd@Vdne9vJM54yUvaAV/7NIgnnYczo@ADMnKlaHhw71DxLNwOCQOZzlNMUacmUpT0JQD8TAltfXI11Do02Qwg6ASMzBnhgLUbjYBBE4GRqfCcWq9Q5iEKCKTjNCzSNHhTLCFwkPNKX2TDWyvjOu3kWGsG4UXOqz0obGR7jNwTzZHD9PeTjjCQP4PjjaPSO0SVk3W60cmKIJA3QtOTYSS9YfJWgogBOecanI0cR5rEsVnXAAG5AjAyjZRW3pRHCJh3tVnZRt/EpvgSbDyNHNoCE8ei7U3ew7bvCQOM52t/sPOp0DqXTgDE0/RUKEk/yO/iGU3Ha55MjDAQIYGzimXjbVxiFPklDHtmQ8UBmGoJ1BxaoXV5RDCEDT470zHkEQTMSjaNbrOWGOGQRwKn3e5V3cdx8mebtskrWiDRn21/jctFH3M9UDN8MgiBmofjpBTvciiRIwWduLgynBQ8BTp649NXcKrZSXNlXRsiuFTeZDOA0PZS9WbenXEOZ4sRIGrQfDOCUHmruUiDozghUe3Z5HSkNd49FtgidONr8fY/ "JavaScript (Node.js) – Try It Online")
### How?
Each input word is passed through the regular expression **e**, which has 4 capturing groups:
```
e = /(.*?)([eiäaöoyu])(\2?)(.*)/    1: leading consonants (or empty)
     [ 1 ][     2    ][ 3 ][ 4]     2: first vowel
                                    3: doubled first vowel (or empty)
                                    4: all remaining characters
```
The helper function **g()** takes all capturing groups of the word to be updated as **a[ ]** and the first and second capturing groups of the other word as **c** and **v**.
We apply basic spoonerism and take care of long vowels with:
```
c + v + (a[3] && v) + a[4]
```
To apply vowel harmony, we first coerce the regular expression **e** to a string by adding it to itself, which gives:
```
e = "/(.*?)([eiäaöoyu])(\2?)(.*)//(.*?)([eiäaöoyu])(\2?)(.*)/"
     ^^^^^^^^^^^^^^^^
     0123456789ABCDEF (position as hexa)
```
Vowels that need to be harmonized have a position greater than 9 in the resulting string. Furthermore, the expression was arranged in such a way that front vowels ***äöy*** are located at even positions, while back vowels ***aou*** are located at odd positions, next to their counterparts.
Hence the following translation formula which is applied to each character **c** of the output word:
```
(j = e.search(v), i = e.search(c)) > 9 & j > 9 ? e[i & ~1 | j & 1] : c
```
[Answer]
# [Python 3](https://docs.python.org/3/), ~~235~~ ~~231~~ ~~225~~ ~~221~~ ~~217~~ 215 bytes
```
import re
S=F,B='äöy','aou'
def f(a,b,C=1):
 e,r,Q,W=re.findall(fr' ?(.*?([ei{B+F}]))(\2)?(\w*)'*2,a+' '+b)[0][2:6]
 for c in zip(*S*(W in B)+(B,F)*(W in F)):r=r.replace(*c)
 return[Q+W*len(e)+r]+(C and f(b,a,[]))
```
[Try it online!](https://tio.run/##XVNLbuM4EN3zFNxJsjXBdAaYRQB3gDSQfXcvskiCQTmmzIooUuBH3erB3MZnyAV8sEwVKSN2b2y@91jFVx@Nc9TO/vX@jsPofJReie@b@/ZuUx0Px7e5aitwqRI71cmuhnbbftl8am6EVK1vv7YPG6@uOrQ7MKbufCVv66vVbf2o8N@79f1/z01TP103t/XTj1VTra5bWFeyWm@bxz@fH69v/n4WsnNevki08heO9er7qn5gcNes67v2vlngfdPc@I2/8mo08KLq1UsjyGlM3j5@XT@sjLK1atb@eV1/kWB3ZHXbQvtI77//0GiU/ESW2f0/7Tdov203aMcU6@YqjAbpX8if7bzJBdJ59GhjLWvims2mzhFNWz3FqmXqXSvrUfbORrTKyj8@85kY4jMjIvhXkBqMW3SdiVgI0Xno@5IgYglnTDQTwk2kKWNclhQhR0BogCFdBDnCusRoSBNciIwXcUwu9OAvX1yoMeUrPc1aHw@XGTRlPL6d5Te0Ewe6FiMf@BYx80RHMqchRoBTcSF6FULOxMelPmIERYT@ePjNTip2jofluRiTDB0/40uSjp@d@SFfWhTQDMVEwNyjAZYejZ7u9kXj8/EwcGDs4aMVv@c@vi2mxpT8Wcs@3NLFy2v5gkg4wJh6nsSrgzLsE5WIEagHJbdg1FLrFpjAjEXSPbWV7udmIqNEdbhAv3KgToLP0gCZcZkQJ6GDPma5W4iBCWFgpM4bwKmk/YCiQz/AuVWGHbLPHQ7KBnRyiyenJ2bHjOgMDGj3Tr7StCKU5K@ucCQWUuyN2wIYfjG6wRUHhSGJKRE9GrfHiwIKQQpXkL9AMkH1hKX@jIknQnhEqujMJ0OfTQa0fMSyep5RYCRob7ySdva8iiTZeWYCGFPHYEpks0gfSPQGKQV/xSP4SfUq7xRA4UjNJPvFIQXZg57KQvMiBvZLhAisc4CBEJeZAGMWiMnPcK1c8TA4u9QMhSM1k0LPpqdNTmNIeXrJ8N7NY5hFr/QcaJJ9kTpk2CuCwqiJg/QSw6UpnURErejOPvks7JNW5DiiT2LpklZoUtl8rTJjZzSz537l0Z7tUcaGMTcj0FbRI2U8RjHkVtB8JmoEXH4OQMRUvof/AQ "Python 3 – Try It Online")
---
Saved
* -2 bytes, thanks to Lynn
* -4 bytes, thanks to Zacharý
[Answer]
# Pyth, 84 bytes
```
.b++hY*W@N2JhtY2XW}JeA@DJc2"aouäöy"eNGH_Bmth:d:"^([^A*)([A)(\\2)*(.+)"\A"aeiouyäö]"4
```
[Try it online.](http://pyth.herokuapp.com/?code=.b%2B%2BhY%2aW%40N2JhtY2XW%7DJeA%40DJc2%22aou%C3%A4%C3%B6y%22eNGH_Bmth%3Ad%3A%22%5E%28%5B%5EA%2a%29%28%5BA%29%28%5C%5C2%29%2a%28.%2B%29%22%5CA%22aeiouy%C3%A4%C3%B6%5D%224&input=%5B%22hauva%22%2C%22l%C3%A4%C3%A4h%C3%A4tt%C3%A4%C3%A4%22%5D&test_suite_input=%5B%22henri%22%2C+%22kontinen%22%5D%0A%5B%22tarja%22%2C+%22halonen%22%5D%0A%5B%22frakki%22%2C+%22kontti%22%5D%0A%5B%22ovi%22%2C+%22kello%22%5D%0A%5B%22haamu%22%2C+%22kontti%22%5D%0A%5B%22hauva%22%2C+%22kontti%22%5D%0A%5B%22puoskari%22%2C+%22kontti%22%5D%0A%5B%22k%C3%B6yh%C3%A4%22%2C+%22kontti%22%5D%0A%5B%22hauva%22%2C+%22l%C3%A4%C3%A4h%C3%A4tt%C3%A4%C3%A4%22%5D%0A%5B%22frakki%22%2C+%22stressi%22%5D%0A%5B%22%C3%A4ysk%C3%A4ri%22%2C+%22kontti%22%5D%0A%5B%22hattu%22%2C+%22sf%C3%A4%C3%A4ri%22%5D%0A%5B%22ovi%22%2C+%22silm%C3%A4%22%5D%0A%5B%22haamu%22%2C+%22pr%C3%A4tk%C3%A4%22%5D%0A%5B%22puoskari%22%2C+%22sf%C3%A4%C3%A4ri%22%5D%0A%5B%22puoskari%22%2C+%22%C3%A4ysk%C3%A4ri%22%5D%0A%5B%22uimapuku%22%2C+%22hajoa%22%5D%0A%5B%22ihme%22%2C+%22baletti%22%5D%0A%5B%22uhka%22%2C+%22lima%22%5D%0A%5B%22osuma%22%2C+%22makkara%22%5D%0A%5B%22makkara%22%2C+%22fakta%22%5D%0A%5B%22lapsi%22%2C+%22laiva%22%5D%0A%5B%22firma%22%2C+%22hajoa%22%5D%0A%5B%22dimensio%22%2C+%22bitti%22%5D%0A%5B%22flamingo%22%2C+%22joustava%22%5D%0A%5B%22globaali%22%2C+%22latomo%22%5D%0A%5B%22trilogia%22%2C+%22fakta%22%5D%0A%5B%22printti%22%2C+%22maksa%22%5D%0A%5B%22riisi%22%2C+%22bitti%22%5D%0A%5B%22sini%22%2C+%22riisi%22%5D%0A%5B%22aarre%22%2C+%22nyrkki%22%5D%0A%5B%22laavu%22%2C+%22laki%22%5D%0A%5B%22kliininen%22%2C+%22parveke%22%5D%0A%5B%22priimus%22%2C+%22kahvi%22%5D%0A%5B%22spriinen%22%2C+%22lasta%22%5D%0A%5B%22kliimaksi%22%2C+%22mammona%22%5D%0A%5B%22hylky%22%2C+%22hupsu%22%5D%0A%5B%22kehys%22%2C+%22fiksu%22%5D%0A%5B%22levy%22%2C+%22huhu%22%5D%0A%5B%22tiheys%22%2C+%22guru%22%5D%0A%5B%22nyrkki%22%2C+%22heiluri%22%5D%0A%5B%22latomo%22%2C+%22hajoa%22%5D%0A%5B%22prisma%22%2C+%22lehti%22%5D%0A%5B%22viina%22%2C+%22baletti%22%5D&debug=1) [Test suite.](http://pyth.herokuapp.com/?code=.b%2B%2BhY%2aW%40N2JhtY2XW%7DJeA%40DJc2%22aou%C3%A4%C3%B6y%22eNGH_Bmth%3Ad%3A%22%5E%28%5B%5EA%2a%29%28%5BA%29%28%5C%5C2%29%2a%28.%2B%29%22%5CA%22aeiouy%C3%A4%C3%B6%5D%224&input=%5B%22hauva%22%2C%22l%C3%A4%C3%A4h%C3%A4tt%C3%A4%C3%A4%22%5D&test_suite=1&test_suite_input=%5B%22henri%22%2C+%22kontinen%22%5D%0A%5B%22tarja%22%2C+%22halonen%22%5D%0A%5B%22frakki%22%2C+%22kontti%22%5D%0A%5B%22ovi%22%2C+%22kello%22%5D%0A%5B%22haamu%22%2C+%22kontti%22%5D%0A%5B%22hauva%22%2C+%22kontti%22%5D%0A%5B%22puoskari%22%2C+%22kontti%22%5D%0A%5B%22k%C3%B6yh%C3%A4%22%2C+%22kontti%22%5D%0A%5B%22hauva%22%2C+%22l%C3%A4%C3%A4h%C3%A4tt%C3%A4%C3%A4%22%5D%0A%5B%22frakki%22%2C+%22stressi%22%5D%0A%5B%22%C3%A4ysk%C3%A4ri%22%2C+%22kontti%22%5D%0A%5B%22hattu%22%2C+%22sf%C3%A4%C3%A4ri%22%5D%0A%5B%22ovi%22%2C+%22silm%C3%A4%22%5D%0A%5B%22haamu%22%2C+%22pr%C3%A4tk%C3%A4%22%5D%0A%5B%22puoskari%22%2C+%22sf%C3%A4%C3%A4ri%22%5D%0A%5B%22puoskari%22%2C+%22%C3%A4ysk%C3%A4ri%22%5D%0A%5B%22uimapuku%22%2C+%22hajoa%22%5D%0A%5B%22ihme%22%2C+%22baletti%22%5D%0A%5B%22uhka%22%2C+%22lima%22%5D%0A%5B%22osuma%22%2C+%22makkara%22%5D%0A%5B%22makkara%22%2C+%22fakta%22%5D%0A%5B%22lapsi%22%2C+%22laiva%22%5D%0A%5B%22firma%22%2C+%22hajoa%22%5D%0A%5B%22dimensio%22%2C+%22bitti%22%5D%0A%5B%22flamingo%22%2C+%22joustava%22%5D%0A%5B%22globaali%22%2C+%22latomo%22%5D%0A%5B%22trilogia%22%2C+%22fakta%22%5D%0A%5B%22printti%22%2C+%22maksa%22%5D%0A%5B%22riisi%22%2C+%22bitti%22%5D%0A%5B%22sini%22%2C+%22riisi%22%5D%0A%5B%22aarre%22%2C+%22nyrkki%22%5D%0A%5B%22laavu%22%2C+%22laki%22%5D%0A%5B%22kliininen%22%2C+%22parveke%22%5D%0A%5B%22priimus%22%2C+%22kahvi%22%5D%0A%5B%22spriinen%22%2C+%22lasta%22%5D%0A%5B%22kliimaksi%22%2C+%22mammona%22%5D%0A%5B%22hylky%22%2C+%22hupsu%22%5D%0A%5B%22kehys%22%2C+%22fiksu%22%5D%0A%5B%22levy%22%2C+%22huhu%22%5D%0A%5B%22tiheys%22%2C+%22guru%22%5D%0A%5B%22nyrkki%22%2C+%22heiluri%22%5D%0A%5B%22latomo%22%2C+%22hajoa%22%5D%0A%5B%22prisma%22%2C+%22lehti%22%5D%0A%5B%22viina%22%2C+%22baletti%22%5D&debug=1)
Proving that it's not *that* hard in golf languages. A stack-based language might do even better.
Pyth uses ISO-8859-1 by default, so `äö` are one byte each.
### Explanation
* `Q`, containing the input pair of words, is appended implicitly.
* `m`: map each word `d` in the input to:
	+ `:"^([^A*)([A)(\\2)*(.+)"\A"aeiouyäö]"`: replace `A` with `aeiouyäö]` in the string to get the regex `^([^aeiouyäö]*)([aeiouyäö])(\2)*(.+)`.
	+ `:d`: find all matches and return their capturing groups.
	+ `h`: take the first (and only) match.
	+ `t`: drop the first group containing the entire match.
* `_B`: pair with reverse to get `[[first, second], [second, first]]`.
* `.b`: map each pair of words `N, Y` in that to:
	+ `hY`: take the beginning consonants of the second word.
	+ `@N2`: take the long first vowel of the first word, or `None`.
	+ `htY`: take the first vowel of the second word.
	+ `J`: save that in `J`.
	+ `*W`…`2`: if there was a long vowel, duplicate the second word's vowel.
	+ `+`: append that to the consonants.
	+ `c2"aouäöy"`: split `aouäöy` in two to get `["aou", "äöy"]`.
	+ `@DJ`: sort the pair by intersection with the first vowel of the second word. This gets the half with the second word's first vowel in the end of the pair.
	+ `A`: save the pair to `G, H`.
	+ `e`: take the second half.
	+ `}J`: see if the first vowel of the second word is in the second half.
	+ `XW`…`eNGH`: if it was, map `G` to `H` in the suffix of the first word, otherwise keep the suffix as-is.
	+ `+`: append the suffix.
]


[Question]
      [
# Rotonyms 2
A "Rotonym" is a word that ROT13s into another word (in the same language).
For this challenge, we'll use an alternate definition: a "Rotonym" is a word that circular shifts/rotates into *another* word (in the same language).
For example:
```
'stable' < 'tables' < 'ablest'
'abort' > 'tabor'
'tada' >> 'data'
```
# The Challenge
Write a program or function that accepts a dictionary/word list and prints or returns a complete list of rotonyms.
1. Order doesn't matter.
2. Comparisons should be case-insensitive, so you can assume the input will be passed as a lower-case-only dictionary.
3. Result should be expressed as single words (not the pairs) and contain no duplicates, so you can assume the input has no duplicates.
4. This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'").
# Example
Given
```
ablest
abort
green
irk
stable
tables
tabor
tata
terra
vex
you
```
Return
```
ablest
abort
stable
tables
tabor
```
# A Real Test
Given
```
a aa aal aalii aam aani aardvark aardwolf aaron aaronic aaronical aaronite aaronitic aaru ab aba ababdeh ababua abac abaca abacate abacay abacinate abacination abaciscus abacist aback abactinal abactinally abaction abactor abaculus abacus abadite abaff abaft abaisance abaiser abaissed abalienate abalienation abalone abama abampere abandon abandonable abandoned abandonedly abandonee abandoner abandonment abanic abantes abaptiston abarambo abaris abarthrosis abarticular abarticulation abas abase abased abasedly abasedness abasement abaser abasgi abash abashed abashedly abashedness abashless abashlessly abashment abasia abasic abask abassin abastardize abatable abate abatement abater abatis abatised abaton abator abattoir abatua abature abave abaxial abaxile abaze abb abba abbacomes abbacy abbadide abbas abbasi abbassi abbasside abbatial abbatical abbess abbey abbeystede abbie abbot abbotcy abbotnullius abbotship abbreviate abbreviately abbreviation abbreviator abbreviatory abbreviature abby abcoulomb abdal abdat abderian abderite abdest abdicable abdicant abdicate abdication abdicative abdicator abdiel abditive abditory abdomen abdominal abdominales abdominalian abdominally abdominoanterior abdominocardiac abdominocentesis abdominocystic abdominogenital abdominohysterectomy abdominohysterotomy abdominoposterior abdominoscope abdominoscopy abdominothoracic abdominous abdominovaginal abdominovesical abduce abducens abducent abduct abduction abductor abe abeam abear abearance abecedarian abecedarium abecedary abed abeigh abel abele abelia abelian abelicea abelite abelmoschus abelmosk abelonian abeltree abencerrages abenteric abepithymia aberdeen aberdevine aberdonian aberia aberrance aberrancy aberrant aberrate aberration aberrational aberrator aberrometer aberroscope aberuncator abet abetment ablest abort abut ach ache acher achete achill achor acor acre acyl ad adad adat add addlings adet ala ama baa bafta balonea batea beta caba cha chilla cora crea da dad dada data each lacy orach rache saddling stable tables tabor tabu tade teache zoquean zoraptera zorgite zoril zorilla zorillinae zorillo zoroastrian zoroastrianism zoroastrism zorotypus zorrillo zorro zosma zoster zostera zosteraceae zosteriform zosteropinae zosterops zouave zounds zowie zoysia zubeneschamali zuccarino zucchetto zucchini zudda zugtierlast zugtierlaster zuisin zuleika zulhijjah zulinde zulkadah zulu zuludom zuluize zumatic zumbooruk zuni zunian zunyite zupanate zutugil zuurveldt zuza zwanziger zwieback zwinglian zwinglianism zwinglianist zwitter zwitterion zwitterionic zyga zygadenine zygadenus zygaena zygaenid zygaenidae zygal zygantra zygantrum zygapophyseal zygapophysis zygion zygite zygnema zygnemaceae zygnemales zygnemataceae zygnemataceous zygnematales zygobranch zygobranchia zygobranchiata zygobranchiate zygocactus zygodactyl zygodactylae zygodactyli zygodactylic zygodactylism zygodactylous zygodont zygolabialis zygoma zygomata zygomatic zygomaticoauricular zygomaticoauricularis zygomaticofacial zygomaticofrontal zygomaticomaxillary zygomaticoorbital zygomaticosphenoid zygomaticotemporal zygomaticum zygomaticus zygomaxillare zygomaxillary zygomorphic zygomorphism zygomorphous zygomycete zygomycetes zygomycetous zygon zygoneure zygophore zygophoric zygophyceae zygophyceous zygophyllaceae zygophyllaceous zygophyllum zygophyte zygopleural zygoptera zygopteraceae zygopteran zygopterid zygopterides zygopteris zygopteron zygopterous zygosaccharomyces zygose zygosis zygosperm zygosphenal zygosphene zygosphere zygosporange zygosporangium zygospore zygosporic zygosporophore zygostyle zygotactic zygotaxis zygote zygotene zygotic zygotoblast zygotoid zygotomere zygous zygozoospore zymase zyme zymic zymin zymite zymogen zymogene zymogenesis zymogenic zymogenous zymoid zymologic zymological zymologist zymology zymolyis zymolysis zymolytic zymome zymometer zymomin zymophore zymophoric zymophosphate zymophyte zymoplastic zymoscope zymosimeter zymosis zymosterol zymosthenic zymotechnic zymotechnical zymotechnics zymotechny zymotic zymotically zymotize zymotoxic zymurgy zyrenian zyrian zyryan zythem zythia zythum zyzomys zyzzogeton
```
Return
```
aal aam aba abac abaft abalone abate abet ablest abort abut ach ache acher achete achill achor acor acre acyl ad adad adat add addlings adet ala ama baa bafta balonea batea beta caba cha chilla cora crea da dad dada data each lacy orach rache saddling stable tables tabor tabu tade teache
```

[Answer]
# [APL (Dyalog Unicode)](https://www.dyalog.com/), ~~25~~ ~~23~~ ~~22~~ ~~17~~ 16 [bytes](https://codegolf.meta.stackexchange.com/a/9429/43319 "When can APL characters be counted as 1 byte each?")[SBCS](https://github.com/abrudz/SBCS ".dyalog files using a single byte character set")
Borrows ideas from [ngn's ngn/k solution](https://codegolf.stackexchange.com/a/165668/43319). And then -6 thanks to him. Also -1 by returning [an enclosed list as like H.PWiz](https://codegolf.stackexchange.com/a/165655/43319).
Anonymous tacit prefix function.
```
⊂∩¨1,.↓(∪≢,/,⍨)¨
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT////1FX06OOlYdWGOroPWqbrPGoY9WjzkU6@jqPeldoHlrxP@1R24RHvX2P@qZ6@j/qaj603vhR20QgLzjIGUiGeHgG/09TUE9MykktLlEHMfKLQHR6UWpqHpDOLMoGksUlIAVABpguhjDyi8B0SSKISi0qAtFlqRVAsjK/VB0A "APL (Dyalog Unicode) – Try It Online")
`(`…`)¨` apply the following tacit function to each word:
 `,⍨` concatenate the word to itself
 `≢,/` all word-length sub-strings (i.e. all rotations)
`∪` unique elements of those rotations (to prevent words like `tata` for appearing twice)
`1,.↓` the concatenation of the drop-firsts (the original words) of each list
`⊂∩¨` intersection of the the content of that and the entire original word list
---
### Old solution
-2 thanks to ngn.
Anonymous prefix lambda.
```
{⍵/⍨2≤+/⍵∊⍨↑(∪≢,/,⍨)¨⍵}
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT///v/pR71b9R70rjB51LtEGMrY@6ugCch@1TdR41LHqUeciHX0dIF/z0AqgXO3/tEdtEx719j3qm@rp/6ir@dB6Y6BKIC84yBlIhnh4Bv9PU1BPTMpJLS5RBzHyi0B0elFqah6QzizKBpLFJSAFQAaYLoYw8ovAdEkiiEotKgLRZakVQLIyv1QdAA "APL (Dyalog Unicode) – Try It Online")
`{`…`}` function where `⍵` is the word list:
 `(`…`)¨` apply the following tacit function to each word:
  `,⍨` concatenate the word to itself
  `≢,/` all word-length sub-strings (i.e. all rotations)
  `∪` unique elements of those rotations (to prevent words like `tata` for appearing twice)
 `↑` mix the list of lists into a single matrix (pads with all-space strings)
 `⍵∊⍨` indicate which elements of the matrix are members of the original list
 `+/` sum the rows (counts occurrences of each of the original words)
 `2≤` indicate which have duplicates (i.e. occur other than when rotated back to original)
 `⍵/⍨` use that to filter the original list
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 8 bytes
```
ṙ1$ƬfḊɗƇ
```
[Try it online!](https://tio.run/##y0rNyan8///hzpmGKsfWpD3c0XVy@rH2/w93bzncHvn/f2JSTmpxCVdiUn5RCVd6UWpqHldmUTZXcQlIggtMFoOo/CIgWZLIVZJaVJTIVZZawVWZXwoA "Jelly – Try It Online")
### Alternate version, 7 bytes
```
ṙƬ1fḊʋƇ
```
Dyadic `Ƭ` used to do something weird, so this didn't work when the challenge was posted.
[Try it online!](https://tio.run/##y0rNyan8///hzpnH1himPdzRdar7WPv/h7u3HG6P/P8/MSkntbiEKzEpv6iEK70oNTWPK7Mom6u4BCTBBSaLQVR@EZAsSeQqSS0qSuQqS63gqswvBQA "Jelly – Try It Online")
### How it works
```
ṙƬ1fḊʋƇ  Main link. Argument: A (array of strings)
     ʋ   Vier; combine the 4 preceding links into a dyadic chain.
      Ƈ  Comb; for each string s in A, call the chain with left argument s and
         right argument A. Keep s iff the chain returned a truthy value.
 Ƭ           'Til; keep calling the link to the left, until the results are no
             longer unique. Return the array of unique results.
ṙ 1          Rotate the previous result (initially s) one unit to the left.
   f         Filter; keep only rotations that belong to A.
             s is a rotonym iff there are at least two rotations of s in A.
    Ḋ        Deque; remove the first string (s) of the result.
             The resulting array is non-empty / truthy iff s is a rotonym.
```
[Answer]
# [APL (Dyalog)](https://www.dyalog.com/), 20 bytes
Requires `⎕io←0`
```
⊂∩¨(,/(1↓∘∪⍳∘≢⌽¨⊂)¨)
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT///qG9qZv6jtgkG/x91NT3qWHlohYaOvobho7bJjzpmPOpY9ah3M4jRuehRz95DK4BqNA@t0PyfBtTxqLcPqNnT/1FX86H1xo/aJgJ5wUHOQDLEwzP4f5qCemJSTmpxiTqIkV8EotOLUlPzgHRmUTaQLC4BKQAywHQxhJFfBKZLEkFUalERiC5LrQCSlfml6gA "APL (Dyalog) – Try It Online")
`(1↓∘∪⍳∘≢⌽¨⊂)¨` gets the unique rotations (excluding the string itself) of each string in the dictionary
`≢` takes the length of a vector
`⍳∘≢` creates the range from 0 up to the length
`⌽` rotates a vector some number of times, e.g 2⌽'abort' -> 'ortab'
`⍳∘≢⌽¨⊂` will then give all the rotations of a vector
`∪` removes the duplicates
`1↓` removes the first element (the original string)
`,/` flattens all the rotations into one list
`⊂∩¨` takes the intersection of the dictionary with the rotations
[Answer]
# [Brachylog](https://github.com/JCumin/Brachylog), 26 bytes
```
g;?z{tWl⟧₆∋I;W↺₍R;W≠&h∋R}ˢ
```
[Try it online!](https://tio.run/##SypKTM6ozMlPN/r/P93avqq6JDzn0fzlj5raHnV0e1qHP2rb9aipNwjI6FyglgEUC6o9vej//2ilxKSc1OISJR0gI78IRKcXpabmAenMomwgWVwCUgBkgOliCCO/CEyXJIKo1KIiEF2WWgEkK/NLlWL/RwEA "Brachylog – Try It Online")
```
g;?z                          % Zip the whole input with each word in it respectively
    {                   }ˢ    % Apply this predicate to each pair in the zip
                              %   and select the successful values
     tW                       % Let the current word be W
       l⟧₆∋I                  % There exists a number I from 1 to length(W)-1
            ;W↺₍R             % And R is the result of circularly shifting the
                              %   current word I times
                 ;W≠          % And R is not the current word itself (needed for words like "tata")
                    &h∋R      % And R is one of the input dictionary words
                              % (R is implicitly the output of the predicate, and
                              %  successful R values are collected and output by the ˢ)
```
[Answer]
# [Python 2](https://docs.python.org/2/), ~~73~~ ~~69~~ 67 bytes
```
lambda d:[w for w in d if{w[i:]+w[:i]for i in range(len(w))}-{w}&d]
```
[Try it online!](https://tio.run/##JcrBDsIgEATQX9mTQNSLxyZ@Se2BhqVurNAsVGwavh2hXuZNMrNs8endrdj7o8z6PRoNpusTWM@QgBwYILunnrrhnPqOhjZQG1i7CeWMTial8nVP@WSGsjC5CFbuQo8zhigutXhuTozoqsSvmiG2Qy2H4V88H0bdQObmB781N7@KrMoP "Python 2 – Try It Online")
Takes a set of words (lowercase), and returns a list of rotonyms.
---
Saved
* -2 bytes, thanks to ovs
[Answer]
# [K (ngn/k)](https://github.com/ngn/k), 23 bytes
```
{x^x^,/1_'(,/|0 1_)\'x}
```
[Try it online!](https://tio.run/##5Vjpbtw2EP7vpxCMArGBFEn@2o@SkyvOSszyUClys9o0fXV3LkpaI32CAtbMN7zm4HDI9enPOMSXl@PTz8uXy5e37z58ffPw9t3f77sPXx8/vbn8eilPP83TfXf/6eH90/3945f7T/H@rus6@F3jHx/hn/x07Mzzt3R6fvh2NM4/m2d4zo@ff92Vj5/pezEHD3PpzCHl0g0ZIHYun7q5UEfHdCaWMtJiugI5m@4Ml25J9e5m9m/m3JnO0J@nzzmkAb9IINuzQUUEfiR/JJCiUNc3zhMJFWhAOivqxD9D38HCyLyy2DMRaGge8YWZi62BkCN9hOe@zooK8xPTgoP8hvyiWKcVDAnx6nW2MOtExfHIlBd0s4k9CIIsfAZLwDtoRgnU5X2K3BjYkTBBZ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HtFyJ8BCl3dgVGRnmmsWTTANYcQlOasKqCDhDJ8XqsfZH8WoYIwTQuOy6Y8lVhuekgKdVdp45MByoV4w46cyOUVyKviPdJX2S1ZBEufgdFqQpuj/u9MIedlNpiCQsKAW8O@FAQ15P4mkIzRnOioWRq1ufcb9rWNaj1iLeNBLc14GO83LQEevN4Kv1bW8oHdztqnkaISXZWm/D9NWEt2I2STVXczJDV4UZSXSlPY3OMscaIhRaisPSguyBw19zGRKFQVQ/O3iFVgbnVMkRwm40CGrXvY/GmW11DrLZMHrWp81oOG9pWIimuUKMnUN1gYYNpG93UzwZLD/6GIoe1RVbXg4JbAzkowk1SmxjDCnODuGNxuBFcDau4dWjQCO7COWPuCir0k6pXeFFTNDalaV5HpIPUSsYaB3xHNbPU1WtajQiGvQxMeJVAZRUp6wj0Ymt8bQAJCWOZQ0hWD6I2JJ8G7WPE4RLMBjJcBCy6nF/mFRWdLJbpw4GR2LcGK2y5xxB3wZTWsTREYdEx8u5g5LZlm2a@x7zCcfWvQD@@wuqRSvMmiFdNHf8e8a3tKppLukh3zRyEDHLxLFnZwgwNCMy4eJaRM@iKKUrarleMOv72upP/H4T2e7/ffli3X8nyQvu/Pqnu/gU "K (ngn/k) – Try It Online")
`{` `}` is a function with argument `x`
`0 1_` cuts a string at indices 0 and 1, e.g. `"abcd"` -> `(,"a";"bcd")`
`|` reverses the two slices: `("bcd";,"a")`
`,/` joins them: `"bcda"`
`(,/|0 1_)\` returns all rotations of a string
`(,/|0 1_)\'x` are the rotations of each string in `x`
`1_'` drops the first "rotation" of each, i.e. each trivial identity rotation
`,/` join
`x^y` is the list `x` without elements of the list `y`
`x^x^y` is the intersection of `x` and `y`
[Answer]
# JavaScript (Node.js), ~~105~~ 99 bytes
```
f=l=>l.filter(w=>[...Array(k=w.length)].map((x,i)=>(w+w).substr(i,k)).some(r=>l.includes(r)&&r!=w))
```
Ungolfed:
```
f = list =>
  list.filter( word =>
    // create a list of all rotonyms for the current word
    [ ...Array( len = word.length ) ]
      .map( (x,i) =>
         ( word+word ).substr(i, len)
      )
    // check if any of the rotonyms is in the initial dictionary/wordlist
     .some( rotonym =>
        list.includes( rotonym )
    // and is not the word itself
        && rotonym != word
     )
```
[Try it online!](https://tio.run/##bVdpjus2DL7KdH4UCfqaG8wDeo6iPxSLsfWixdWSjH35KTfZzqBATH7Uwk0U7fwyD1OG7Ob6Z0wWvr5uH/7jp7/cnK@QT8@Pn39fLpe/cjbL6f7xvHiIY53O/1yCmU@nzx/u/PHz9Pzjeb6Udi01n9yP@xmFFOCUSZGLg28Wyimff/89//bxPJ@/hhRL8nDxaTzdTu/mzdDP0@Mc0oBPJJDtw@Q7g2fyNwIpCnVD57yRUIUOZLK9mSv@DD1XCxPzxuLARKChfcQXZi72AUKO7BEuQyuKKvM704qL/I78oli31ZSZN6@7hVknJm43pqzQFRMHEARZeAFLwDvoTglU9T5FHgwcSJghsxitTBM3V7@NiTJB4ijjfT53FCCyT5xlZBXY7bli8KI7m3BNDBxP5TrlVDp2GLDJB9w95vkCQq0y8QVBhKILugOaiTI6ZpNQ3TltW6fD3sm/oL5i0@iMMI6s8CmW4sS7ioXmVnav9sxVpV1BFZeqxIpMvNG86IHXmpwAqbfa5GgeTD@d1MynExNskUqVaxWrBG9PEbQws87yEiOjxQnbuU5XUUxgECS5uMIitFSQpY5pqkLFTKqxee@4RFEok5sJZXg4yUKHnFMV5GBV4OA3fFgl4V9pZEjNp0DRWnbRGnLCQnYmKmBj2DN4AiORkyAU@1DtI@qAwMc2yp5YB2zBbTPqlcUER@F6fxVx2hWrPyL4peNE1yE7McADA1UNtxSVgS6MK/sA5t3t8yNgi9qtpomOJQM2i7B8G0wvY3Mq30yXIc3wIu2r65Qytqvdbts9epjxGHh6oL9SMbZxEyIWSwdVQGea8qbtjdYDNW2kWai2MhjAGj1YxS1smFzlywNupJvNhwV81uD5moIeAvIBdKDKfMBoJ46I8Z0B9n5dXzP3NUA/8N018rkCHxzlA2ZXpyWIjWyBi4HAw3FHRbipy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MHQjMuHnWiStoxRIla@uKWcf/Xu@XMuO34en97f18Pn/9Bw "JavaScript (Node.js) – Try It Online")
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 14 bytes
```
εDvDÀ})ÙåO<Ā}Ï
```
[Try it online!](https://tio.run/##MzBNTDJM/f//3FaXMpfDDbWah2ceXupvc6Sh9nD////R6olJOanFJeo6CkBWfhGYkV6UmpoHYmQWZYOo4hKQIhALzCiGsvKLIIySRDCdWlQEZpSlVoCoyvxS9VgA "05AB1E – Try It Online")
**Explanation**
```
ε           }    # apply to each word in the input
 Dv  }           # for each letter in the word
   DÀ            # copy the previous word and rotate it left
      )Ù         # wrap the rotations in a list and remove duplicates
        å        # check each rotation for presence in the input
         O       # sum presences
          <Ā     # decrement the sum and truthify it (check if 1 or greater)
             Ï   # filter, keep words in input that are true in the resulting list
```
[Answer]
# [PynTree](https://github.com/alexander-liao/pyn-tree), 44 bytes
```
§y:f#x0€[x/|Ḟz&⁻xzėzḞw+#x`wLx#x`0wRLxy]y#\x1
```
[Try it online!](https://tio.run/##K6jM0y0pSk39H@D8/9DySqs05QqDR01roiv0ax7umFel9qhxd0XVkelVQE65tnJFQrlPBZA0KA/yqaiMrVSOqTD87/q/Wj0xKSe1uERdB8jILwLR6UAz84B0ZlE2kCwuASkAMsB0MYSRXwSmSxJBVGpREYguS60AkpX5peq1/3WBDkvMKy7IzEm1BQA "PynTree – Try It Online")
This turned out to reveal a major flaw in the way PynTree constructs list comprehensions because it uses functions to assign variables so that assignment can go in expressions, but then the conditions end up not having the value of the variable until after it has been evaluated and the main block has been evaluated. This appears to be easily fixable but I did not notice this earlier and so this answer is hideously long.
Actually even if I fixed that I think it still might be terribly long.
[Answer]
# [Perl 6](https://perl6.org), 65 bytes
```
{@^a.grep:{@a∋any(($/=[.comb]).rotate,*.rotate...^*eq$/).join}}
```
[Try it](https://tio.run/##LYzBCoJAFEX37ytmEaESz52LQvA/IuFpr7B0xt6M0iDug/6yH5k02px74cDpWdosDJbVmGF9AOi82tbmzCoPU1ESXoX7/VTQ5/Um7aNok@ZHrE1XnWIU48jxLvkfRCwTfmzSGG@m0fMc0JJXFyNqLUZto9nGgaqWrQOqjDhY8qyhkTtYtwr40a5jZKEjcCxCMPITvBm@ "Perl 6 – Try It Online")
## Expanded:
```
{  # bare block lambda with placeholder parameter @a
  @^a     # declare and use placeholder parameter
  .grep:  # find the values that match
  {
    @a
    ∋            # Set contains operator
    any(         # create a junction of the following
      # generate a sequence
      (
        $/ =     # store into $/ (no declaration needed for this variable)
        [        # turn into an array instead of a one-time sequence
          .comb  # the input split into characters
        ]
      ).rotate,  # start the sequence on the first rotation
      *.rotate   # use this to generate the rest of the values in the sequence
      ...^       # keep generating values until: (and throw out last value)
      * eq $/    # one of them matches the cached array of the input
    ).join       # for each array in the junction join the strings (no spaces)
  }
}
```
[Answer]
# [Python 2](https://docs.python.org/2/), ~~66~~ ~~55~~ 70 bytes
```
lambda d:{w for w in d for v in d if v not in w not in v in w*2in v*3}
```
[Try it online!](https://tio.run/##NczBDsIgDAbgV@kNXTzNm4lv4gUCKHHCUupwWfbsaItc@n9Nm39e6ZHiWP31Vif9MlaDvWwFfEIoECJY4dIY/E8xEW@lQ25lGJnDea8zhkjgD5vSZnKZ1AmUltGm0aZnV0L5uqNzkRHwyZGJG1iC/FfCBpI@coiCxX041vRW@7F@AQ "Python 2 – Try It Online")
11 bytes thx to [Dennis](https://codegolf.stackexchange.com/users/12012/dennis) to use chained `x in y in z` approach.
Takes a set of words `d`; returns a set of Rotonyms.
[Answer]
# [PowerShell Core](https://github.com/PowerShell/PowerShell), 131 bytes
```
($t=$args|%{@{r=0..($l=($k=$_).Length-1)|%{-join$k[-$_..($l-$_)]}
w=$_}})|%{$u=$_
$t|?{$u.w-ne$_.w-and$u.w-in$_.r}|%{$_.w}}|sort|gu
```
[Try it online!](https://tio.run/##5Vhfb9w2DH/OfQojuK4J1hy6vQcL0NcBG5a9FUOhsxlbiWy5@nOJr7nP3vGfbF/QfY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NdfVavau@bS622NrSJ6z7D9UWXkb8@MCb@G21/bKauh/xtk2DZaC6iTx0WV2iWoCYHc3/tH2o7s4WbS4@/3n/KUd86v7YP6Lxf@7Q58U9Xmzog/R25fMGvlZXxRb/86t6X72/Ru2/i9dVBLv7vL/HC9zQXn38UP368br6ubrc7XYYz8VfJR61trk4bU6b7/8C "PowerShell Core – Try It Online")
For each word in the list, create generate a list of all its rotations
Then look for a matching rotation with a different original word
If it exists, keep the word.
Then sort and deduplicate them.
Sorting is required in PowerShell as `Get-Unique` only works on sorted lists.
[Answer]
# [Retina 0.8.2](https://github.com/m-ender/retina/wiki/The-Language/a950ad7d925ec9316e3e2fb2cf5d49fd15d23e3d), ~~71~~ 62 bytes
```
^(\w)(\w*)
$2$1!¶$&
%+)s`^(.+)(!.*¶\1)$
$2
O`
!`\b(.+)(?=¶\1!)
```
[Try it online!](https://tio.run/##HYlRCsIwFAT/9xaBKHktFOq/eAQvEEoSCFKUBl6eVS/WA/RiMenHzsIMR5kXX8pk7IfqOoK@6FHtmz7j1FN2kxl6Mmro9s2OpGvG3UE5G45wuzavqBQfXjELfEgseHCMC2Z@IksLOJjbJa4UD4nMHmv84pfefw "Retina 0.8.2 – Try It Online") Explanation:
```
%+)
```
Repeat for each word.
```
^(\w)(\w*)
$2$1!¶$&
```
Prepend the next rotation of the word with a trailing `!`.
```
s`^(.+)(!.*¶\1)$
$2
```
But if that's the original word, then delete it again.
```
O`
```
Sort the words.
```
!`\b(.+)(?=¶\1!)
```
Find the duplicates.
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 17 bytes
*Extremely* slow, but works. TIO times out, but I confirmed it works by manually lowering the number of iterations in the language source.
```
f@_XéZ ÀX©UøXéZ}a
f@                // Filter the input array by
  _            }a // generating up to 1e8 rotations of each string
   XéZ ÀX         // and checking if the rotation is different than the original,
         ©UøXéZ   // yet still exists in the input array.
```
[Try it online!](https://tio.run/##y0osKPn/P80hPuLwyiiFww0Rh1aGHt4B4tQm/v8frV5ckpiUk6quow6miyEM9VgA "Japt – Try It Online")
[Answer]
## Javascript, 129 Chars
```
f=a=>{n={};r=w=>w.slice(1,w.length)+w[0];a.map(w=>{m=r(w);while(m!=w){if(-~a.indexOf(m))n[m]=1;m=r(m);}});return Object.keys(n);}
```
## Ungolfed
```
f=a=>{
    n={};
    r=w=>w.slice(1,w.length)+w[0];
    a.map(w=>{
        m=r(w);
        while(m!=w){
            if(-~a.indexOf(m))n[m]=1;
            m=r(m);
        }
    });
    return Object.keys(n);
}
```
[Try it online!](https://tio.run/##JYpRrsIgEEW34uvXEJXoN8EtuICmH1inFYWhGVA0Td/W@8D3c89J7rmbl4k92yntKVxxXQdt9GkmPS@KddanLKOzPcJxl6VDGtNNbHN76JSR3kxQitlrhixUvlmH4H90FrMdYP9rpKUrvs8DeCGo9Z0@qtp6oZZFKMb0ZNqcL3fsk3zgJwKVZ@0DxeBQujDCAG1jLg5janZFAleOjEiFlh9lY6pBkS/jvwT@MpkKZK584bvsJzybTgi1/gE)
[Answer]
# [Java (JDK 10)](http://jdk.java.net/), 144 bytes
```
l->{for(var s:l){var r=s;for(int i=s.length();i-->1;){r=r.substring(1)+r.charAt(0);if(!r.equals(s)&l.contains(r)){System.out.println(s);i=0;}}}}
```
[Try it online!](https://tio.run/##bVA9b8IwEN35FVeGym6NBWtDIiHWdmKsOpjUCQbHTu/OqCjit1MnqFPr4d35vXcfuqM5m8Xx83RzXR@R4Zj/OrHz@qmY/eGaFGp2MfwrEqM13SjV3hDBm3EBhhlAn/be1UBsOIdzdJ/QZU3sGF1o3z/AYEtysgJsY6DUWVxvo/d2mra@G6sKGihvflENTURxNgj04uUwJlhSMZIuMLiStLeh5YOQhVssqlUhByxRU9rT1Ems5DPq@mBww2KZTY14QG2/kvEkSD56XcfAeUUSKOWwuxDbTsfEus/l7EM2Fa5cFtf8bsW09wSvjvh3W/BQwgbRXEgbGhUxN3tviZXZ58upFq0NyuFJ5ctkQU1IY4iYkY1im@vV2X6rS0xzTb13uYuaS3kf2mhT17Zn4SfiOrvefgA "Java (JDK 10) – Try It Online")
[Answer]
# [C# (.NET Core)](https://www.microsoft.com/net/core/platform), ~~100~~ 94 bytes
```
x=>x.Where(y=>y.Select((z,i)=>x.Where(c=>c!=y).Contains(y.Remove(0,i)+y.Remove(i))).Any(b=>b))
```
[Try it online!](https://tio.run/##dZJNT8MwDIbP7a8IOyViRNy7Vpr4lkBC7LBzmpktok3AScsK2m8v7lgBTUGqVPl9XsdObO3PtEPoG2/smi06H6DO0r@RvHBVBToYZ728AQto9JHj3ti3LE11pbxnj@jWqOr0M01em7IymvmgAv1aZ1bsQRnLRZoQTVqFLIAPlyooljML7@xW@c0CwswHpPMLLjLyjR45X634RJUVxZMocRgFawSwMWDwJSZTw1QkRvbA/0McxkFQUR0Qo6CFbUzuXPMt03fdWD07eqvp3ZVtasChw1ErGLrgBje975Dab/NiK5cbQOBdXnRyAcNsOf@YGvGLdF7ok7wTNHsbaGKed/IJatcCPyfj6U9khBBybjte5kUpRJ8k2WGwCL6pApUdO@DjdfaXeKalU3rDBys1y4w9ZNBuJAmV9a4CuUQTgLYLOHmGvF26678A "C# (.NET Core) – Try It Online")
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), 66 bytes
```
s=>s.filter(t=>s.some(u=>(t+t).match(u)&&t!=u&t.length==u.length))
```
[Try it online!](https://tio.run/##bVdpcus2DL5K@udNMp3mBnlnCS3CEl@4qCToRL58io2SnOmMBXwAFywEIfmPu7k21bDiP7l4@L6@fbe33@31GiJCfUbGrSR47m@/n/FvfHlNDqflub/8@oV/vfVf@Bohz7i8vXVDLy/fU8mtRHiNZX6@Pr@7J8e/yE8IRBM9mUH1N1c/BHyWeGVQstIwDS4LGSEMoIP9yV3o5/i5eFiEdxEnIQodr2O@CQt5KBgFtse4Tb0ZQuEfQpEmxQPFzbAtw1KF92irlfmgJq5XobJhaC5PoAiq8gaeQQwwnFJo28eSRZkkkLRCFTF7HWbuLnHX6WaK1FHBx3gdKEEWnyTLxBDE7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qCew2gtK3VVsAkqBdlPrG9aX9ucIbnB9cQVc70axIcBlko/DdrMcuFWsZxgcA8C/hBlR3qfTKi7FU9wiyeoRk0IZzydhZZOUhmbFWooDKK70IeChl401pKGM1YTAxXXq33O/Y9u34O1V3rbaHKHgj7G8UGT@Jsncus/dKVewuOsti6Qi56sqej7a6VecJqlh2p4uKG7w4NktkpdlxGYYMuRCCNFaZvATkHhST3mZKXQzQ6tPiEzQbU1KkTxWE0COXUeE/Fh2EIjbL6skaxZ8NYOBzp2Yinv0LKn0MIQ4YDlmD3MN0eth/5DccCm0d3totDRQE2G6JDMJ8GwwzognVieH4TQ0y4eA5Y0hqd0NqpdRch/qSaDX@aK5QaH5X1GuWivFGx5oO@o4ZaFei@7E8lJlEmI7JK4rRIVG4m/2AbfFaApEaxrGOnuSc2mQv9wbUyQpEuxOChwU7DZdnFrO0JbrJ7Zh4Mg9W9PVjpqTyCdgsMxsA3EabE5@t0hKBzbDsvyHosGlz0@hGn5gS0ik9ohaFTDnPwfiUN3V8tYvnS4V0lCBX3xbNXYJowcSMKkeeIiFXSnEmVr9ztlnf57vb@2lb4N35/eX16@/wM "JavaScript (Node.js) – Try It Online")
boring answer
[Answer]
# [Ruby](https://www.ruby-lang.org/), 81 bytes
```
->a{a.select{|w,*b|w.scan(/(?=.)/){b<<$'+$`}
b[1..].any?{_1!=w&&a.include?(_1)}}}
```
[Attempt This Online!](https://ato.pxeger.com/run?1=bVjJktxEEL1z4hOGCGNswOPwjYONb75x4OxwmJIqu1WeWkQtPaMez5dwcRDwUfA15FaSeoKIUebLWnKrrJR6_vgrt2H58ue7N3-3enjx0z-_vvjZ3JvrAh7Gev_59sfvh8-312U08dnLZ2_fXD9_-fx-eP36yXc_PPnt4avh_avr6w_XJi5v7z---ubN7dOn5trF0TcLb599fPX84eFBFP_79S_z1bv3396-N1eG_jw9ziEN-EQC2Z5MvmFwm_yBQIpC3dg5byRUoQOZbFdmwD9Dz2BhYt5YHJkINLSP-MLMxT5AyJE9w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q22I-W-tXwCb8mbM1q9NfHsjuQOhskfRgjika_uijjlm1BJqFU2VW5qcQfJqeVomFjslngpFdJ5IcKPIOXOrsDIKs801mw6wJ5DaE4zdlXQBSI51sfWF6mv5RghmM7lxAVTvSqsFxMkpbab1JVpoFYx7aAzF0J9JLJGfJ-MVbQli3DxOyhGVXB7PO6FEnZS6soSNhQC3gz4oSChJ4k1he6M1kRHybSsn3P_M7bqoNEDvm0kuX0AP8brxUigbx5PrX8bS3lwl6vKPEFMcrI6hN9fM_aC3So5VMXdDdEOF5LaSnmeemCMNUcs9BSFZQQ9BYG74b4mCoWmdnD3DqkJrK1eIYL7bhTQqf0cixfTGhpi9WX2aE2D13bY0aaJpLhCzZ5ADYOFDaZtdTdfDLYe_A1FAeuIaNeLgkcDOSjCQ1KfGMMKc4d4YvF4IbgWVnGb0KQR3KWzYO0KqvSTalR4p65obmq3vK5Ig_RKxpoH_I7qbmmo57Q6EQxHGZiwlkBtFSnbCPTF1vk6AJISxrKHkGgPYjYkn446x4jTJZgdZLgIWFSdX8qKqm4Wz_TDgZH4tyYrbLXHEE_B1D6xdERp0TXy3cHIbWq7ZX6PeYXTGl-FcXqENSKVyiZIVN0c_x7xfewslmu6k-mWOQkZ5MWzZGULM3QgMOPmWSeuoDOWKFk7nzHr-Nvrwwf5r8KXL8L_Aw)
[Answer]
# [Japt](https://github.com/ETHproductions/japt) [`-f`](https://codegolf.meta.stackexchange.com/a/14339/), 9 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
```
¬£éYÃøWkU
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&flags=LWY&code=rKPpWcP4V2tV&input=WyJhYmxlc3QiLCJhYm9ydCIsImdyZWVuIiwiaXJrIiwic3RhYmxlIiwidGFibGVzIiwidGFib3IiLCJ0YXRhIiwidGVycmEiLCJ2ZXgiLCJ5b3UiXQ)
```
¬£éYÃøWkU     :Implicit filter of each string U in input array W
¬             :Split
 £            :Map each element at 0-based index Y
  éY          :  Rotate U right Y times
    Ã         :End map
     ø        :Does that contain any element of
      WkU     :  W with U removed
```
]


[Question]
      [
# Problem
Let's define a generalized [Cantor set](https://en.wikipedia.org/wiki/Cantor_set) by iteratively deleting some rational length segments from the middle of all intervals that haven't yet been deleted, starting from a single continuous interval.
Given the relative lengths of segments to delete or not, and the number of iterations to do, the problem is to write a [program or function](https://codegolf.meta.stackexchange.com/a/2422/60340) that outputs the relative lengths of the segments that have or have not been deleted after `n` iterations.
[![Example 3,1,1,1,2](https://i.stack.imgur.com/L1tVT.png)](https://i.stack.imgur.com/L1tVT.png)
Example: Iteratively delete the 4th and 6th eighth
# Input:
`n` – number of iterations, indexed starting from 0 or 1
`l` – list of segment lengths as positive integers with `gcd(l)=1` and odd length, representing the relative lengths of the parts that either stay as they are or get deleted, starting from a segment that doesn't get deleted. Since the list length is odd, the first and last segments never get deleted.
For example for the regular Cantor set this would be [1,1,1] for one third that stays, one third that gets deleted and again one third that doesn't.
# Output:
Integer list `o`, `gcd(o)=1`, of relative segment lengths in the `n`th iteration when the segments that weren't deleted in the previous iteration are replaced by a scaled down copy of the list `l`. The first iteration is just `[1]`. You can use any unambiguous [output](https://codegolf.meta.stackexchange.com/q/2447/60340) method, even unary.
# Examples
```
n=0, l=[3,1,1,1,2] →                 [1]
n=1, l=[3,1,1,1,2] →     [3,    1,    1,    1,    2]
n=2, l=[3,1,1,1,2] → [9,3,3,3,6,8,3,1,1,1,2,8,6,2,2,2,4]
n=3, l=[5,2,3]     → [125,50,75,100,75,30,45,200,75,30,45,60,45,18,27]
n=3, l=[1,1,1]     → [1,1,1,3,1,1,1,9,1,1,1,3,1,1,1]
```
You can assume the input is valid. This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so the shortest program measured in bytes wins.

[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~15 13~~ 12 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
-2 thanks to Dennis (using a Link rather than a chain allows right to be used implicitly by `¡`; No need to wrap the `1` in a list due to the fact that Jelly prints lists of one item the same as the item)
-1 thanks to Erik the Outgolfer (use `Ɗ` to save the newline from using `Ç`)
```
1×€³§JḤ$¦ẎƊ¡
```
A full program printing a list in Jelly format (so `[1]` is printed as `1`)
**[Try it online!](https://tio.run/##ASwA0/9qZWxsef//w5figqzCs8KnSuG4pCTCpuG6jgoxw4fCof///1s1LDIsM13/Mw "Jelly – Try It Online")**
### How?
```
1×€³§JḤ$¦ẎƊ¡ - Main link: segmentLengths; iterations
1            - literal 1 (start with a single segment of length 1)
           ¡ - repeat...
             - ...times: implicitly use chain's right argument, iterations
          Ɗ  - ...do: last 3 links as a monad (with 1 then the previous output):
   ³         - (1) program's 3rd argument = segmentLengths
 ×€          -  1  multiply €ach (e.g. [1,2,3] ×€ [1,2,1] = [[1,4,3],[2,4,2],[3,6,3]])
        ¦    -  2  sparse application...
       $     - (2) ...to: indices: last two links as a monad:
     J       - (2)          range of length = [1,2,3,...,numberOfLists]
      Ḥ      - (2)          double            [2,4,6,...] (note: out-of bounds are ignored by ¦)
    §        - (2) ...of: sum each (i.e. total the now split empty spaces)
         Ẏ   -  3  tighten (e.g. [[1,2,3],4,[5,6,7]] -> [1,2,3,4,5,6,7])
             - implicit print
```
[Answer]
# [Python 2](https://docs.python.org/2/), ~~120~~ ~~107~~ ~~104~~ ~~103~~ ~~100~~ ~~99~~ 89 bytes
```
f=lambda n,l:n and[x*y for i,x in enumerate(l)for y in[f(n-1,l),[sum(l)**~-n]][i%2]]or[1]
```
[Try it online!](https://tio.run/##bU7bCoMwDH3fVxTGQCVCL/M22JeUPnSoTNAoTkFf9uuuFpw618BJcnKS02bsnjXyacrvpa4eqSYI5Q2JxlQO3kjyuiUFDKRAkmFfZa3uMqd0Z3o0pMwd9BmULshXX5mB5719VEoWF65U3UqmpqYtsCO5Q0EKYDa4cs/k8Iz4tIjZP7Gh5sQOyNdF/rsoExA2QojhOzJ1aHCO67osQAaGEasj4wEEFKIAGLVJULgazbYJLbIYeLQ7Za02p6zz8oMEdr2aPg "Python 2 – Try It Online")
---
Saved
* -10 bytes, thanks to Neil
[Answer]
# [R](https://www.r-project.org/), 94 bytes
```
f=function(n,a)"if"(n,unlist(Map(function(g,i)g(i),c(c,sum),split(m<-a%o%f(n-1,a),row(m)))),1)
```
[Try it online!](https://tio.run/##ZYwxCsMwDEX3HiMQkECB2qZbe4QewhgUBLEcYpse3xUZskR/0X9P6BiDP9w1NSkKShEn4cmWrpvUBt@4w6VXElxBkBIkqj0j1X2TBvm9xLnMDLo4@0BH@UFGG3I4GJ52H8id8YgPBncj/kaCkRd5Clc7LeL4Aw "R – Try It Online")
[Answer]
# [Haskell](https://www.haskell.org/), ~~76~~ 58 bytes
```
l%0=[1]
l%n=do(x,m)<-l%(n-1)`zip`cycle[l,[sum l]];map(*x)m
```
[Try it online!](https://tio.run/##TYpBCsIwEEX3OcUsDCSSQtPgyuYInmAINLQFg5M0WIXq5WPNQuRv3n@8q19vM1EpxFuL2jHiyU6L2FSUfUNcpEbL4R3yML5GmpEUrs8I5Nw5@iyOm4wl@pDAwrQw2N0F8j2kBxy@BwQapes6xyVgW4n9GjypThnHzZ@q/a7KBw "Haskell – Try It Online")
The function `(%)` takes the list of line lengths `l` as first argument and the number of iterations `n` as second input.
*Thanks to Angs and Ørjan Johansen for -18 bytes!*
[Answer]
## JavaScript (Firefox 42-57), 80 bytes
```
f=(n,l,i=0)=>n--?[for(x of l)for(y of(i^=1)?f(n,l):[eval(l.join`+`)**n])x*y]:[1]
```
Needs those specific versions because it uses both array comprehensions and exponentiation.
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), 71 bytes
```
l=>f=(n,c=1,e)=>n--?''+l.map(_=>(e=!e)?f(n,c*_):eval(l.join`+`)**n*c):c
```
[Try it online!](https://tio.run/##HcrBDoIwDADQu3/hiXZsS8AbpuPGTxgDyywGUjsiht@f0bzrW@MR9/Reto/T/OAyUBEKM4HaRI1lpKDO9VVVi3/FDUYKwHRm7OdfMSN2fEQB8WtedKonNEZNwi6V6yll3bOwl/yEAW4X2/y1d4QWsXwB "JavaScript (Node.js) – Try It Online")
[Answer]
# Java 10, 261 bytes
```
L->n->{if(n<1){L.clear();L.add(1);}else if(n>1){var C=new java.util.ArrayList<Integer>(L);for(int l=C.size(),i,x,t,s;n-->1;)for(i=x=0;i<L.size();){t=L.remove(i);if(i%2<1)for(;i%-~l<l;)L.add(i,C.get((i++-x)%l)*t);else{x++;s=0;for(int c:C)s+=c;L.add(i++,t*s);}}}}
```
Modifies the input-List instead of returning a new one to save bytes.
[Try it online.](https://tio.run/##xVPBitswEL33K3QJaNayWCf0UtmGYigU3NMeSw@qI4dJFdlI4zSpSX89lb3ebim7e@lCJR3E6OnN07zRXh91ut9@uzZWh8A@aXTjG8YCacKG7eOpHAitbAfXEHZOflg2@ePZe@/1ucZA@UdHZmd8KZ66WXUuDAfjf6NK1rLiWqelS8sRW@7yDMZaNtZoz0HVUm@3PAN1MTYYNgHKCDhqz6rCme/sJQW8BtV2nqMjZotKBvxhOAgUJ0EiKJemZaZgRhSn4lZhXi8YBSMVtfTm0B0NR1AxMa7WUduEVrhKf9rcKriXh6KSO0OcY5KkJ1hZuCFQk@DxlCQqROoHGc27CkJSNMvD4gVBNyE@L46rikWPqx@@2lj3pfzHDrfsEC3hd@TR7T5/YRomexgjE4jfCvZMHfhfsSB1mOMbkc1zDQDqkSl7Nab1qzFt/ifTW7EWm39mmdUsLJd7h/@0dqadWsOJF5uZ1YvrrdR9b8@xuaVuGtMTd4vCu3Mgc5DdQLKPrULWTT9gTnu5/gI)
```
L->n->{                       // Method with List and integer parameters and no return-type
  if(n<1){                    //  If `n` is 0:
    L.clear();                //   Remove everything from the List
    L.add(1);}                //   And only add a single 1
                              //  Else-if `n` is 1: Leave the List as is
  else if(n>1){               //  Else-if `n` is 2 or larger:
    var C=new java.util.ArrayList<Integer>(L);
                              //   Create a copy of the input-List
    for(int l=C.size(),       //   Set `l` to the size of the input-List
        i,x,t,s;              //   Index and temp integers
        n-->1;)               //   Loop `n-1` times:
      for(i=x=0;              //    Reset `x` to 0
          i<L.size();){       //    Inner loop `i` over the input-List
        t=L.remove(i);        //     Remove the current item, saving its value in `t`
        if(i%2<1)             //     If the current iteration is even:
          for(;i%-~l<l;)      //      Loop over the copy-List
            L.add(i,C.get((i++-x)%l)*t);
                              //       And add the values multiplied by `t`
                              //       at index `i` to the List `L`
        else{                 //     Else (the current iteration is odd):
          x++;                //      Increase `x` by 1
          s=0;for(int c:C)s+=c;
                              //      Calculate the sum of the copy-List
          L.add(i++,t*s);}}}} //      Add this sum multiplied by `t`
                              //      at index `i` to the List `L`
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 13 bytes
```
Ø1××S¥ƭ€³Ẏ$¡Ṗ
```
[Try it online!](https://tio.run/##AS8A0P9qZWxsef//w5gxw5fDl1PCpcat4oKswrPhuo4kwqHhuZb///9bNSwgMiwgM13/Mw "Jelly – Try It Online")
Full program. Outputs `1` instead of `[1]`. Annoyingly, `ḋ` doesn't work like `×S¥` in this context, and `ƭ` doesn't work well with nilads. >\_<
[Answer]
# [APL (Dyalog Classic)](https://www.dyalog.com/), 20 bytes
```
{(∊⊢×⍵(+/⍵)⍴⍨≢)⍣⍺,1}
```
[Try it online!](https://tio.run/##VU07DoJQEOw5xXZAhMjjj7chGAyRBAM0xlBpjGBI7KzFxgNoQ@tN9iLPBX/wJpmd2Z3d569idb7242ShBrGfZVHAeYj700bCQ4VV8zxj/ZAmU2IZ6zvWNywbUlesW4UVnOddmKZYXlKSWG1DCrczMVmKeNyJoR/FIjUokhaCJhnAeuhyrjCBDT38tKCP@h5NOtjg/jOkbeIOpmBIFlUD6FGe6RZYGjgWMK0vhgYmBYbG7pm5oDu0/b752e7x/ccb@xc "APL (Dyalog Classic) – Try It Online")
[Answer]
# [K (ngn/k)](https://gitlab.com/n9n/k), 27 bytes
```
{x{,/y*(#y)#x}[(y;+/y)]/,1}
```
[Try it online!](https://tio.run/##VU3LCoMwELz3KxbsQVuLWWN87aeEgL1YimJBPBiD/fU0RhDLwOzMLLPbPYbXYG1bm9nEib6FgY6CeZWhpnuiI5XEuFo71eYql@9Yt3Imraj5dBQ27fPdk/O00Bip9TJJRhzQI6UYlUvwlBxqW5wsVcA9cijhSJ3OHW/ItgIn4SQnTAUIBoUAZH5wBplbnU3uGUtIi73qb@58fKjgz6sf "K (ngn/k) – Try It Online")
`{` `}` is a function with arguments `x` and `y`
`(y;+/y)` a pair of `y` and its sum
`{` `}[(y;+/y)]` projection (aka currying or partial application) of a dyadic function with one argument. `x` will be `(y;+/y)` and `y` will be the argument when applied.
`,1` singleton list containing 1
`x{` `}[` `]/` apply the projection `x` times
`(#y)#x` reshape to the length of the current result, i.e. alternate between the outer `y` and its sum
`y*` multiply each element of the above with the corresponding element of the current result
`,/` concatenate
[Answer]
# [Ruby](https://www.ruby-lang.org/), 73 bytes
```
->a,l{r=[1];a.times{s=p;r=r.flat_map{|x|(s=!s)?l.map{|y|x*y}:x*l.sum}};r}
```
[Try it online!](https://tio.run/##ZcnBCgIhFIXhfU9Ru2m4SSptEpsHEQmDhEBBrjOgqM9u5KbFcFb/d3B75W5lvzwMuIJSUS0MWT/@HUuUQaBEYp1Zn96EUlOdojzF8@LI6FzTnNs9zY7EzbcmsPVwtOoKigMdY1offkT3xPbEQd2AAf/n@LXuXw "Ruby – Try It Online")
[Answer]
# [Pyth](https://github.com/isaacg1/pyth), 20 bytes
```
us.e?%k2*bsQ*LbQGE]1
```
Input is segment array `l`, then iterations `n`. Try it online [here](https://pyth.herokuapp.com/?code=us.e%3F%25k2%2AbsQ%2ALbQGE%5D1&input=%5B3%2C1%2C1%2C1%2C2%5D%0A2&debug=0), or verify all the test cases at once [here](https://pyth.herokuapp.com/?code=us.e%3F%25k2%2AbsQ%2ALbQGE%5D1&test_suite=1&test_suite_input=%5B3%2C1%2C1%2C1%2C2%5D%0A0%0A%5B3%2C1%2C1%2C1%2C2%5D%0A1%0A%5B3%2C1%2C1%2C1%2C2%5D%0A2%0A%5B5%2C2%2C3%5D%0A3%0A%5B1%2C1%2C1%5D%0A3&debug=0&input_size=2).
```
us.e?%k2*bsQ*LbQGE]1   Implicit, Q=1st arg (segment array), E=2nd arg (iterations)
u                E     Execute E times, with current value G...
                  ]1   ... and initial value [1]:
  .e            G        Map G, with element b and index k:
        *bsQ               Multiply b and the sum of Q {A}
            *LbQ           Multiply each value of Q by b {B}
    ?%k2                   If k is odd, yield {A}, otherwise yield {B}
 s                       Flatten the resulting nested array
```
]