49
\$\begingroup\$

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 so shortest code in each language wins!

\$\endgroup\$
8
  • 15
    \$\begingroup\$ predefined values. pfft \$\endgroup\$ Feb 21, 2017 at 12:29
  • \$\begingroup\$ can output be a hexadecimal number? \$\endgroup\$
    – user902383
    Feb 21, 2017 at 13:25
  • 1
    \$\begingroup\$ @user902383 must be in the exact format, feel free to parse it as a hex number, as long as the output is in normal decimal notation. \$\endgroup\$
    – colsw
    Feb 21, 2017 at 14:16
  • 14
    \$\begingroup\$ I love the story lol. More challenges need a backstory like this \$\endgroup\$
    – Cruncher
    Feb 22, 2017 at 14:40
  • 4
    \$\begingroup\$ So now that there are many solutions to choose from, was the gambling site a fraud? \$\endgroup\$
    – Tominator
    Feb 23, 2017 at 10:32

90 Answers 90

1 2
3
1
\$\begingroup\$

Rust, 43 42 31 bytes

fn main(){print!("{}",!0usize)}

This isn't portable code (assumes a 64-bit architecture), but I can't use the u64 type due to its name containing forbidden characters.

\$\endgroup\$
2
  • \$\begingroup\$ I think you can remove the space after the comma. \$\endgroup\$ Feb 26, 2017 at 4:17
  • \$\begingroup\$ Oh, beginner mistake! Thanks, updated :) \$\endgroup\$ Feb 26, 2017 at 15:31
1
\$\begingroup\$

><>, 17 15 bytes

Updates

  • Replaced ab-- with i+ to achieve -1.

b5+:*:*:*:*i+n;

Try it online!

The idea is to factor 1616 into (((162)2)2)2, which can be easily computing by duplicating the stack and multiplying :*.

Explanation

b5+:*:*:*:*i+n;

b                     Push 11
 5                    Push 5
  +                   Add to make 16
   :*                 Square  ->  16²
     :*:*:*           .. another 3 times to make
                           16¹⁶ = (((16²)²)²)²
           i          Push -1 because no input
            +         16¹⁶ + (-1) = 16¹⁶-1
             n;       Print and Exit
\$\endgroup\$
1
  • \$\begingroup\$ 14 bytes \$\endgroup\$
    – emirps
    Dec 7, 2022 at 15:53
1
\$\begingroup\$

Brain-Flak, 122 bytes

(()())({({})({}[()])}{})({({})({}[()])}{})({({})({}[()])}{})({({})({}[()])}{})({({})({}[()])}{})({({})({}[()])}{})({}[()])

Try it online! Also works in Mini-Flak

\$\endgroup\$
1
  • \$\begingroup\$ You can shorten this. Instead of 2^2^2, you can use 4*2*2 to get 16. (((()()()()){}){}). That's 24 Bytes shorter \$\endgroup\$
    – Dorian
    Jul 23, 2018 at 14:52
1
\$\begingroup\$

Java, 92 Bytes :-D

class a{public static void main(String[] a){System.out.print(Long.toUnsignedString(-3/3));}}
\$\endgroup\$
1
\$\begingroup\$

Keg, 6 bytes

\∑\@Ë;

Try it online!

\$\endgroup\$
1
\$\begingroup\$

Attache, 12 bytes

{$`e^$`G-!0}

Try it online!

Uses Attache's inbuilt number compression literals. $`<string> decompresses <string> into a number. In this case, e maps to 4, and G to 32. Another solution would be to replace both with $`q, which maps to 16. We subtract 1, which can be calculated as !0, or \$0!\$. This is a lambda returning the appropriate value.

\$\endgroup\$
1
\$\begingroup\$

x86_64 machine code (Linux), 7 bytes

00000000: 4831 c048 f7d0 c3                        H1.H...

Assembly (NASM):

section .text
global func
func:
xor rax, rax
not rax
ret

Try it online!

\$\endgroup\$
1
  • \$\begingroup\$ xor rax, rax => xor eax, eax as upper32 is automatically zeroed \$\endgroup\$
    – l4m2
    Dec 15, 2022 at 4:43
1
\$\begingroup\$

Vyxal, 4 bytes

kḭ²‹

Try it Online!

2^32 squared, minus one.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ ₆E‹ for -1 byte \$\endgroup\$
    – emanresu A
    Nov 8, 2022 at 23:23
1
\$\begingroup\$

Fig, \$7\log_{256}(96)\approx\$ 5.762 bytes

{^{3C/@

Try it online!

{^{3C/@
  {3    # 3 - 1
 ^      # To the power of
    C/     # The charcode of
      @    # '@' (64)
{       # Decremented
\$\endgroup\$
1
\$\begingroup\$

JavaScript, 34 25 bytes (courtesy of l4m2)

(a=BigInt(9+7))**a-a/a+''

Works in any console that supports BigInts.

\$\endgroup\$
2
  • \$\begingroup\$ 27 \$\endgroup\$
    – l4m2
    Dec 15, 2022 at 4:48
  • \$\begingroup\$ 25 \$\endgroup\$
    – l4m2
    Dec 15, 2022 at 4:49
0
\$\begingroup\$

Python, 19 bytes

In REPL

int('3'*(35-3),7-3)

Not in REPL

print int('3'*(35-3),7-3)
\$\endgroup\$
0
\$\begingroup\$

Pyke, 5 bytes

Zw`@t

Try it here!

 w`   -   64
Z  @  -  set_bit(0, ^)
    t - ^ -1
\$\endgroup\$
0
\$\begingroup\$

MUMPS, 15 bytes

w 9+7**(9+7)-'0
\$\endgroup\$
0
\$\begingroup\$

SmallTalk – 60 characters

Transcript show:(((7+9)raisedTo:(7+9))-(3/3))printString;cr.
\$\endgroup\$
0
\$\begingroup\$

Batch, 64 59 58 54 bytes

@set a=@cmd/cset/a
%a%0xafebff0
%a%737095
%a%0xc99f

Port of my JavaScript answer. Edit: Saved 5 bytes thanks to @Arnauld.

\$\endgroup\$
0
0
\$\begingroup\$

SmileBASIC, 35 bytes

?POW(!.+!.,#X)LOCATE #A,0?ASC("x")

x should be replaced with CHR$(1615)

\$\endgroup\$
0
\$\begingroup\$

Groovy, 28 Bytes

{++(Long.MAX_VALUE​/0.5​)​}​

Try it: https://groovyconsole.appspot.com/edit/5145694419550208

\$\endgroup\$
0
\$\begingroup\$

Ruby, 18 bytes

p (9+7)**(9+7)-7/7
\$\endgroup\$
1
  • \$\begingroup\$ Would (9+7)**(9+7) save you a byte? \$\endgroup\$
    – Neil
    Feb 21, 2017 at 22:49
0
\$\begingroup\$

asm2bf, 9 bytes

Function body assuming r1 = 0, returns the desired value in r1.

decr1
ret
\$\endgroup\$
0
\$\begingroup\$

Japt, 10 bytes

GîGpG)+#¡5

Try it

GîGpG)+#¡5
G              :16
 î             :Slice the following to that length
  GpG          :  16**16
     )         :End slice
      +        :Append
       #¡5     :1615
\$\endgroup\$
0
\$\begingroup\$

Whitespace, 61 bytes

[S S S T    S N
_Push_2][S N
S _Duplicate][T S S N
_Multiply][S N
S _Duplicate][T S S N
_Multiply][S N
S _Duplicate][T S S N
_Multiply][S N
S _Duplicate][T S S N
_Multiply][S N
S _Duplicate][T S S N
_Multiply][S N
S _Duplicate][T S S N
_Multiply][S S S T  N
_Push_1][T  S S T   _Subtract][T    N
S T _Print_as_integer]

Letters S (space), T (tab), and N (new-line) added as highlighting only.
[..._some_action] added as explanation only.

Try it online (with raw spaces, tabs and new-lines only).

Explanation:

Pretty straight-forward:

  1. Push 2
  2. Square itself six times
  3. Decrease by 1
  4. Output as integer

Pushing and outputting the expected integer in one go would be 72 bytes instead.

\$\endgroup\$
0
\$\begingroup\$

Factor (Windows only), 14 bytes

GPTR on-bits .

enter image description here

Only works on Windows (and hence not on TIO/ATO). Not sure whether that's allowed or not.

GPTR is a constant equal to 64 loaded on machines running Windows. on-bits takes a value and creates a number with that many on bits.

\$\endgroup\$
0
\$\begingroup\$

Fig, 17 bytes (UTF-8)

OC"䠎ᴐ᳊╏ɧ

Try it online!

Fig doesn't have too much in the way of number builtins, so here is a charcode version. Just get the charcode of each character, then join.

\$\endgroup\$
0
\$\begingroup\$

C (gcc), 9 bytes

-Df()0UL-

Try it online!

Tech used before

\$\endgroup\$
0
\$\begingroup\$

Pyt, 5 bytes

3⁻⁸⁸⁻


3⁻     pushes 3, then decrements
  ⁸    raises to the 8th power
   ⁸   8th power again
    ⁻  decrement
       implicit print

Try it online!

\$\endgroup\$
0
\$\begingroup\$

Gol><>, 8 bytes

"@"XMn;

Try it online!

The unprintable is char 0x02

Explanation

".@"XMn; # whole program
".@"     # 0x02, 64
    X    # e`X`ponentiate
     m   # -1
      n  # output
       ; # terminate execution
\$\endgroup\$
0
\$\begingroup\$

Thunno, \$ 10 \log_{256}(96) \approx \$ 8.23 bytes

aeaA,D^nA~

Attempt This Online!

No numbers at all!

Explanation

aeaA,D^nA~  #                           STACK:
ae          # Constant for 160          160
  aA        # Constant for 10           160, 10
    ,       # Integer divide            16
     D^     # To the power of itself    18446744073709551616
       n    # Negate                    -18446744073709551616
        A~  # Bitwise not               18446744073709551615
            # Implicit output
\$\endgroup\$
0
\$\begingroup\$

Stax, 4 bytes

VuJv

Run and debug it

Unpacked and packed it's 4 bytes

Explanation

Vu   # 2**32
  J  # squared
   v # -1
\$\endgroup\$
0
\$\begingroup\$

Zsh, 27 bytes

!
<<<$?$[35#ULOSOKRBNKG]$?5

Attempt This Online!

Zsh only allows signed 64 bit integers, so we need a string method. Notice that ULOSOKRBNKG is 84467440737095516 in base 35, and contains no disallowed characters. Then we just need to attach two 1s and a 5: 5 is an allowed digit anyway, and we can get 1 by running a command that fails (in this case !) and taking its exit status in $?.

\$\endgroup\$
-1
\$\begingroup\$

Python, 20 (or 26) bytes

(5-3)**ord('@')-3**0

ord('@') is equal to 64.

The full function/programme (@BusinessCat, I hope this is more in line with what is expected) would add 6 bytes:

print (5-3)**ord('@')-3**0

The 26 byte version would work if we wanted to pipe the output:

python -c "print (5-3)**ord('@')-3**0"

The 20 byte version would not.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ This is a snippet, every submission needs to be a full program or function. \$\endgroup\$ Feb 27, 2017 at 14:19
  • \$\begingroup\$ you can do 3/3 instead of 3**0 and you can remove the space after print to save 2 bytes \$\endgroup\$ May 20, 2020 at 9:35
1 2
3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.