[Question]
  [
Given a string which is guaranteed to be either `odd`, `even`, `square`, `cube`, `prime` or `composite`, your program or function must return an integer \$100\le N\le 999\$ which meets this description.
## Rules
* Your code must be deterministic.
* The choice of the integers is up to you. However, the six answers **must be distinct**. (For instance, if you return \$113\$ for *odd*, you cannot return \$113\$ for *prime*.)
* You may take the input string in full lower case (`odd`), full upper case (`ODD`) or title case (`Odd`) but it must be consistent.
* This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'").
## Example
Below is an example of valid I/O:
* odd → \$501\$
* even → \$140\$
* square → \$961\$ (\$=31^2\$)
* cube → \$343\$ (\$=7^3\$)
* prime → \$113\$
* composite → \$999\$ (\$=37\times 3\times 3\times 3\$)
## Brownie points
For what it's worth, my own solution in JS is currently 24 bytes. So, brownie points for beating that.
**JavaScript (ES6), 24 bytes**
```
MD5: 562703afc8428c7b0a2c271ee7c22aff
```
***Edit**: I can now unveil it since it was [found by tsh](https://codegolf.stackexchange.com/a/230397/58563) (just with a different parameter name):*
> 
>  
> ```
> s=>parseInt(s,30)%65+204
> ```
> 
> 
> 
> 
  
[Answer]
# [Python 2](https://docs.python.org/2/), ~~25~~ 22 bytes
```
lambda s:hash(s)%591^1
```
[Try it online!](https://tio.run/##K6gsycjPM/qfZhvzPycxNyklUaHYKiOxOEOjWFPV1NIwzvB/Wn6RQnl@UYpCZp5CtLq/i4u6joK6a5irH4gODgx1DHIFsZxDncB0QJCnL0TA3zfAP9gzxFU91opLQaGgKDOvREFdVdfQoFhB105BNUVdQVVBA2SyjkIamNbU/A8A "Python 2 – Try It Online")
Takes input in upper case and returns the following numbers:
```
ODD        -> 263
EVEN       -> 554
SQUARE     -> 121
CUBE       -> 512
PRIME      -> 349
COMPOSITE  -> 371
```
Generated with this script which searches for formulas following `hash(s)%x?y`, where `?` is any binary operator:
```
from sympy import primerange
# from tqdm.notebook import tqdm
hashes = [
    3275334880723988284, -8482906173967949472, -4710393751006474557,
    1654718638908055491, -6487253012923789248, 8925015453505786600
]
dyads = {
    int.__mul__, int.__mod__, int.__add__,
    int.__sub__, int.__rshift__, int.__lshift__,
    int.__xor__, int.__or__, int.__and__,
    int.__pow__, int.__floordiv__
}
primes = set(primerange(100, 1000))
squares = {x**2 for x in range(10, 32)}
cubes = {x**3 for x in range(5, 10)}
# for x in tqdm(range(6, 1000)):
for x in range(6, 1000):
    for y in range(1, 100):
        for z in dyads:
            a, b, c, d, e, f = r = [z(h%x, y) for h in hashes]
            if (
                len(set(r)) == 6
                and min(r) > 99
                and max(r) < 1000
                and a%2 == 1
                and b%2 == 0
                and c in squares
                and d in cubes
                and e in primes
                and f not in primes
            ):
                print(x, y, z)
```
[Try it online!](https://tio.run/##dZPtbpswFIb/@yqONFWCyquMP7AdLbuRqUIkwEALmBqyhVS99sx2ykhT5h/AOc97jj9e009jbTp2uVTWtDBMbT9B0/bGjtDbpi1t3v0sEfoCgY8vRfvUmbHcGfNr1vkkQnU@1OUAW/iBwA1GpWCMK0UkZVopqjiGr4orqkmaSKZTqbnmkroslwlhmkmREJJyyYWQODRJUuGYSpnSRBEhuE6cPOVKUsFIQjVlUmnKFQb3EiQRXDBBhFRpSgh6RqiY8sIv6jX0a7rxKcva4yHL8ByYYgnywgc30uG4W6gd6qYal/gwxzcFJ2MXwe133t217s2fhVYHY2zR/M4y9IZQOHi/6qEco8WFyB0PBvcgcYyGl2Nug@j19PhIoTIWTq4bzFLsLIjf0P64@6di9yrh2zmRt3cm3s3oitN5tg26K5zJJmzIw@lm7gDf2czPngc3lrwfOYYdhj2GAkOJoXJLtf4SnaP64YRhikN17auvN@z5Q3lTQfQh4ceh7CJ/dDaOYbuF9JPAmQFt0zkBfAet13l@8vxb2OiqIn@gvn2yCndXuF6599t5d3BVUHhBsG4Vlx5fb8kqr8D9o//RxJtPJU7VjZE/bQzn@HL5Cw "Python 3 – Try It Online")
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), 29 bytes
```
n=>121+'qvdou r'.search(n[1])
```
[Try it online!](https://tio.run/##JYyxDsIgFEX3fgUbJSoJrg3d/IqmA8JDMZRHobAYvx1rnc45d7gvVVXWycXtEtBAs7IFOYqrONG1GiwkUZ5BJf3swyRm1oZuomgMPRMak1vgJxqXiNlt/yj3g3ktKh0GFQKducV0U/sPeCJH8u40howeuMdHb/eVsaH7sPYF "JavaScript (Node.js) – Try It Online")
## How?
I found six numbers which were close to 121, then simply placed them strategically.
And also thanks to Arnauld for reminding me of the `search` method.
[Answer]
# [Brachylog](https://github.com/JCumin/Brachylog), 10 bytes
Takes in the input in full upper case. Sum of the character code points times 415 mod 998. A sum-less version would multiply the second element with 493, modulo 583.
```
ạ+×₄₁₅%₉₉₈
```
[Try it online!](https://tio.run/##SypKTM6ozMlPN/r//@GuhdqHpz9qannU1PioqVX1UVMnGHX8/6/kHOrkqvQ/AgA "Brachylog – Try It Online")
```
┌───┬────┬──────┬────┬─────┬─────────┐
│ODD│EVEN│SQUARE│CUBE│PRIME│COMPOSITE│
├───┼────┼──────┼────┼─────┼─────────┤
│403│580 │361   │343 │431  │339      │
└───┴────┴──────┴────┴─────┴─────────┘
```
Found with this crude J script, typing in the operations manually:
```
NB. returns 1 iff correct solution
test_f =: =@i.@# ([ -: *) [: (1 = 2&|)`(0 = 2&|)`((= <.)@%:)`(3 (= <.)@%: ])`(1&p:)`(1 < #@q:)`:0 [:(**/@~:)  (* <&1000 * >&99)"0
NB. try some variants
vars =: ,/ (a=:i.1000)|/ (b=:i.1000)*/ (1#.3&u:)&> ODD`EVEN`SQUARE`CUBE`PRIME`COMPOSITE
NB. show valid solutions
(((,/a,"0/b),.&<"1 [) #~ (test_f :: 0)"1) vars
```
[Answer]
# [Python 3](https://docs.python.org/3/), ~~22~~ 21 bytes
```
lambda x:628*x[2]%831
```
[Try it online!](https://tio.run/##K6gsycjPM/6fZhvzPycxNyklUaHCyszIQqsi2ihW1cLY8H9afpFCsUJmnkKSur@Li4JrmKufQnBgqGOQq4JzqJOrQkCQpy@Q6e8b4B/sGeKqrldckJNZoqFpxaUABAVFmXklGsV6KanJ@SmpGpo6Ckq2dko6CmkaxZqa/wE "Python 3 – Try It Online")
Takes input in uppercase as a byte string. Takes the penultimate character's code, and applies some hashing to get:
```
ODD => 323
EVEN => 120
SQUARE => 196
CUBE => 729
PRIME => 139
COMPOSITE => 158
```
Found using this brute-force program:
[Try it online!](https://tio.run/##pZVLbxoxFEb3/AqLKhJU02rGbyOxaBMWWaSkoemGsiAwKSOFRxho1SB@O51jCFHVR6RmFleee@3j77PvwOLHajKfqd3u8ur8otMTbbHJ0iwRWaoIjhCqkPEqeVVUVRxR0ARDzpCzzLOMHCNH1VMNMZALVENVkFmVk1IRHIGc4hWy1FRNDFQhS0vBkXPkIEtPAbJCrgKqkKsyXpGrkKt0DBVAGaqGEUoVShVKFSjlGSFScxAa@zojSF5VDIpATjMCqhGpLVWUasgaqPaMsK8xbThYA9TAM9g3WDXoM1AMAINVg1WDVQPF4NJAsUiz@LVYtVkcUUCf1TFQAGrxa/Fr0Wfxa4Fa/FqkuTSGaoqD4rgPh0uHSwfKcRUOfQ6KQ58D5ZDmODAPwHMBXsagCBS4Wg/Ko8VD8QjyWPVo8dylR5CHF/AWQAUEBQCBawx4C9gKoALnHDimACUACDgKwW1rvY/X7672XS2NhZrSspprTTl8PHhNE3E6ztK88VrjubPCxr6tRkpW8zwFFxtVGr6NlAvWdBInK822dnr9/vAdMUNmLOX8TCbj0m2tdjtfip4oZqJfE9VzUx@tb3JR3q@Hy1wslsU0F6P5dDEvi1Uu5uOxyL/ls/rbcnFXrBrN5LCIjcTeoYhfrzjtXlx2e@efOqJ7diY6nzsffl/ETr39Tpdxp9PjTt1qp86vOw1acR2CiyiYDy4Rb@SgJcQrsZrkVXacj/JSfJ8Uo0mlfj5ej3KxnhX361x8G96t8zIyePCZHIwme6fJk9UEr0k0W51f/6FfDOLOD@zcGxwp5Epyy@Hsa96Iv1Zp2mwdJzxOmj436fEpbsWXPxZ4GqV4HW/hREybVZD/mDucjZ8jRXtHVLst0v/mgYutc7K3um@9l9AOPXjgPX4@LyHu2/kAPPzJvMjvsV1hzuarJ27rrwt5KiGzVeO2XrQ3xVaU7U25FdP2ZroVo2GZtze9fjrY1pu73U8 "Python 3 – Try It Online")
PS: I retract my downvote. Writing and optimising various brute-force programs was actually quite fun. (I don't think it's great to have too many challenges like this, though)
[Answer]
# [Rattle](https://github.com/DRH001/Rattle), ~~21, 20~~ 18 bytes
```
|Ig1n+8s%7[3g+5s]g
```
[Try it Online!](https://www.drh001.com/rattle/?flags=&code=%7CIg1n%2B8s%257%5B3g%2B5s%5Dg&inputs=square)
This is my first ever answer with my own interpreter running on my own website!!!
# Outputs
```
odd: 113
even: 126
square: 121
cube: 125
prime: 127
composite: 119
```
# Explanation
```
|                 takes the user's input as a string
 I                splits this string into characters and stores them in consecutive memory 
                    slots
  g1              gets the character at index 1 (2nd character, Rattle is 0-indexed)
    n             converts this character to its ASCII code (int value)
     +8           adds 8 to this value
       s          saves this value to memory at the current pointer
   %7             takes mod(7) of the value on top of the stack. This gives three for
                    inputs of "prime" and "odd" (which are special cases)
     [3 .... ]    if the value on top of the stack is three, the code in this if statement 
                    executes
        g         gets the value from memory at the pointer
         +5       adds five to this value to fix the special cases
           s      saves the result to memory  
              g   gets the value saved in memory, prints implicitly
  
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~8~~ 7 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
-1 thanks to [the default.](https://codegolf.stackexchange.com/users/36445/the-default) (looked for shorter salt/domain combinations with domains other than the one byte `1000` I'd considered and the different case formats allowed in the OP.)
```
91,651ḥ
```
A monadic Link accepting a list of characters that yields an integer:
```
input      output   (notes)
odd        897
even       516
square     625      (25²)
cube       125      (5³)
prime      347
composite  752      (2⁴×47)
```
**[Try it online!](https://tio.run/##y0rNyan8//9Rw5xDix7u6H24o@tRw0ydE9sf7lj6/3D7o6Y1//9Hq@enpKjrKKinlqXmgejiwtLEolQQK7k0CUwXFGXmQgTycwvyizNLUtVjAQ "Jelly – Try It Online")**
### How?
```
91,651ḥ - Link: list of characters, S
  ,   ḥ - hash (S) using...
91      - ... salt: literal = 91
   651  - ... domain: literal 651 (i.e. a domain of [1..651])
```
The salt for the 8 byte version, using a domain of `[1..1000]` and only the lower-case version of the inputs, was found using this Python code ([Try it online!](https://tio.run/##lVTbjpswEH33V4yQKtlZNgICJF0p@yNRhMhigrVgUtukjap@e@oLyy0Pq/gFPHPOmStcbqpq@eZ@Z82lFQqqXFY1OyFUirYBeWsuN@hdTF4EayhCqKAlNDnjmLwh0KctCgl7kFRhkfMzxWEQ@hAGQeBDRIjF0CvlS1CwBNkAXyhn@mh1dMnUwly2AjgwDgutPiNzWPmVMuYT8xhnnReFdg0eWks6x43Bp1j5q8uFzecvh9UKosdsfNhE5J8roDtNsJslNtF5hz30mtedxR483VLPB890zTxdSPNm5MzTlmANXzl6RytStGY0WU35WVVay3TFNTcXyooPJR5mxTKu1mbq2emmC8Yznzn9aqxllX/SLEpSLOhF4JpJha@ErCn/aAuKvU6VrztPGwp2ptqXhBE5MHgDBi@wO/oPwl7NlKp1MTMPmd1M19jYNd1gLevDbkQd0RR7NVjXTzR6ZV4r0xJ7@V2xmkI4W5h51VXJse2ab5n@vLd6xsREsQOe8XJefMuNLLdfpafZsWW7NX6anLi0h91@WiC0AvaLfpobWK75YwzUx4@TK2xH9apDzXwnQfPPwWIxL2ae7p/0XWy7DxnjBf3TxxRUdYJPxi67Zr4D2GXy/g6M6HzGm17mkBBYue/qMNE@HthxubBpPBYyvv2AcBfH6TaOg@1mG/xMkjAN08G9mhcw2HX4NEZOCiG9tlnG84ZmGez34GWZ5WSeK9H9qNH9/h8 "Python 3 – Try It Online")); it can easily be modified to search other domains and to go through the three allowed case formats:
```
import hashlib
from sympy import isprime
def main():
    odds = set(range(101, 1000, 2))
    evens = set(range(100, 1000, 2))
    primes = set()
    composites = set()
    for n in range(100, 1000):
        if isprime(n):
            primes.add(n)
        else:
            composites.add(n)
    squares = {n ** 2 for n in range(10, 32)}
    cubes = {n ** 3 for n in range(5, 11)}
    values = ["odd", "even", "square", "cube", "prime", "composite"]
    domain_length = 1000
    parts = [
        [
            int.from_bytes(
                hashlib.shake_256(repr(list(v)).encode("utf-8")).digest(512)[i : i + 8],
                "little",
            )
            for i in range(0, 512, 8)
        ]
        for v in values
    ]
    salt = 1
    while 1:
        if (
            hfn(parts, salt, domain_length, 3) in cubes
            and hfn(parts, salt, domain_length, 2) in squares
            and hfn(parts, salt, domain_length, 4) in primes
            and hfn(parts, salt, domain_length, 5) in composites
            and hfn(parts, salt, domain_length, 1) in evens
            and hfn(parts, salt, domain_length, 0) in odds
        ):
            print(salt - 1)
            break
        salt += 1
def hfn(parts, salt, domain_length, value_index):
    return (
        sum(
            ((salt >> i) - (salt >> i + 1)) * parts[value_index][i] for i in range(64)
        )
        % 18446744073709551616
        * domain_length
        >> 64
    )
if __name__ == "__main__":
    main()
```
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), 28 bytes
```
n=>122+'vdou r'.search(n[1])
```
[Try it online!](https://tio.run/##JYyxDsIgFEV3voKNEpWkXRu6@RVNB4SHYigPobAYvx1rnc45d7hPVVXWycXtEtBAs7IFOfXDcGLVYKGJiQwq6UcX5n7hbSQzQ2PYmbKY3Ao/0bhGzG77R7kdzK@i0mFQIbBFWExXtf@Ap3Kib6IxZPQgPN47u6@cj@TD2xc "JavaScript (Node.js) – Try It Online")
All credits go to Recursive Co., I would have commented but since It's my first time on posting on stackexchange I don't have the reputation for that.
When search doesn't find anything it return -1, making it possible to remove q and saving one byte.
[Answer]
# JavaScript (ES6), 24 bytes
```
x=>parseInt(x,30)%17^212
```
[Try it online!](https://tio.run/##hVNdb5swFH3nVxxVSWu3HiJEy7Sl9CXKw54SKcpT1SgEzGaUGIYh7Rbx2zODR@pGSENC3I9zry/nXKfhMVRRIfLyk8xifk6C81vwlIeF4t9lSd7Y2KPD0ZeNP/LPUSZVtufuPvtBEnKTxfENpVPnKsyPXPbF1a8qLHhfJqp2vfG8EIf@guyQZ0qUJuksAslfseIl0d7cdla2s7adpe3MbCfJChCBACPPm0LgsTEa6@GB4uQAImnyQ/gINIhi4YZxTIQuvcp5FPNLrrYbm75j3@q6Mkjc4wr9uRvCAq878D3GLTqPvuG/g7eAVAP0ualOC/3pcu@jp/9GN1FgZv1e82gtSiErjjwyodox79L6V@cY7kWsj0oqGZUikyCyOux4oUzjgpdVIfG8YJgzrBjWDEuG2Yur16f4TUjCNA8InpC4P0PVFT@LF0pxe9ue22nWNXaV@MP18AEmegS9F69ZESs9w1ZvKkOzlwxmCxmanWNoN0w73T5tXZXvRUnuGO6oYzTYhYo3nH2dojUfA4wnxv5ArDDE9vBuMT/yJoZ7v4VY9BsBWtpIO7h7CHMSNRRcbmPE2mOpVklgg5TS9@pWmMsl2X68xINTU1fT4eAk6s3glNZ0exG0tlSsnfNf "JavaScript (Node.js) – Try It Online")
Some other 24 bytes
```
x=>parseInt(x,30)%65+204
x=>parseInt(x,33)%37+497
x=>parseInt(x+87,35)%349
```
---
# [JavaScript (Node.js)](https://nodejs.org), 22 bytes
```
x=>Buffer(x)[3]%29^115
```
[Try it online!](https://tio.run/##hVPbbuIwEH3PVxxV0NqtN@KiVtpt04dFPIOEeEIg0sTZdQRJ1klod1G@nU7ihroo0iJFzOXMeHzmOPYPfh5olRXfkjSUp8g7vXnPP8sokpq98dV43R993wyH96cgTfJ0J91d@otF7CoNwyvOH52LsDzIpCue/yl9LbsyQfnSGc@02ncXpPsszVVhks7MS@QrFrJg5E1tZ2E7S9uZ287EdqJUgyl4GA4Gj1B4qo3aurvjODqAiup8HyN4BOKYuX4YMkWlF7kBx/Scq@zGpu94ZHVdGCRucYG@b4ewwMsWfItxg86CH/jv4A0gJgCdG1Na0V@b@xw9/hjdRIGJdb36R7soVFJKZIEJVY755tZdnYO/UyEdFZVJUKg0AUvK/YvUuWmsZVHqBKuZwFRgIbAUmAtM1i7JR/9lLBLEA7xnRO5vP2@LV2rNOa6vm3PbnbWN3Vz9kzS8hwcagXTxmuowpxm2pFSBWpcCRoUCteYEGoWR0@pp6@bZThXsRuCGO2YHlDGU1caTh3FjfeFUGUAH5Rbpw8GDoX3UQCzmDfcNY6yZ2d37GQvq2388w4Cv6Mw1bUdhg5jzz9JmIefHsf3ydHtHqqrW/d5RVZveMa625y1W1uoq5/QO "JavaScript (Node.js) – Try It Online")
Some other 22 bytes
```
x=>Buffer(x)[3]%87^115
x=>Buffer(x)[3]%89^113
x=>Buffer(x)[3]%55^115 // UpperCase
x=>Buffer(x)[3]%57^113 // UpperCase
```
[Answer]
# [Java (JDK)](http://jdk.java.net/), 22 bytes
```
s->150-s.hashCode()%30
```
[Try it online!](https://tio.run/##NY5Ba8MwDIXv@RXCEHCGY1LGLutWKIOdtlN3Gzu4sZM6TWzPkgNl9LdnbrsdhPTQ09M3qFnVgz4udgo@EgxZy0R2lF1yLVnv5N26aEeFCO/KOvgpAELaj7YFJEW5zd5qmPKO7yha139@gYo9VlcrwId/865//Ut7unk20MHzgvVm9dDUKA8KDy9eG16V982yvt51PgKfVQR8BOa1FmY2TuB3UtGINu2NCNFOefSZHC0ZJjGMljgTrPp/DrA7IZlJ@kQy@x11nJWrJmeWunRMAAropAphPG3xAsqxqm4A5@JS5@UX "Java (JDK) – Try It Online")
## Outputs
```
       odd: 139
      even: 140
    square: 169
      cube: 125
     prime: 149
 composite: 155
```
## Alternate
```
s->160-s.hashCode()%50
```
[Try it online!](https://tio.run/##NY5Ba8MwDIXv@RXCEHCGY9LDdli3QhnstJ2629jBjZ3UaWJ7lhwoo789c9vtIKSHnp6@Qc2qHvRxsVPwkWDIWiayo@ySa8l6J@/WRTsqRHhX1sFPARDSfrQtICnKbfZWw5R3fEfRuv7zC1TssbpaAT78m3f961/a082zgQ6eF6w3q4emRnlQeHjx2vCqvG@W9fWu8xH4rCLgIzCvtTCzcQK/k4pGtGlvRIh2yqPP5GjJMIlhtMSZYNX/c4DdCclM0ieS2e@o46xcNTmz1KVjAlBAJ1UI42mLF1COVXUDOBeXOi@/ "Java (JDK) – Try It Online")
## How
Brute-forced with this code:
```
import java.util.*;
class Main {
  private static long[] cubes = computeCubes(100, 1000);
  private static long[] squares = computeSquares(100, 1000);
  private static long[] primes = computePrimes(100, 1000);
  public static void main(String[] args) {
    for (int o = 0; o <= 1000; o++) {
      for (int m = 2; m < 10000; m++) {
        if (test(o, m)) {
          System.out.printf("o = %d, m = %d%n", o, m);
          System.out.printf("odd: %d%n",       f("odd",       o, m));
          System.out.printf("even: %d%n",      f("even",      o, m));
          System.out.printf("square: %d%n",    f("square",    o, m));
          System.out.printf("cube: %d%n",      f("cube",      o, m));
          System.out.printf("prime: %d%n",     f("prime",     o, m));
          System.out.printf("composite: %d%n", f("composite", o, m));
          System.out.printf("%n");
        }
      }
    }
  }
//  static long f(String s, int o, int m) {
//    return o + s.hashCode() % m;
//  }
  static long f(String s, int o, int m) {
    return o - s.hashCode() % m;
  }
  static boolean test(int o, int m) {
    var odd =       f("odd",       o, m);
    var even =      f("even",      o, m);
    var square =    f("square",    o, m);
    var cube =      f("cube",      o, m);
    var prime =     f("prime",     o, m);
    var composite = f("composite", o, m);
    var values = new long[]{ odd, even, square, cube, prime, composite };
    
    var result = Arrays.stream(values)
                   .filter(v -> 100 <= v && v < 1000)
                   .distinct()
                   .count()
                 == 6;
    
    result &= odd % 2 == 1;
    result &= even % 2 == 0;
    result &= Arrays.binarySearch(squares, square) >= 0;
    result &= Arrays.binarySearch(cubes, cube) >= 0;
    result &= Arrays.binarySearch(primes, prime) >= 0;
    result &= Arrays.binarySearch(primes, composite) < 0;
    return result;
  }
  private static long[] computeSquares(int min, int max) {
    var minSqrt = (int)Math.sqrt(min); if (minSqrt * minSqrt < min) minSqrt++;
    var maxSqrt = (int)Math.sqrt(max);
    var squares = new long[maxSqrt - minSqrt + 1];
    for (int i = 0; i < squares.length; i++) {
      var sqrt = minSqrt + i;
      squares[i] = sqrt * sqrt;
    }
    return squares;
  }
  private static long[] computeCubes(int min, int max) {
    int minCbrt = (int)Math.pow(min, 1/3d); if (minCbrt * minCbrt * minCbrt < min) minCbrt++;
    int maxCbrt = (int)Math.pow(max, 1/3d);
    var cubes = new long[maxCbrt - minCbrt + 1];
    for (int i = 0; i < cubes.length; i++) {
      int cbrt = minCbrt + i;
      cubes[i] = cbrt * cbrt * cbrt;
    }
    return cubes;
  }
  private static long[] computePrimes(int min, int max) {
    var composites = new boolean[max];
    composites[2] = false;
    var primes = new long[max];
    var primeCount = 0;
    for (int i = 2; i < max; i++) {
      if (!composites[i]) {
        for (int c = i * i; c < max; c += i) {
          composites[c] = true;
        }
        primes[primeCount++] = i;
      }
    }
    var minPos = Arrays.binarySearch(primes, 0, primeCount, min);
    var maxPos = Arrays.binarySearch(primes, 0, primeCount, max);
    return Arrays.copyOfRange(primes, minPos < 0 ? ~minPos : minPos, primeCount);
  }
}
```
[Try it online!](https://tio.run/##lVZNb9swDL3nV3ADUti146YdsMPcbBh6HjYsxyIHxVYadf7IJDlbMWR/vaM@LMuuk6U5xBb1@ERST5QfyZ7MHvMfz8@s3NVcwiMakkayIrlMJ5OsIELAF8Iq@DOZAOw42xNJQUgiWQZFXT3cryBr1lTAArK63DWS3qlhcD2fx4B/8zA96ih@NoT7rktjOMsZraXv@02Pe67Kt1kX6GNd9zXLocR0gqXkTNMQ/iBCzA7wt6k5BKySUCPtPMXH7UJz4WsUtSgPVyLuJsXHrYYhrvRxAGwDgaRCBnUMZejPACyfhKRlUjcywVwquQneqnWneax5p/m0ehuDdtSpnPLL8w@tgw1RG93QLJ@eZqF7WvVprLEdnsViNtXncUYzPItFaepFLMr4qli0Rno0rdEOz4sFBVYLJjsm39ju0f9Y0NGDHCb@U/0fJpOrK/BFjssYmYKIQcvSPEqlI4UF4FQ2vEKhRiCSLRHbuzqnQQhTKFMNOSjlnMvZY5yNMPb51nVdUFKBFvgY155wQBWimI@LMnVIpbQWOia8DmnUZLBj4uqQSjEe5wsBdUitCgsdE4nH2e48oseEYA@rgu5J0egeVdFftm/9URWJdbKxTSTWYcYmhNjjP5hFHR22xqaQSPeZc/IkEiE5JWVgVgk9@blfsmGFpDzYw@yjalGqoe3h4gL/TMsa98qZkKzKZDA@ndVNNTq3WMB7L2Yb78VCq2AKNwpwnQ7m9L7byflw0ma6ZhXhT0tKeLYN7LXRli@Ej2c66ovKVPt8J3PP2N15vZvbzRArPrfasIfMMLhjdeR27V@N@oCxyp408ts/a2hf/uRKIAoWfiFymwg0BDgRpvoyaiGXDnyr3sJ2GEWd0JH9CB0uOzyNPZW3njO3SgTXq7R/yTJzyTKMwFIkBa0e5BZt/i1q1tBxdGysbaXW9Z6tcF6Y1NQjnXTt1ZbbQk29/1Nu8xFzrNjWfrceVGdX/wo0/vrqXd5VXOMu4eVbV3s1bGtvFxtnJ79b9l6TG5ZfO8/cQqfLrwnGi6@Q2botvuVyxdeOpvSZycx7jOyAxp9Vf/s1d0rt7mS1udv7SKVvk@0g9zcqyA0pBB30/GHlVoP5O9XswJ36Xv1uTP3Qa1g23Pg33ups5X/7OY4MORiWi6X4ankyiNDY/1T0mDKVh@QNffktATah@y7uKFJwt18Hb0tsw/hWCzjdweaxV4hYK7bXI17P4NqHlYX1zerd09fNd1I9UOdqI8TWCZ/grx19sGafNjSyOjw//wM "Java (JDK) – Try It Online")
[Answer]
# [Python 3](https://docs.python.org/3/), 42 bytes
```
lambda s:sum(s[:-1])-2+6*(81in s)+(77in s)
```
[Try it online!](https://tio.run/##HcbLCoJAFADQfV9xceOdfIAFGYJB5SxcmOajTbXQxiHBF15b9PWTdFZn/M7vod8q6T9UW3aVKIE8@nRId89ynszaGLs17p2mB2IGuu4/Sg4TECyv9DgIgN/4BbJrcUw5nIsThyQNo6VxlMRZmHPdprFtZmTeChbj1PQzki3q1yBqZCZo/kEzQSIxpn4 "Python 3 – Try It Online")
Takes input as `bytes` in uppercase.
Not as short as an [uninteresting clone of the current shortest formula](https://tio.run/##DclBCsMgFEXReVfxcBKlIWA7C6QbaTswVakQ/cavga7e5o4O3PyrX0r37pdX30xcrQHP@qavYj8sNRQx@ZCs5Kd@q@6pgBESBrIW7nAJvDdTHD5tdcglxJMUM3Gobpg4b6FKNV9wdt5UJY8Qy0OM8JKV6n8 "Python 3 – Try It Online"), and can very likely be golfed further, but I wanted to show a different approach.
My first instinct on seeing this challenge was to use `sum`, because you can sum a byte string in Python 3 and it's a useful quick method to do string lookups like this.
Cube numbers were definitely the hardest to get to behave with a sum, because there are only 3 practicable cube numbers in the region of the sums of the strings (\$ 6^3, 7^3, 8^3 \$).
I played around with different slices of the string and different input casings, and I found that `sum(s[:-1])` was promising:
```
ODD => 147
EVEN => 224
SQUARE => 396
CUBE => 218
PRIME => 312
COMPOSITE => 622
```
Subtracting 2 makes `216`, a cube, while keeping the rest. `396` is also very close to `400`, and the rest were pretty easy too.
`81in s` tests for a `Q`, and then `+6*()` adds 6 if there is one (abusing Python's weak interpretation of booleans). Similarly, `+(77in s)` fixes `PRIME` by making `311` instead of `310`. (I'm sure these bits can be golfed somehow.)
[Answer]
# [Python 2](https://docs.python.org/2/), 24 bytes
```
lambda s:hash(s)%853^702
```
An unnamed function accepting a string that returns an integer:
```
      odd: 783
     even: 832
   square: 196
     cube: 512
    prime: 661
composite: 679
```
**[Try it online!](https://tio.run/##JY3NCsIwEITvPsVeJAkUEYuoAX0SEVKTkoD5aXYriPTZY1Ln8g0zMJM@ZGM4lPF6Ly/lB60ApVVoOYrt@dg/TvtaxgxkkMAF4CxqzTpg5m1CI06zyqa55zysTNn5fxB9iujIMCE3UFWbQMC@8nZZJFT0C9vVda@It4MOxpVClB8 "Python 2 – Try It Online")**
---
...or perhaps 21 in Python 3?
```
lambda b:b[2]**95%547
```
where `b` is `bytes` if that is allowed in place of a string.
[Answer]
# [Python 3](https://docs.python.org/3/), ~~26~~ 25 bytes
```
lambda x:497+int(x,33)%37
```
[Try it online!](https://tio.run/##DYxBCsMgFAX3PcUjUKJUurEQGkhP0o2pSoXot35T0tNbZzUwMPlX35R088uzbSau1uCYb/fpElIVh9JanvXUPBUwQsJI1sJ9XQJ/dlMcXvvqkEuIXSlm4lDdeOW8hSrkfEKn1/5ihWF5DApesJTtDw "Python 3 – Try It Online")
*-1 thanks to ovs*
Converts the string to an integer in base 33, then does a bit of hashing.
Outputs:
```
odd => 509
even => 508
square => 529
cube => 512
prime => 499
composite => 522
```
Found using this brute-force script and a tiny bit of manual filtration:
```
PRIMES = {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, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997}
SQUARES = {256, 900, 144, 400, 529, 784, 289, 676, 169, 441, 576, 961, 196, 324, 841, 729, 225, 100, 484, 361, 625}
CUBES = {125, 216, 343, 512, 729}
CUBE, SQUARE, PRIME, EVEN, ODD, COMPOSITE = "cube", "square", "prime", "even", "odd", "composite"
for s in range(800):
    for b in range(32, 37):
        for m in range(1, 10000):
                if \
                    s + int(CUBE, b) % m in CUBES \
                    and \
                    s + int(SQUARE, b) % m in SQUARES \
                    and \
                    s + int(PRIME, b) % m in PRIMES \
                    and \
                    s + int(COMPOSITE, b) % m not in PRIMES \
                    and \
                    (s + int(ODD, b) % m) % 2 \
                    and \
                    (s + int(EVEN, b) % m) % 2 == 0:
                        print(f"{s} + int(x, {b}) % {m}")
```
[Try it online!](https://tio.run/##pZRNb9pAEIbv/hUrpEqg@mDv90bi0CYcckhJQ9JTLxCg5YBNgVStkH873WfNR6RGqkR9GMY7u4/ed2bN6vf2e12p/f7@4fZuMBJ9sSuLMhdloQiOEGIoeZW8KqoqZRQ0wbBmWLPss2SOzFH1VEMKrAWqIRZkGdekVARHYE3xCllqqiYFqpClpeBYc6xBlp4CZIVcBVQhV5W8IlchV@kUIkAZqoYMpQqlCqUKlPJkiNQ0QmNflwTJq0pBEVjTZEA1IrWlilINWQPVngz7GtOGxhqgBp7BvsGqQZ@BYgAYrBqsGqwaKAaXBopFmsWvxaotU0YBfVanQAGoxa/Fr0Wfxa8FavFrkeaKFOIWB8UxD4dLh0sHyjEKhz4HxaHPgXJIczTMA/AMwMsUFIECo/WgPFo8FI8gj1WPFs8sPYI8vIC3ACogKAAIjDHgLWArgAr0OdCmACUACDgKwTXZ6PPTh4f2VktjoRZcWc1YC5qPB6@5RHTHWS5vGmvqOydsurcxUzLu8xRcuqjS8G0UDFhzk@isNE12/fTx8B2xQ5YcpX@mlOlok6UtuWjF5SJ9ebkYfBl8ysXw5iYX18O7@@Ho9nEQMZ3nl8msk4vO5sfLeJ2y1XqxTMns56zit55O@Xmul6t6s9jOOlk2r9diIxaVWI@rb7OuL4reVSbiQ2FyLijJ3T/UjvXluZ7@CorT6dfPYi6@/rXIsxHvI2DbbW1OeuJdS2w78/aZcTX9B@3YrjPvON1LiYfGn4GH/8BLeaexnZhVvf0PbvcITpeiRRLk5aT2kr1G9fuiuHrzEE@8avHUvLPbNAfCr1zsJg1nd8um09vv/wA "Python 3 – Try It Online")
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 6 bytes
```
HƵ₅%₁+
```
[Try it online!](https://tio.run/##yy9OTMpM/a9cVmlokGWvpKBrp6BkX/nf49jWR02tqo@aGrX/6/zPT0lRSC1LzVMoLixNLEpVSC5NSlUoKMrMBTLzcwvyizNLUgE "05AB1E – Try It Online")
This computes `from_hex(input)%193+256`, found by the same script I used for my Python answer.
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 12 bytes
```
Ｉ﹪⁺⁴⁷⁰⍘Ｓγ⁸⁶⁶
```
[Try it online!](https://tio.run/##S85ILErOT8z5/z@gKDOvRMM5sbhEwzc/pTQnXyMgp7RYw8TcQEfBKbE4NbgEqCBdwzOvoLQEytbUUUjXBBIWZmaamprW//8XFGXmpv7XLcsBAA "Charcoal – Try It Online") Link is to verbose version of code. Takes input in lower case. Explanation:
```
       Ｓ        Input string
      ⍘ γ       Converted from base 95
  ⁺⁴⁷⁰          Plus 470
 ﹪       ⁸⁶⁶    Modulo 866
Ｉ               Cast to string
                Implicitly print
```
These constants were the only ones I could find that worked with lowercase inputs. There are other constants that work for title or upper case:
```
           lower    Title       UPPER
           + 470 162 710 100 254 588 708
           % 866 586 778 840 851 948 972
         odd 327 155 401 723 683 671 659
        even 206 400 750 278 286 386 470
      square 729 169 529 529 361 841 841
        cube 343 343 729 729 343 729 729
       prime 269 397 457 659 467 919 571
   composite 299 511 119 539 495 451 763
```
I also tried base 26 but I didn't find any solutions. I also tried "base 1000" which had one solution for each case: `+499, %837: 819 176 121 512 389 371` (lowercase) `+674, %703: 173 194 225 216 577 512` (title case) `+334, %667: 353 186 625 512 383 372` (upper case).
[Answer]
## Batch, 74 bytes
```
@cmd/cset/aeven=120,square=121,odd=123,cube=125,prime=127,composite=128,%1
```
Case insensitive. Explanation: Sets six variables and evaluates the input.
[Answer]
# [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), ~~24~~ ~~19~~ 18 bytes
```
Hash@#~Mod~619-90&
```
[Try it online!](https://tio.run/##y00syUjNTSzJTE78n2b73yOxOMNBuc43P6XOzNBS19JA7X9AUWZeSbSyrl1atHJsrIKagr6DQrVSfkqKko6CUmpZah6ILi4sTSxKBbGSS5PAdEFRZi5EID@3IL84syRVqfY/AA "Wolfram Language (Mathematica) – Try It Online")
```
Hash@#~Mod~775+35&
```
[Try it online!](https://tio.run/##y00syUjNTSzJTE78n2b73yOxOMNBuc43P6XO3NxU29hU7X9AUWZeSbSyrl1atHJsrIKagr6DQrWSf0qKko6CkmtZah6IDi4sTSxKBbGcS5PANFBbLkQgP7cgvzizJFWp9j8A "Wolfram Language (Mathematica) – Try It Online")
This code was developed on Mathematica `12.3.0 for Mac OS X x86 (64-bit) (May 10, 2021)` and verified on `12.0.1 for Linux x86 (64-bit) (October 16, 2019)`. According to [the documentation](https://reference.wolfram.com/language/ref/Hash.html),
> 
> The "Expression" hash code is computed from the internal representation of an expression and may vary between computer systems and from one version of the Wolfram Language to another.
> 
> 
> 
[Answer]
# [C (gcc)](https://gcc.gnu.org/), 23 bytes
```
#define f(n)n[3]%29^115
```
[Try it online!](https://tio.run/##S9ZNT07@/185JTUtMy9VIU0jTzMv2jhW1cgyztDQ9H9uYmaehmY1l0JBUWZeSZqChpJqSkyekk6ahlJ@SoqSpqY1TApJJrUsNQ@HVHFhaWJRKrIkspHJpUmpODQCBXJxySXn5xbkF2eWQORr/wMA "C (gcc) – Try It Online")
* just a port of [tsh answer](https://codegolf.stackexchange.com/a/230397/84844) the difference is : while js had to use buffer() C can access every single character directly.
]