[Question]
  [
You've recently made an account on a dodgy gambling site, where for a fee of 25 dollars, they will pay you back a random amount between 0 and 50 dollars. After getting around 5 dollars twice, you decide to prove the site is a scam. After accessing their external firewall with the default password, you find your way onto their database server, and find where the values for the minimum and maximum amounts are held. You decide to plug 25 '9's in as the maximum value, but get an error message saying the maximum value must be of type 'uint64'. However it is now that you notice some number keys don't seem to type into the remote console correctly. The challenge appears before you almost as if typed up on a Q+A site.
using only the conveniently installed programs for testing and executing your particular language, output the maximum size of an unsigned 64-bit integer value, however almost everything except the programming tools are broken on this machine, leaving you without the use of the numbers 1,2,4,6,8 - in either source code or literals, you also notice that it seems to take an exponentially longer amount of time to execute the program for each additional piece of code, so you'd better keep it short if you want to get rich before the drawing!
---
# The Challenge
* Write a program which outputs 18446744073709551615, the maximum value of an unsigned 64-bit integer, as either a number, or a single string.
* Your source code cannot contain any of the characters '1','2','4','6' or '8'
* if your language does not have an unsigned 64-bit integer or equivalent, the output can be in string format or otherwise, but must be the above number.
* this is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") so shortest code in each language wins!
  
[Answer]
# C, 26 bytes
```
main(){printf("%lu",~0l);}
```
Prints a `unsigned long` value.
Requires the size of `long` to be 64 bits.
[Answer]
## 64-bit SBCL Common Lisp, 18 bytes
`most-positive-word`
Most positive word on 64-bit compiler is 64uint. It's something.
[Answer]
## CJam (4 bytes)
```
GG#(
```
[Online demo](http://cjam.aditsu.net/#code=GG%23()
This calculates 1616 - 1 using builtin `G` for 16 and the decrement operator `(`.
[Answer]
# [Beeswax](https://github.com/m-lohmann/BeeswaxEsolang.jl), 3 bytes
```
_M{
```
Explanation:
```
_   # Create a bee going horizontally across the line, reading the code
 M  # Decrement the bee's counter, which starts at 0.
    # This will set the counter to 2^64-1, because as bees don't have a concept of
    # negative numbers, all values that are negative are translated to 2^64-n,
    # and in this case, n = -1, as we are calculating 0 - 1.
  { # Print the value
```
[Try it online!](https://tio.run/nexus/beeswax#@x/vW/3/PwA "Beeswax ‚Äì TIO Nexus")
This language is *perfect* for this challenge.
Here is an extract from the [Esolang page on Beeswax](https://esolangs.org/wiki/Beeswax):
> 
> As everyone knows, bees don‚Äôt have a concept of negative numbers, but they discovered that they can use the most significant bit of an address to get around that. Thus, coordinates relative to a bee‚Äôs position are realized by the [two‚Äôs complements](https://en.wikipedia.org/wiki/Two%27s_complement) of the coordinates. This way, half of the 64-bit address space is available for local addressing without wraparound in each direction.
> 
> 
> The maximum positive 64-bit two‚Äôs complement address is 9223372036854775807 or 0x7fffffffffffffff in 64 bit hex. All values from 0 up to this value translate identically to the same 64 bit value. All values n in the opposite (negative) direction translate to 2^64-n. For example: n=-1 is addressed by 18446744073709551615. n=-9223372036854775808 is addressed by 9223372036854775808.
> 
> 
> 
This is basically unsigned longs.
EDIT: I'm still expecting Dennis to outgolf me with a 2-byte solution.
[Answer]
# Python3 REPL, 12 bytes
In REPL: `~-(~-3<<9*7)`
Outside of REPL: `print~-(~-3<<9*7)` <--> Python2!
Here's another one at 17 bytes: `~-(~-3<<ord("?"))`.
## Explanation
Nothing super fancy. Here's it broken down:
```
~-           | Subtract 1 from the next value.
  (          | 
   ~-3       | Subtract 1 from 3, resulting in 2
      <<     | Binary shift 2's digits to left,
        9*7  | by 9*7 (63).
           ) | The value inside the parentheses is now 2**64.
```
The resulting expression is roughly (but not quite) `~-(2<<63)` -> `(2**64)-1`. I use the [tadpole operator](https://blogs.msdn.microsoft.com/oldnewthing/20150525-00/?p=45044) twice here. A golfing tip about it is [here](https://codegolf.stackexchange.com/a/37553/41754).
There is also `sys.maxint` in Python2 which can be used, but I won't be looking at that.
[repl.it](https://repl.it/Fr7H/0) <- testing link.
[Answer]
# bc, ~~15~~ 13 bytes
*Saved 2 bytes thanks to manatwork.*
```
(a=9+7)^a-3/3
```
Nothing fancy, just (16^16)-1.
[Answer]
## [dc](https://en.wikipedia.org/wiki/Dc_(computer_program)), 7 bytes
I think it's allowed for stack based languages to leave the answer on the top cell of the stack, similar to a return value for functions. If explicit printing is needed, add `p` at the end of the code.
```
AZ5E^z-
```
[**Try it online!**](https://tio.run/nexus/dc#@@8YZeoaV6Vb8P8/AA)
It computes (2 64 - 1) using several tricks:
* `2` is given as the number of digits (`Z`) found in integer 10 (`A`)
* `64` is given as `5E`. By default dc uses 10 as the input radix. Even so, it can accept numbers in hexadecimal notation, but they will be converted differently than you'd expect. Example:
(5E)default = (5E)(input radix = 10) = (5 \* 10 1) + (14(E) \* 10 0) = 50 + 14 = 64
* `1` is given as the stack's depth (`z`), since only (2 64) was present then
### Alternative story:
> 
> However it is now that you notice some number keys don't seem to type
>  into the remote console correctly. You take a deep breath and start
>  testing each numerical key. It is worse than you thought! Not a single
>  one works, and you're left with the task to produce your desired
>  integer by using only letters and symbols.
> 
> 
> 
**Solution in dc:** computing (16 16 - 1), still 7 bytes!
```
Fz+d^z-          # push 15, push 1, add, duplicate, exponentiate, push 1, subtract
```
[**Try it online!**](https://tio.run/nexus/dc#@@9WpZ0SV6Vb8P8/AA)
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 4 bytes
```
≈æJn<
```
Explanation:
```
≈æJ   # Push 4294967296
  n  # Squared
   < # Decreased by one
```
Finally! A chance to use `05AB1E`'s builtins for powers of two!
[Try it online!](https://tio.run/nexus/05ab1e#@390n1eezf//AA "05AB1E ‚Äì TIO Nexus")
Another 4 byte answer:
```
≈æxo<
```
Explanation:
```
  o  # 2 to the power of
≈æx   # 64
   < # Decreased by one
```
[Try it online!](https://tio.run/nexus/05ab1e#@390X0W@zf//AA "05AB1E ‚Äì TIO Nexus")
(if anyone is wondering, this question is older than all the other 4-byte answers)
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 4 bytes
```
‚Å¥*`‚Äô
```
[Try it online!](https://tio.run/nexus/jelly#@/@ocYtWwqOGmf//AwA "Jelly ‚Äì TIO Nexus")
**Explanation**
```
‚Å¥     # 16
 *    # exponentiate
  `   # last link as a monad, repeating the argument
   ‚Äô  # decrement
```
[Answer]
# MATLAB / Octave, 5 bytes
@Sanchises posted an excellent MATLAB answer, however this one is a considerably different approach, so I'll post it anyway:
```
tic/0
```
In MATLAB, `tic` returns the number of milliseconds past since the program was opened. Crucially the value it returns is a `uint64` type. This gets away from having to cast a number to `uint64` from MATLABs default type of `double`.
Any number divided by 0 in MATLAB is considered as infinity which for non-floating point types, MATLAB represents this as the maximum integer value for that type.
---
This also works with **Octave** though depending on which interpreter you use it may spit out a "division by zero" warning as well. You can try the code [online here](http://octave-online.net/) though as I say you get a /0 warning that doesn't appear in MATLAB.
[Answer]
# [Java (JDK)](http://jdk.java.net/), 28 bytes
```
v->Long.toUnsignedString(~0)
```
[Try it online!](https://tio.run/##NYw9D4IwEIZ3fsWNNJHGHWV00onoYhwqH02xXBt6JSEG/3qtgNPde8/zXidGkXX1K6jemoGgi5l7Upq3HitSBvlpW/LE@qdWFVRaOAcXoRDeCcB2dSQojtGoGvrI0pIGhfL@ADFIxxYV4P/scIveblUKaOEIYcyKs0HJyVzRKYlNveL0s2chX9rl5KjpufHEbUSkMW25sFZPKXqtGftpczKHLw "Java (JDK) ‚Äì Try It Online")
[Answer]
# [bc](https://www.gnu.org/software/bc/manual/html_mono/bc.html), ~~18~~, 16 bytes
* Saved 2 bytes, thx @MrScapegrace
```
(9-7)^(55+9)-3/3
```
[Answer]
### PHP, 16 bytes
This is much like the answer from Ven: <https://codegolf.stackexchange.com/a/110751/38505>
```
printf("%u",~0);
```
<https://repl.it/Frcy/0>
> 
> For this to work, you need to be in a 64-bit architecture. This is because ~0 is -1, which is 111111111111111111111111111111111111111111111111111111111111‚Äå‚Äã1111 in binary, in 64 bits, compared to 11111111111111111111111111111111 in 32-bits, and the numbers are plataform-dependent - [Ismael Miguel](https://codegolf.stackexchange.com/users/14732/ismael-miguel)
> 
> 
> 
[Answer]
## MATLAB / Octave, 22 bytes
```
eye(['~rw}?='-9 ''])/0
```
[Try it online!](https://tio.run/nexus/octave#@59amaoRrV5XVF5rb6uua6mgrh6rqW/w/z8A "Octave ‚Äì TIO Nexus")
`eye` is used to create a unit matrix (matrix with `1`  on the diagonal, zero otherwise). Without arguments, this creates a `1x1` unit matrix, or in other words, just a `1`. It takes an optional argument, which is the data type ('class' in MATLAB terminology) of the created matrix. We thus ask for a `1` of class `uint64` , and divide it by zero which results in `Inf` in MATLAB, which gets clipped at `intmax('uint64')`.
The vector `['~rw}?='-9 '']` evaluates to `'uint64'`. Concatenating an empty char to a vector is 1 byte shorter than using `char('~rw}?='-9)`.
Reasoning towards this answer: the built-in `intmax` sadly evaluates to the maximum of a 32 bit signed integer. The obvious next option is `uint64()`, which contains the forbidden characters. The alternative is to use a function that takes a string as a data type. Obvious candidates are `intmax` and `cast`, but alternatives include `zeros`, `ones` and `eye`.
```
eye(['~rw}?='-9 ''])/0    % Winning version! 22 bytes.
intmax(['~rw}?='-9 ''])   % Obvious candidate. 23 bytes.
1/zeros(['~rw}?='-9 ''])  % 24 bytes
cast(Inf,['~rw}?='-9 '']) % 25 bytes. Also an obvious candidate, but actually very long.
```
Note: MATLAB is installed by default on virtually all dodgy gambling sites.
[Answer]
# [PowerShell](https://github.com/PowerShell/PowerShell), ~~29~~ 14 bytes
```
0xC000PB/3-3/3
```
[Try it online!](https://tio.run/nexus/powershell#@29Q4WxgYBDgpG@sa6xv/P8/AA "PowerShell ‚Äì TIO Nexus")
*Thanks to @n0rd for essentially golfing this in half.*
This leverages the inbuilt unary `PB` operator that basically functions as "multiply the preceding number by `1125899906842624`" (i.e., how many bytes are in a pebibyte). That's coupled with the hex `0xC000`, or `49152`, so `49152 pebibytes`. We divide that by `3`, yielding `18446744073709551616`, and subtract `3/3` to get the final value.
[Answer]
# BF, 108 bytes
```
-[----->+<]>--.+++++++.----..++.+.---..----.+++++++.----.++++.-------.+++++++++.----..----.+++++.-----.++++.
```
If each command is considered as 3 bits, this is potentially 41 bytes.
[Answer]
# [Retina](https://github.com/m-ender/retina), ~~28~~ 27 bytes
*Saved 1 byte thanks to Kritixi Lithos*
```
bieegheeahdhajffbgbf
T`l`d
```
[Try it online!](https://tio.run/nexus/retina#@8@VlJmamp6RmpqYkZKRmJWWlpSelMYVkpCTkPL/PwA "Retina ‚Äì TIO Nexus")
**Explanation**
```
bieegheeahdhajffbgbf
```
Replaces the non-existent/empty input with this string. This particular string was generated by the "inverse" of this program. It encodes `a` through `j` as `0` through `9`, respectively.
```
T`l`d
```
This is a `T`ransliteration stage. The `l` and `d` are character sets used for transliteration. `l` represents the lowercase alphabet, `d` is all digits. So, it maps `abcdefghij` back to `0123456789`.
[Answer]
## JavaScript, ~~39~~ ~~38~~ ~~33~~ 32 bytes
```
alert(0xafebff0+'737095'+0xc99f)
```
Edit: Saved 5 bytes thanks to @Arnauld.
[Answer]
## Python3 REPL, 11 bytes
```
~0^~0>>~077
```
### How it works
* ~0 is -1 (two's complement, an infinite sequence of '1's)
* 077 is 63 in octal, so ~077 is -64
* Shift right with negative parameter is a shift to the left
* Putting all together, -1 xor (-1 << 64) is the number we are looking for
[Answer]
# JavaScript (ES6), 50 bytes
```
[...'‰†é·¥êIF‚ïè…ß'].map(s=>s.charCodeAt()).join``
```
[Answer]
# C++, 46 bytes.
```
int m(){std::cout<<unsigned long long(5+3-9);}
```
First time ever doing a code golf, but I'm fairly happy with myself. Will happily take any critique/suggestions :)
[Answer]
# [Brain-Flak](https://github.com/DJMcMayhem/Brain-Flak), ~~64, 62, 58~~, 54 bytes
```
(((((()()()()){}){}){}){}){({}<(({}()){}[()])>[()])}{}
```
[Try it online!](https://tio.run/##SypKzMzTTctJzP7/XwMMNCFQs7oWCWlU19poAAmweLSGZqymHZisra79/x8A "Brain-Flak ‚Äì Try It Online")
[Try it online!]
*Four bytes saved thanks to @Riley!*
Explanation:
```
#Push a 64
(((((()()()()){}){}){}){})
#While true
{
  #Pop the top of the stack. We'll store this value for later, but first
  ({}
  #Before pushing the value
  <
    #Push (N + 1) * 2 - 1
    # (where N is the number underneath, originally 0)
    (({}()){}[()])
  >
  #And push the TOS minus one back on
  [()])
#endwhile
}
#Pop the zero left over
{}
#And decrement the number underneath
({}[()])
```
For the record, I tried pushing 32 and quadrupling, but it's the same byte count.
[Answer]
# C# 6, 31 bytes
```
()=>System.Console.Write(~0UL);
```
Pretty much the same as Java.
# C# 5, 56 bytes
```
class P{static void Main(){System.Console.Write(~0UL);}}
```
[Answer]
# Forth (gforth), ~~11~~ ~~9~~ 7 bytes
```
true U.
```
[**Try it online**](https://tio.run/nexus/forth-gforth#@19SVJqqEKr3/z8A)
`true` is the same as `-1`. `U.` prints a number as an unsigned integer.
This works on TIO, possibly because it has a 64-bit architecture? I'm not sure. If I run `-1 U.` on repl.it, for example, I get 2\*\*32-1. If repl.it supported double-length integers, outputting them would use `UD.` instead.
[Answer]
# R, 58 bytes
R has only 32-bit integers, and with 64-bit doubles, the number 18446744073709551615 [is not accurately represented](https://tio.run/nexus/r#FctNCoAgEEDhfacYaFM7JX9y4WHEJhoIR3A2nt5s@eB7XIW4tK1lqlhiCGGHFRoKyINwUatv6iAMhWEaLEI35VmS/nH0qE9jnDdG@cOrYK122i59jA8), hence this will return a string. I can't even use 64-bit integer packages, because many of them have `64` in the names. Probably not the right tool for the job.
```
x=as.character((9+7)^(9+7))
n=nchar(x)
substr(x,n,n)='5';x
```
computes `16^16` and replaces the last character with a `5`.
[Try it online!](https://tio.run/nexus/r#@19hm1isl5yRWJSYXJJapKFhqW2uGQcmNbnybPNAMhoVmlzFpUnFJUCWTp5Onqatuqm6dcX//wA)
[Answer]
# Swift, 8 bytes
```
UInt.max
```
### outside playground / repl - 15 bytes
```
print(UInt.max)
```
[Answer]
# TI-Basic, 10 bytes
```
9+7
Ans^Ans-0!
```
[Answer]
# x64 Assembly, 7 bytes
hex (assembled): 4831C048FFC8C3
disassembled, commented:  
`XOR RAX,RAX ;Zero the value of 64 bit register RAX
 DEC RAX ;Decrement the value of RAX
 RET ;Return this value`
RAX is a 64 bit register, and is most often used to return integer arguments (eg, C). By decrementing 1, its value rolls over from 0 to... 2^64-1, which is exactly needed.  
Though, the assembled binary contains ones and fours and eights, the assembly doesn't, but the assembled file is counted in assembly, so does it count? Ow, my head.  
Also, output is return value in this case.
[Answer]
# [Brain-Flak](https://github.com/DJMcMayhem/Brain-Flak), ~~223~~ 193 bytes
Includes +1 for `-A`  
-30 thanks to DJMcMayhem
```
((((((((((((((((((((((((()()()){}){}()){}){}())[()()()()])[][]())[[]()()])[]))()()()())[[]()()])[][()])[()()()()])()()()())[(()()()){}()])()()()()))()()())[()])[()()]))()()()())[(()()()){}()])
```
[Try it online!](https://tio.run/nexus/brain-flak#@6@BC2iCoGZ1LRAh0dEQcQ3NWM3o2OhYkAiIhPA1NWGyyKLRYAqhD6EGYQmKOEIephHFZFRd////13UEAA "Brain-Flak ‚Äì TIO Nexus")
This just pushed the ASCII values of and prints as characters.
For reference, it takes 338 bytes to generate the actual number using the [Integer meta golfer](https://brain-flak.github.io/integer/).
```
((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((()()()){}()){}){}()){}()){({}[()])}{}()){}()){}())){}{})){}{})()){}{})){}{})){}{})()){}{})){}{})){}{}){}){}())){}{}){}())()){}{})){}{}){}){}){}())()){}{})()){}{})){}{}){}())){}{})()){}{})){}{})){}{})){}{})()){}{})()){}{})){}{}){}())){}{}){}){}())()){}{})()){}{})){}{})
```
[Try it Online!](https://tio.run/nexus/brain-flak#@69BHaAJgprVtWACRoMIjeraaA3NWM1aJDEQASSBCiGkBgoPtxjMZBgPyNTAVIAqga4Arh2bBagyOLXit@P/fwA)
[Answer]
# [Pyth](https://github.com/isaacg1/pyth), 6 bytes
```
C*h7"√ø
```
[Try it online!](https://pyth.herokuapp.com/?code=C%2ah7%22%C3%BF&debug=0)
## How it works
```
C*h7"√ø
    "√ø   creates the string "√ø" (U+00FF)
  h7     creates 8 (7+1)
 *       generates "√ø√ø√ø√ø√ø√ø√ø√ø"
C        convert to integer from base 256
```
This works because `18446744073709551615 = 0xFFFFFFFFFFFFFFFF`.
]