[Question]
  [
Your task is simple: write a program that receives an integer as input and outputs it if it was odd, and does nothing otherwise (not halting is allowed). The challenge is, that you can only use odd bytes.
You can optionally append a trailing newline to the output.
This is code-golf, shortest answer in (odd) bytes wins.
[Standard loopholes](https://codegolf.meta.stackexchange.com/questions/1061/loopholes-that-are-forbidden-by-default) are forbidden. Furthermore, you cannot use versions of languages, which are newer than the posting of this challenge.
Example input > output:
`13` > `13`
`42` >
  
[Answer]
# [Lenguage](https://esolangs.org/wiki/Lenguage), ~~645529908926937253684695788965635909332404360034079~~ ~~9394157991500940492270727190763049448735~~ ~~1174269748937617561533841898064735499551~~ 2293382937520069758100171520285996319 bytes
That's roughly equal to 2 duodecillion bytes.
The file translates to the following brainfuck program:
```
,[<<+>+>-]<[>>+<<-]+>>[-[->]<]<[<[<]>.<]
```
Takes input as an ASCII code, with a maximum value of 256. Uses wrapping.
[Answer]
# x86-64 Machine Code, 8 bytes
Inspired by [Bruce Forte's solution](https://codegolf.stackexchange.com/a/132081/58518), but slightly under par. :-)
```
8D 07          lea      eax, [rdi]    ; put copy of input parameter in EAX
D1 EF          shr      edi, 1        ; shift LSB into CF
             InfiniteLoop:
F3 73 FD       rep jnc  InfiniteLoop  ; test CF; infinite loop back here if input was even
C3             ret                    ; return with original input in EAX if it was odd
```
A single integer parameter is taken in the `EDI` register, following the System V AMD64 calling convention.
A copy of this value is initially made, and put into `EAX` so it can be returned if appropriate. (`LEA` is used instead of the normal `MOV` because we need an instruction with odd bytes.)
Then, the value in `EDI` is shifted right by 1, which places the shifted-off bit into the carry flag (CF). This bit will be 0 if the number was even, or 1 if it was odd.
We then test CF using the `JNC` instruction, which will branch only if CF is 0 (i.e., the number was even). This means that we will go into an infinite loop for even values. For odd values, we fall through and the original value (in `EAX`) is returned.
There is a bit of a trick with the `JNC` instruction, though—it has a `REP` prefix! Normally, `REP` prefixes are only used with string instructions, but because the Intel and AMD manuals both agree that irrelevant/superfluous/redundant `REP` prefixes are ignored, we throw one on the branch instruction here to make it 3 bytes long. That way, the relative offset that gets encoded in the jump instruction is also odd. (And, of course, `REP` is itself an odd-byte prefix.)
Thank goodness `RET` is encoded using an odd byte!
**[Try it online!](https://tio.run/##rVDLTsMwELznK0aRKuyS0heiSKGnPqR@A0bIuE5qSNeV45RUiF8n2EHiwJmDtbO7szuzVqNSqa5TlmoPdZAOu7Ulvzlrel7ZvX58WiIV7f1atJOFaNdT0W62ot3ORbsIbxvqq3maJ4khj6M0xCKQrlRZv244jMmZ4yNJgNijPKLCOjDCEtMchAdMZyFeL2c89ICTC8yCpb9e2GDPA3mwF5RmoIxFGTbkjPM/hjkjznuJ8Ri7Ahfb4CTrGpKgAwlnWTU6gz9oqMDHu6kqlDZ6s5FkqDBkvEZl7elnzYtWsqnDUGXeNCRq66wz/oLSuCqD8Xht4vdJuvK9yE0/F8@b5T38l4Oc9o0jTPLks@u@VFHJsu5Gx7vbbw "C (gcc) – Try It Online")**
---
In case you don't think returning the value if it's odd or going into an infinite loop if it's even (so that you never return) satisfies the "output" requirements of the challenge, or you just want something more interesting, here's a function that outputs the value to a serial port (but only if it's odd, of course).
## x86-64 Machine Code (output to serial port), 17 bytes
```
8D 07         lea   eax, [rdi]   ; put copy of input parameter (EDI) in EAX
B1 F7         mov   cl, 0xf7     ; put 0xF7 into low-order bits of CX
B5 03         mov   ch, 0x03     ; put 0x03 into high-order bits of CX
FE C1         inc   cl           ; increment low-order bits of CX to 0xF8 (so all together it's now 0x3F8)
0F B7 D1      movzx edx, cx      ; move CX to DX ("MOV DX, CX" would have a 16-bit prefix of 0x66)
D1 EF         shr   edi, 1       ; shift LSB of input parameter into CF
73 01         jnc   IsEven       ; test CF: branch if 0 (even), fall through if 1 (odd)
EF            out   dx, eax      ; output EAX (original input) to I/O port 0x3F8 (in DX)
            IsEven:
C3            ret                ; return
```
What makes this a bit more interesting is that the code *does more*, which means it was more challenging to do it all using instructions that are encoded using only odd bytes. Of course, this also means that it fails at code golf, so it's kind of a tradeoff—do you want interesting and challenging, or do you want short?
Anyway, this uses the x86 [`OUT` instruction](http://x86.renejeschke.de/html/file_module_x86_id_222.html) to write to I/O port 0x3F8, which is the [standard COM1 serial port](https://en.wikipedia.org/wiki/COM_(hardware_interface)) on a PC. The fun part, of course, is that all standard I/O ports (serial and parallel) have even addresses, so they can't simply be encoded as immediates for the `OUT` instruction or moved directly into a register. You have to initialize with one less than the actual value, and then *increment* the value in the register. You're also limited to using certain registers for the manipulation because you need registers that are encoded using odd bytes in the instruction when used as operands.
Also, I had to initialize the `DX` register (via the `CX` register) at the top of the loop, even though this is only needed if the value is odd, to ensure that the `JNC` instruction would have an odd offset. However, since what we're skipping over is the `OUT` instruction, all this code does is waste cycles and clobber scratch registers; it doesn't actually *output* anything, so it doesn't break the rules.
Finally, this function will return (after having either done or not done the output to the serial port) with the input value left in `EAX`. But that doesn't actually break any rules; *all* functions in assembly language will return with a value in `EAX`—the question is just is it a *significant* value or a *garbage* value. That's determined by the function's documentation (essentially, does it return a value or does it return `void`), and in this case, I'm documenting it as not returning a value. :-)
No TIO link for this one, as it doesn't implement output to serial ports. You'll need real iron, or an imagination.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 2 bytes
```
ẋḂ
```
These characters correspond to bytes **0xF7** and **0xBF** in [Jelly's code page](https://github.com/DennisMitchell/jelly/wiki/Code-page).
[Try it online!](https://tio.run/##y0rNyan8///hru6HO5r@//9vaAwA "Jelly – Try It Online")
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 3 [bytes](https://github.com/Adriandmen/05AB1E/blob/master/docs/code-page.md)
```
Éi=
```
The code corresponds to the byte values `C9,69,3D` or `201,105,61` which are all odd.
[Try it online!](https://tio.run/##MzBNTDJM/f//cGem7f//hiZGxqYA "05AB1E – Try It Online")
**Explanation**
```
É     # input % 2 == 1
 i    # if true
  =   # print without popping
```
[Answer]
# [MATL](https://github.com/lmendo/MATL), 3 bytes
```
o?G
```
MATL uses ASCII characters, so `o?G` corresponds to bytes (in decimal) `111`, `63`, `71`.
[Try it online!](https://tio.run/##y00syfn/P9/e/f9/I3MA "MATL – Try It Online")
### Explanation
```
o     % Push (implicit) input modulo 2
?     % If nonzero
  G   %   Push input
      % End (implicit)
      % Display stack contents (implicit)
```
[Answer]
# Python REPL, 38 bytes
Takes input as the value of the previous expression using `_`. Output will be a string (the string representation of the integer for odd, or the empty string for even).
```
'%s'%[['']+[_]][-1][[_%[1+1][-1]][-1]]
```
[**Try it online**](https://tio.run/##JYzNCgIhFIX3PsXFEJVq4dRqaJ7kIjLMD3OhVMyCiJ7dlFmcj7P4zomfvAXfFTeQj6@sNJvCvAyc8yLFUwpEKe0RnbV4NhbRCby0UrOjVJUdYiKf4TttSZGGNSQgIA@PMaqQ5lP7RNNXXwOtQKK7mR/bR8t7vKsm6HL9Aw)
To run it in an actual shell, you can try it [here](https://www.python.org/shell/). Type the input, hit enter. Paste the code, hit enter.
### Explanation:
This took a while to figure out. There's no multiplication, no branching, no slicing, no commas, no periods, no imports, no parentheses, no `exec`, no `eval`, no `print`, and no functions. I got one solution working that output using stderr, but then I realized we had to output the actual integer, not just a truthy/falsey value.
I use brackets in place of parentheses with `[expression][-1]`. Simplifying that turns the above code into `'%s'%(['']+[_])[_%(1+1)]`.
Since there can be no commas, I used list addition to create `['',_]`. Using string formatting, the desired result is obtained.
[Answer]
# [Haskell](https://www.haskell.org/), ~~36~~ 33 bytes
```
c[1]=1;c[m]=1+1+c[m-1-1];o	m=c[m]
```
[Try it online!](https://tio.run/##y0gszk7Nyfn/PznaMNbW0Do5OhdIaRtqAxm6hrqGsdb5nLm2INH/uYmZeQq2CgVFmXklCioK@Qrm/wE "Haskell – Try It Online")
Usage: `o 7` yields `7`, `o 8` enters an infinite loop.
The actual algorithm is
```
o 1 = 1
o m = 2 + o(m-2)
```
The first problem I faced was the lack of space and `(`, because a function `o` which takes an argument `m` is usually defined as `o m=...` or `o(m)=...`. However I found out that an inline comment `{- some comment -}` works as token delimiter too, so a definition `o{--}m=...` is possible under the given rules. *Edit: Ørjan Johansen pointed out that one can use a tab character instead of a space, saving three bytes:* `o m=...`
The second problem was the recursive call `o(m-2)`. `-2` is just `-1-1`, but here the comment trick does not work because the parentheses are required. I fixed this by letting the function work on a singleton list containing a number: `o[m-2]`, however, as this is not a standard way of providing input, I outsourced the computation to a helper function `c` which works on lists and call `c` from `o` which has the correct format.
[Answer]
# CJam, 6 bytes
```
q_iY%%
```
`113` `95` `105` `89` `37` `37`
This program takes the mod 2 of the input (call it *r*) and prints every *r* th character in the input string. If the input number is odd, it prints the whole string, but if asked to print every 0th character the program throws an error. 
[Try it here](https://tio.run/##S85KzP3/vzA@M1JV9f9/EyMA)
[Answer]
# [Cubix](https://github.com/ETHproductions/cubix), ~~23~~ ~~19~~ 17 bytes
```
;;u!I1)%/;O=!;;/;
```
[Try it!](http://ethproductions.github.io/cubix/?code=ICAgIDsgOwogICAgdSAhCkkgMSApICUgLyA7IE8gPQohIDsgOyAvIDsgLiAuIC4KICAgIC4gLgogICAgLiAuCg==&input=MTM=&speed=20)
`@`, which terminates a Cubix program, is ascii 64, so unfortunately this actually just enters an infinite loop after testing for oddness. No TIO link since it'll time out.
`=` (ascii 61) is a no-op in Cubix.
This is a slight modification of the prior algorithm (same # of bytes) that actually works for negative integers.
Cube version:
```
    ; ;
    u !
I 1 ) % / ; O =
! ; ; / ; . . .
    . .
    . .
```
Algorithm: 
* `I` `(73)` : read in input as number
* `1` `(49)` : push 1
* `)` `(41)` : increment
* `%` `(37)` : take the mod
* `/` `(47)` : turn left
* `!` `(33)` : skip next instruction if odd
	+ `1;;/;` `;` is `(59)` : prepares the stack for output
	+ `O` `(79)` : Output as a number.
	+ Then it re-enters the algorithm but `I` reads a `0` for end of input, so we are guaranteed to enter the even branch
* `u` `(117)` : right-hand u-turn
* `;;;!I` : loop, effectively doing nothing.
[Answer]
# [Japt](https://github.com/ETHproductions/japt) [`-f`](https://codegolf.meta.stackexchange.com/a/14339/), 1 [byte](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
```
u
```
`u` has a char-code value of `117`.
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&flags=LWY&code=dQ&input=WzQyXQ)
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 9 bytes
```
¿﹪Ｉθ÷χ⁵→θ
```
[Try it online!](https://tio.run/##ASMA3P9jaGFyY29hbP//wr/vuarvvKnOuMO3z4figbXihpLOuP//Mw "Charcoal – Try It Online")
Basically it prints rightwards the input if it is not a multiple of 10/5 (the `²` char is even in [the Charcoal code page](https://github.com/somebody1234/Charcoal/wiki/Code-page)). The characters used are:
* `¿`: code `BF`.
* `﹪`: code `A5`.
* `Ｉ`: code `C9`.
* `θ`: code `F1`.
* `÷`: code `AF`.
* `χ`: code `E3`.
* `⁵`: code `B5`.
* `→`: code `13`.
In fact the `→` near the end is redundant but then I saw that the answer had to have an odd length... 
Explanation:
```
¿      if (
 ﹪      Modulo (
  Ｉθ      the input as number,
  ÷χ⁵      χ (predefined value: 10) divided by 5 = 2 ) [is 1])
 →θ      then print rightwards the input as string
```
[Answer]
# x86\_64 machine code (Linux), ~~12~~ 11 bytes
Unfortunately `0x80` is even, but it still worked out (assuming "does nothing" means not to return):
```
0000000000000000 <odd>:
   0:   8d 07                   lea  (%rdi), %eax
   2:   83 e7 01                and    $0x1, %edi
   5:   83 ff 01                cmp    $0x1, %edi
   8:   75 fb                   jne       5  <odd+0x5>
   a:   c3                      retq
```
-1 byte, thanks @CodyGray!
[Try it online!](https://tio.run/##nY7NasMwEITveorBYNA6DvEPxQHVTxL14Ei2m0PWQXWLQ8izO6uavkBP8y0zO7tuPzq3rm7irxnusws43@feTb4/fbRI7HL0dika0douvWhRbjwMGzdvwme7uDoxSl14xrW7sI7QhdHlv6VZFocfwkMpIHpsIg1TgGa0KA0Y7ygr0V1bkXjALUhy0MnkvU49SSz1lpMcnOt4QGekif7@Jc1E0iqrhwNiaWU2/l8PEPr5OzAKo57r@gI "C (gcc) – Try It Online")
[Answer]
## Mathematica, 20 bytes
Appear to be the first solution in non-golfing language.
```
a=1+1;g[i_/;!a\[Divides]i]=i
```
In `MacintoshChineseTraditional` character encoding. `\[Divides]` is `{161, 253}` (2 bytes)
Alternative version (23 bytes)
```
\[CapitalAlpha]=1+1;\[CapitalGamma][\[CapitalChi]_/;\[CapitalAlpha]\[LeftFloor]\[CapitalChi]/\[CapitalAlpha]\[RightFloor]\[NotEqual]\[CapitalChi]]=\[CapitalChi]
```
or (shown in Unicode)
```
Α=1+1;Γ[Χ_/;Α⌊Χ/Α⌋≠Χ]=Χ
```
in `Symbol` character encoding. (use only 1-byte characters)
The solution defines a function `g` (or `Γ`) that, evaluate to input when the input is odd, and literally "do nothing" (does not evaluate) when the input is even.
[Answer]
## Perl, 54 bytes
**Requires `-E`.**
I really really enjoyed this challenge, I think I'd like to try and improve this answer, but I think that's might be the shortest I can make for now. I've been playing with these answers on and off for a few days now, but feel I'm happy with the 54 byte solution!
```
s//A_=Y[;A_=A_%O?A_W''/;y/#A-_/#-A/;s/[#-}]+/uc/ee;say
```
[Try it online!](https://tio.run/##K0gtyjH9X1qcqmCqZ2Bo/b9YX98x3jYy2hpIOsar@ts7xoerq@tbV@orO@rG6yvrOupbF@tHK@vWxmrrlybrp6ZaFydW/v9vCAA "Perl 5 – Try It Online")
### Explanation
By default, most of Perl's string functions work on `$_`, which is empty to start.
First, `s//A_=Y[;A_=A_%O?A_W''/` replaces the empty string in `$_` with `A_=Y[;A_=A_%O?A_W''`, then `y/#A-_/#-A/` replaces characters based on the following list (char above becomes char below):
```
#ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_
#$%&'()*+,-./0123456789:;<=>?@A
```
which updates `$_` to contain `$_=<>;$_=$_%2?$_:''`. Next `s/[#-}]+/uc/ee` replaces all chars `[#-}]+` with `uc`. Without the `/ee` this would just be the string `uc`, but `/ee` evaluates the contents of the string twice. The first evaluation returns the result of `uc`, which is an uppercase version of `$_` but since `$_` contains no alphabetic characters, this just returns the whole string, then the second `/e` evaluates the string again, which sets `$_` to either `$_` (the input number) or `''` depending on whether or not the number is odd or even.
Finally, since `$_` now contains what we want, we call `say` (which is what requires `-E` instead of `-e`) which prints `$_` followed by a newline.
---
### Alternative Perl, 93 bytes
**92 bytes code + 1 for `-p`, which I feel would make it non-competing.**
```
s//_/g;s//uc/e;y/\x09-\x0b/_/;s/____/}[/;s/___/%C]/;s/_/{''H/;y/'{}1CDGH/'-)1-3+--/;s/[#-}]+/uc/ee
```
Contains a tab and a vertical tab in the `y///`, indicated as `\x09` and `\x0b`.
[Try it online!](https://tio.run/##K0gtyjH9/79YXz9eP90aSJUm66daV@pz6nIDRYAC8UCgXxsNZeqrOseCmfrV6uoe@kCF6tW1hs4u7h766rqahrrG2rq6IPloZd3aWG2wYan//xty/csvKMnMzyv@r1sAAA "Perl 5 – Try It Online")
[Answer]
# [LOGO](https://sourceforge.net/projects/fmslogo/), ~~390~~ ~~46~~ ~~52~~ 50 bytes
```
[ask    1   se[make]iseq    1-3 cos ?/ask   1[1/sum 1   179]?]
```
That is a template-list that return the input if the input is odd, and cause an error if the input is even.
Usage:
```
show invoke [ask ... (paste code here) ... ] 5
```
output
```
5
```
since 5 is odd, and 
```
invoke [ask ... (paste code here) ... ] 6
```
will cause an error because 6 is even.
---
[Answer]
## TI-BASIC, 14 bytes
```
Input Q
sinֿ¹(gcd(Q²,int(e
Q
```
This throws a domain error (printing nothing to the homescreen) on an even number.
```
Input Q             Q is a variable with an odd code. We cannot use "Ans" as it's even.
            int(e   floor(e) = 2; "2" is even.
         Q²         Q may be negative, so we square it which preserves parity.
     gcd(Q²,int(e   1 if Q is odd; 2 if Q is even.
sinֿ¹(gcd(Q²,int(e   Error iff Q is even.
Q                   If there was no error, print Q.
```
[Answer]
# [Pyth](https://github.com/isaacg1/pyth), ~~14~~ ~~11~~ ~~10~~ 9 bytes
```
~~I+Q\_+K/Q+3\_1KQ~~
~~I!sIcQ+3\_1Q~~
~~I!u+1\_GQ1Q~~
?u+1_GQ1k
```
[Test suite](http://pyth.herokuapp.com/?code=%3Fu%2B1_GQ1k&test_suite=1&test_suite_input=13%0A42&debug=0).
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 4 bytes
```
u)çU
```
Japt uses [ISO/IEC 8859-1](https://en.wikipedia.org/wiki/ISO/IEC_8859-1), so this corresponds to (in decimal) `117 41 231 85`.
[Test it online!](http://ethproductions.github.io/japt/?v=1.4.5&code=dSnnVQ==&input=NDI=)
### Explanation
```
Uu)çU   Implicit: U = input integer
Uu)     Return Python-style U % (missing argument = 2). This gives 1 if U is odd, 0 if even.
   çU   Implicitly convert U to a string and repeat it that many times.
        Implicit: output result of last expression
```
I first tried solutions using `p`, which is basically `ç` with reversed arguments. However, `p` performs exponentiation if its left argument is a number, so we'd need to explicitly convert it to a string. This solution turns out to actually be a byte shorter, in addition to not containing any odd bytes.
[Answer]
# [dc](https://www.gnu.org/software/bc/manual/dc-1.05/html_mono/dc.html), 21 bytes
```
[c]sa?kKKCI-1;1k%1!=a
```
Decimal: `91 99 93 115 97 63 107 75 75 67 73 45 49 59 49 107 37 49 33 61 97`
As per [this](https://codegolf.meta.stackexchange.com/a/8507/52405) IO default, this program leaves the input on the main stack if it is odd and empties the stack otherwise. This can be confirmed by adding the `f` debug command to the end of the program as is the case on the TIO page.
[Try it online!](https://tio.run/##S0n@/z86ObY40T7b29vZU9fQ2jBb1VDRNvF/2n9TAA "dc – Try It Online")
## Explanation
```
[    # Begin macro definition.
 c   # Clear the main stack.
]sa  # End macro definition and push the macro into register "a".
?k   # Prompt for input and store it into precision parameter "k".
KK   # Push two copies of the input to the main stack.
CI-  # Push C-I = 12-10 = 2 to the main stack  
1;1  # Push the value stored in the first index of array "1" (0 by default) 
     # to the main stack. 
k    # Push 0 into parameter "k" to reset the precision (otherwise the modulus 
     # function will not work correctly).
%    # Push the input (mod 2) to the main stack.
1!=a # If the input (mod 2) does not equal 1, execute the macro in register "a".
f    # OPTIONAL: Output the contents of the main stack.
```
[Answer]
## TI-Basic, 18 bytes
Saved 2 bytes thanks to lirtosiast
```
:Prompt Q
:While 5Q/ᴇ1-int(5Q/ᴇ1
:Q
```
in bytes (+2 newlines = 3F)
```
:Prompt Q
 DD     51
:While 5Q/ᴇ1-int(5Q/ᴇ1
 D1    35 3B B1  35 3B  
        51 31     51 31
         83 71     83
:Q
 51
```
See <http://tibasicdev.wikidot.com/one-byte-tokens>
[Answer]
# [MathGolf](https://github.com/maxbergmark/mathgolf), 3 bytes
```
¥{k
```
[Try it online!](https://tio.run/##y00syUjPz0n7///Q0urs//8NDQwB "MathGolf – Try It Online")
The used bytes are `157, 123, 107`.
### Explanation
```
¥     Input modulo 2
 {    Loop that many times
  k   Push input
```
[Answer]
# [Bash](https://www.gnu.org/software/bash/), 31 bytes
```
read a
[ $[a%2] = 0 ] ||echo $a
```
[Try it online!](https://tio.run/##S0oszvj/vyg1MUUhkStaQSU6UdUoVsFWwUAhtqYmNTkjX0El8f9/MwA "Bash – Try It Online")
# Explanation:
```
read a                   reading the input and define it on the variable a
[ $[a%2] = 0 ]      outputs exit status 0 when a/2 is 0 and exit status 1 if not.
||                           evaluates only when the exit status left of it is 1
echo $a                displays the variable a
```
]