| Bytes | Lang | Time | Link |
|---|---|---|---|
| 092 | CASIO BASIC CASIO fx9750GIII | 250506T132224Z | madeforl |
| 080 | Tcl | 171023T223949Z | sergiol |
| 007 | Vyxal | 220523T154518Z | Komali |
| 009 | x86 32bit machine code | 220520T133651Z | m90 |
| 016 | A0A0 | 220519T155235Z | stefvans |
| 008 | ARM T32 machine code | 220519T132856Z | m90 |
| 024 | C++ | 220518T144756Z | m90 |
| 1412 | Befunge93 | 171118T024729Z | James Ho |
| 122 | Turing machine | 171023T015818Z | Misha La |
| 014 | APL Dyalog Unicode | 171024T180422Z | J. Sall& |
| 023 | Groovy | 171024T163854Z | Magic Oc |
| 020 | Befunge98 FBBI | 171024T134050Z | ovs |
| 020 | Tcl | 171023T224117Z | sergiol |
| 012 | JavaScript ES7 | 171022T202541Z | Arnauld |
| 007 | 05AB1E | 171022T210122Z | Erik the |
| 040 | brainfuck | 171022T204058Z | hyperneu |
| 010 | V | 171022T200344Z | DJMcMayh |
| 007 | SOGL V0.12 | 171022T200553Z | dzaima |
| 065 | BrainFlak | 171022T200911Z | DJMcMayh |
| 009 | Pyth | 171022T200900Z | Mr. Xcod |
| 008 | Jelly | 171022T195326Z | caird co |
| 012 | Jelly | 171022T195628Z | hyperneu |
| 021 | Python 2 | 171022T195514Z | Halvard |
CASIO BASIC (CASIO fx-9750GIII), 92 bytes
{1,2,4,3,3,2→List1
While Max(List1
Do
RanInt#(1,6→E
LpWHile Not List1[E
Str 1+StrMid("123456",E,1→Str 1
List1[E]-1→List1[E
WhileEnd
Locate 1,1,Str 1
Tcl, 80 bytes
puts [join [lsort -c {try {expr rand()>.5} on 9} [split 122333344455566 ""]] ""]
Vyxal, 7 bytes
»Ċ¨?»²›
Try it Online!
Port of the second answer here
Explanation:
»Ċ¨?» # Compressed integer 11972312
² # Squared
› # Increment
I was on my way to making a super short one but I had read the rules wrong :(
x86 32-bit machine code, 9 bytes
6A 85 58 BA 4F C9 00 00 C3
Returns a 64-bit integer in EDX and EAX, as is standard. The value is 51536×232−123 = 221345434566533.
In assembly:
f: push -123; pop eax
mov edx, 51535
ret
Some alternatives that also take 9 bytes:
B8 D8 AE B6 00 F7 E0 40 C3
f: mov eax, 11972312
mul eax
inc eax
ret
119723122+1 = 143336254625343
6A E1 58 0F B6 D4 B6 71 C3
f: push -31; pop eax
movzx edx, ah
mov dh, 113
ret
114×240−31 = 125344325566433
A0A0, 16 bytes
O122333344455566
O outputs the number after it. The number after it is a valid integer.
I don't really think it's possible to save bytes by using some arithmetic expression. When multiplying two numbers of n and m digits, the resulting length of the multiplication will be at most n + m. Doing such a multiplication requires at least n + m + 2 (ignoring the operand) bytes, at which point you might as well just write the result directly. Addition is even worse in terms of length. Considering multiplication, addition and subtraction are the only built-in operators I find it hard to believe this can be shortened. I'd love to be proven wrong, though.
ARM T32 machine code, 8 bytes
20d5 f24e 6157 4770
Following the AAPCS, this is a function returning a 64-bit integer in r0 and r1. The number is 58967×232+213=253261336543445.
Disassembled:
20d5 movs r0, #213
f24e 6157 movw r1, #58967
4770 bx lr
Befunge-93, 16 14 or 12 bytes
The only native integer literals supported by Befunge are the numbers 0 to 9, so coming up with an efficient representation for larger values is actually quite a common problem. In this case, though, it's not just a matter of finding the most efficient representation for a number, but also choosing a target number whose best representation is the shortest of all possible targets.
After trying thousands of different combinations, the best I've been able to do so far is 14 bytes (12 to calculate the number, and then two more bytes to output it).
m&"7*:*::**+.@
If we allow extended ASCII characters, though, we can improve on the above solution by two bytes with:
eûãÃ"**:*+.@
This is using the Latin-1 encoding, which we unfortunately can't demonstrate on TIO, since it doesn't support 8-byte encodings for the Befunge interpreters.
Explanation
In the first answer, we start with the string "m&", which essentially pushes the values 109 and 38 onto the stack. Note that we save a byte by dropping the opening quote, since we can rely on Befunge's wrap-around playfield to have the one quote both open and close the string (this pushes a number of additional values onto the stack that we don't need, but we only care about the final two).
We then push an additional 7 onto the stack, and execute the sequence *:*::**+, which performs a set of arithmetic calculations with the stack values, essentially calculating the expression:
109+(38*7)^2^3 = 354233654641325
Finally we use the . instruction to output the result of the calculation, and then the @ instruction ends the program.
In the second answer, we start with the string "eûãÃ", which pushes the values 101, 251, 227 and 195. We then execute the sequence **:*+, which performs the required calculations on those values:
101+(251*227*195)^2 = 123443543565326
And again we finish with the instructions . and @ to output the result and exit.
Note that in both cases you need to be using an interpreter which supports 64-bit integers. Also note that the string wrapping trick won't work on Befunge-98 interpreters, since it relies on the interpreter ignoring instructions it doesn't recognise, but in Befunge-98 an invalid instruction will reflect.
Turing machine, 132 122 bytes
...and 11 10 8 7 states, including halt.
0 _ x r A
0 x y r A
0 y z r A
0 z _ r C
0 * * l 0
A _ 6 r B
A * * r A
B _ 2 r C
C * 3 r D
D _ 4 r E
D 2 1 l halt
E _ 5 l 0
Here is a Turing machine simulator that understands this syntax. You should paste the code, clear the "Initial input" field, press Reset, then press Run.
How it works
Outputs 313456234562345 by looping to write 62345 three times and then writing 31 on top of the initial 62.
-10 bytes thanks to @Leo
Groovy, 23 bytes
{"233456"*2+145}
Outputs: 233456233456145
JavaScript (ES7), 13 12 bytes
let f =
_=>266**6+19
console.log(f())
This computes: 2666 + 19 = 354233654641216 + 19 = 354233654641235
There are two triples (a, b, c) with 0 < a < 1000, 0 < b < 10, 0 < c < 100 and ab + c satisfying the condition.
The following snippet finds them almost instantly.
for(a = 1; a < 1000; a++) {
for(b = 1; b < 10; b++) {
for(c = 1; c < 100; c++) {
if((r = a**b + c + '').match(/^[1-6]+$/) && [...r].sort().join`` == '122333344455566') {
console.log(a + '**' + b + ' + ' + c + ' = ' + r);
}
}
}
}
V, 12, 10 bytes
2¬26¬35a13
This generates the range [2, 6] twice, then the range [3, 5], and then appends 13.
Outputs:
234562345634513
SOGL V0.12, 7 bytes
↓čvν□⅟“
Try it Here!
A simple compressed number.
Alternate 9 byte run-length version:
Ƨ≡+‰“7─◄H
Brain-Flak, 65 bytes
(((((((((((((((((((()()()){}){}){}){}())()))()))))())))())))()))
This is 64 bytes of source code and +1 for the -A flag. This simply pushes the ASCII values of each digit in a row. For reference, pushing the number 122333344455566 would take 238 bytes:
(((((((((((((((((((((((((((((((((((((((((((((((((()()()){}){}){})()){}{}){({}[()])}{}){}){}())){}{})){}{}){}())){}{})()){}{})){}{}){}())){}{}){}())){}{}){}())()){}{})()){}{})){}{})()){}{})()){}{})){}{}){}())){}{}){}())){}{})){}{}){}()){})
Jelly, 9 8 bytes
“|BS½GA’
Simply a base-250 compressed version of the number 122333344455566
Saved 1 byte thanks to @Mr. Xcoder