Produce the number 2014 without any numbers in your source code

Note to challenge writers as per meta consensus: This question was well-received when it was posted, but challenges like this, asking answerers to Do X without using Y are likely to be poorly received. Try using the sandbox to get feedback on if you want to post a similar challenge.

It's 2017 2018 2019 2020 already, folks, go home.

So, now that it's 2014, it's time for a code question involving the number 2014.

Your task is to make a program that prints the number 2014, without using any of the characters 0123456789 in your code, and independently of any external variables such as the date or time or a random seed.

The shortest code (counting in bytes) to do so in any language in which numbers are valid tokens wins.

var QUESTION_ID=17005,OVERRIDE_USER=7110;function answersUrl(e){return"https://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"https://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="<h1>"+e.body.replace(OVERRIDE_REG,"")+"</h1>")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return r-a});var s={},r=1,a=null,n=1;e.forEach(function(e){e.size!=a&&(n=r),a=e.size,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SIZE}}",e.size).replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);var o=e.language;/<a/.test(o)&&(o=jQuery(o).text()),s[o]=s[o]||{lang:e.language,user:e.user,size:e.size,link:e.link}});var t=[];for(var o in s)s.hasOwnProperty(o)&&t.push(s[o]);t.sort(function(e,s){return e.lang>s.lang?1:e.lang<s.lang?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SIZE}}",o.size).replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i;
body{text-align:left!important}#answer-list,#language-list{padding:10px;width:290px;float:left}table thead{font-weight:700}table td{padding:5px}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b"> <div id="answer-list"> <h2>Leaderboard</h2> <table class="answer-list"> <thead> <tr><td></td><td>Author</td><td>Language</td><td>Size</td></tr></thead> <tbody id="answers"> </tbody> </table> </div><div id="language-list"> <h2>Winners by Language</h2> <table class="language-list"> <thead> <tr><td>Language</td><td>User</td><td>Score</td></tr></thead> <tbody id="languages"> </tbody> </table> </div><table style="display: none"> <tbody id="answer-template"> <tr><td>{{PLACE}}</td><td>{{NAME}}</td><td>{{LANGUAGE}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr></tbody> </table> <table style="display: none"> <tbody id="language-template"> <tr><td>{{LANGUAGE}}</td><td>{{NAME}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr></tbody> </table>

• Even though numbers are ignored in brainfuck, I thought I'd post one anyway. 32 Chars: ++++++[>++++++++<-]>++.--.+.+++. – Braden Best Apr 1 '15 at 21:37
• Brainfuck isn't a valid language for this challenge. – Joe Z. Apr 1 '15 at 22:49
• I know. That's why I posted it as a comment – Braden Best Apr 1 '15 at 22:51
• I wonder if this question gets a small spike in popularity around New Year's. – Joe Z. Dec 26 '15 at 23:28
• Waiting for "Come on folks, don't you realize it's 2016?" :) – padawan Jan 4 '16 at 23:35

C, 25 bytes

f(){printf("%d",L'ߞ');}


24 characters, but one character is UTF-8 encoded. Still the shortest C answer! How it works:

U+07DE ߞ NKO LETTER KA


7DE in decimal is 2014.

Python 3, 16 Bytes :

print(ord('ߞ'))


2017 version, 16 Bytes :

print(ord('ߡ'))


Python - 23 Bytes

print ord('&')*ord('5')

• The 5 is a number. – pppery Aug 31 '17 at 20:39

Whitespace, 19 bytes

Visible representation:

SSSTTTTTSTTTTSNTNST


Just pushes 2014 onto the stack and prints it. Whitespace's lack of any visible characters makes this pretty easy.

Valid as numbers are completely valid tokens in whitespace, they just don't do anything.

Common Lisp, 15 characters

(char-code #\ߞ)


Try it online!

Clojure - 35 characters ASCII only

(print(-(*(int\#)(int\<))(int\V)))


Based on True Soft's answer

Ruby (8 bytes, 7 chars)

'ߞ'.ord


The question mark is ߞ represented in two bytes UTF8.

• Duplicate of O-I's Ruby solution posted 3.5 years earlier. – manatwork Jul 24 '17 at 9:24
• @manatwork Duplicate answers are allowed. – Martin Ender Jul 24 '17 at 10:44
• I didn't said they aren't. Neither downvoted or flagged. (Just for the record, I never agreed with that rule. And never will.) But I think would be more enjoyable to avoid duplicated solutions. Especially on a question that already has 263 answers. – manatwork Jul 24 '17 at 11:03
• Hm... hard to find the old solutions. But actually his solution is 9 bytes because the codepoints representations need 2 bytes. – schmijos Jul 24 '17 at 12:58
• Initially O-I's solution was also 'ߞ'.ord, but then be updated because the requirement says to “prints the number 2014”. The general rule (which can be overridden by each challenge) is that solutions must handle input and output either themselves explicitly or benefit the interpreter's service if it has such thing like ruby's -n or -p. Code that expects input to be readily available in the memory or just leaves the value they produce in the memory are called snippets and generally are not accepted as solutions. – manatwork Jul 24 '17 at 14:29

Lua, 27 bytes

Should work in Lua 5.1, Lua 5.2, and Lua 5.3.

x="ɅɅ"print(x:byte()..#x)


Try it online!

This is mean to be saved with the UTF-8 encoding. The first byte of the string is 201, and its length is four. Lua is mostly encoding agnostic, so as long as these things are true in whatever encoding, it works.

With only ASCII, 28 bytes:

x=""io.write(x:byte(y,#x))


Note: the string must contain ASCII 20 and ASCII 14 (which are not printable characters). y here is an undefined variable, so it is nil, which byte defaults to 1 in the first parameter.

Implicit, 3 bytes

ߞ


Try it online!

     implicit push command
character
ߞ   U+07DE (2014 in decimal)
implicit integer output


Triangularity, 18 bytes

.. ..
."ߞ".
o


Try it online!

Pyt, 16 bytes

áŁ!⁺²Đ⁺⁺!₀⁻⁻⇹ᴇ+₅


Explanation:

á                               Push stack into list (pushes empty list)
Ł                              Get length of top of stack (0)
!                             0!=1
⁺²                           (1+1)^2=4
Đ                          Duplicate top of stack
⁺⁺!                       (4+2)!=720
₀⁻⁻                    720/10-2=70
⇹                   Swap top two items on stack (4 is on top)
ᴇ                  10^4=10000
+₅                (10000+70)/5=2014


Try it online!

Brainf*ck

>++++++++++[<+++++>-]<.--.+.+++.


> Move pointer pos over
[ Start loop
<+++++>- Add 5, move over & subtract 1
] End loop
<.--.+.+++. Do some other stuff


Yes, I know this is an old post, but I'm really bored and want to get enough rep to comment because I don't have access to my other account.

• Welcome to PPC...Jk – FantaC Jan 12 '18 at 3:11

Brainfuck, 23 Bytes

-[>+<-----]>-.--.+.+++.


Try it online!

Aceto, 10 bytes

IIppIpPiIp


Try it online!

Uses int(Pi) to it's advantage

11 bytes (previous answer)

IIppIpIIIIp


Try it online!

Simply increments from zero 2, 0, 1, and 4 times, then prints each time

Fun Version

Piddd++DsJiPidIIJi*p


Try it online!

Uses int(Pi) to base equations off of

Lame Version

'ߞop


Try it online!

Converts the codepoint to number, which is 2014

PHP, 25 bytes

<?=IntlChar::ord("ߞ");?>

• This requires the IntlChar library; and that´s a lot younger than the question. Nice idea, though. – Titus Mar 10 '18 at 1:31
• Thanks. Can be solved without using IntlChar library with preg_replace('#\D#','',json_encode('—')). Pick your number from a unicode table :-) – Agnius Vasiliauskas Mar 10 '18 at 12:08

SNOBOL4 (CSNOBOL4), 42 bytes

	&UCASE 'N' @X ARB 'T' @Y
OUTPUT =Y X
END


Try it online!

@ assigns the index of the match and (space) concatenates them.

I know, it's 2018, so I should go home...

Python 3, 16 bytes

lambda:ord('ߞ')


Try it online!

T-SQL, 32 bytes

Based on the idea of Steve Matthews, but avoiding unprintable characters:

SELECT -~(ASCII('=')*ASCII('!'))


Alternative (but rather obvious) solution, 23 bytes:

PRINT UNICODE(N'ߞ')


Objective-C, 27

NSLog(@"%i",'&'*('V'-'!'));


x86, 15 bytes

No numbers in the source code. Returns in eax. Uses (252*4 - 1) * 2.

   0:   31 c0                   xor    %eax,%eax
2:   fe c8                   dec    %al
4:   48                      dec    %eax
5:   48                      dec    %eax
6:   48                      dec    %eax
7:   d1 e0                   shl    %eax
9:   d1 e0                   shl    %eax
b:   48                      dec    %eax
c:   d1 e0                   shl    %eax
e:   c3                      ret


If we permit numbers in the source but not binary, we have mov $2014,%ax/ret for 5 bytes. Ahead, 5 bytes ezpz 'ߞO@ ' push next cell to stack ߞ U+7DE (2014 decimal) O output as number @ die  Try it online! Z80Golf, 10 bytes 00000000: 080a 0b0e 767e 23e5 ee3a ....v~#..:  Try it online! Disassembly start: ex af,af' ; db$3a ^ '2' ($08) ld a,(bc) ; db$3a ^ '0' ($0a) dec bc ; db$3a ^ '1' ($0b) ld c,$76   ; db $3a ^ '4' ($0e)
; halt         ($76) ld a,(hl) inc hl push hl xor$3a


Essentially the Hello World trick in Z80Golf.

In short, hl serves two purposes: data address for a and return address for putchar (which is at $8000 and accessed by going all the way through zeroed memory, instead of call$8000).

The instructions in the data section have to be effective no-ops (not touching hl and sp should suffice), and the last one should be 2-byte in order to shadow $76 (halt). I carefully selected the xor value so that the resulting binary has no digits ($30 to $39). Z80Golf, 10 bytes, 2018 edition 00000000: 1416 171e 767e 23e5 ee26 ....v~#..&  Try it online! Disassembly start: inc d ; db$26 ^ '2' ($14) ld d,$17   ; db $26 ^ '0' ($16)
; db $26 ^ '1' ($17) ; rla
ld e,$76 ; db$26 ^ '8' ($1e) ; halt ($76)
ld a,(hl)
inc hl
push hl
xor $26  Same principle, but this time we can't use ld c,$76 since it gives $36 for the xor value. So I moved to e which starts with 1e. Also, different starting address gives two different interpretations of the data section: • $16 $17: ld d,$17
• \$17: rla (Rotate the register A to the left)

So I had to check both are effective no-ops in this program.

Lua 5.3.1, 31 bytes

It's an old question, but I may as well join in on the fun!

For those not familiar with Lua, the # operator returns the length of an array or string, and the .. operator is for string and number concatenation. The // operator is integer divide, and is used so that there is no trailing decimal in the numbers caused by Lua treating the result of regular divisions as a float.

2014 in 31 bytes: t=#"aa"print(t..t-t..t//t..t*t) = print(2..2-2..2/2..2*2)

2015 in 36 bytes: t=#"aa"print(t..t-t..t//t..t*t+t//t) = print(2..2-2..2//2..2*2+2/2)

2016 in 33 bytes: t=#"aa"print(t..t-t..t//t..t*t+t) = print(2..2-2..2//2..2*2+2)

2017 in 38 bytes: t=#"aa"print(t..t-t..t//t..t*t+t+t//t) = print(2..2-2..2//2..2*2+2+2/2)

2018 in 33 bytes: t=#"aa"print(t..t-t..t//t..t*t*t) = print(2..2-2..2//2..2*2*2)

The solutions for other years are pretty similar. Here's a function that can do any number:

function f(y)
t=#"a"
s=""
for i=t, #(y.."") do
n=t-t
for j=t,(y..""):sub(i,i) do
n=n+t
end
s=s..n
end
return s
end


And here's the golfed version of the function at 108 bytes:

function f(y)t=#"a"s=""for i=t,#(y.."")do n=t-t for j=t,(y..""):sub(i,i)do n=n+t end s=s..n end return s end

;# - 203

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#

• This language is invalid according to the community consensus on what counts as a programming language – MilkyWay90 Jul 5 '19 at 4:33
• @MilkyWay90 Um, this is from just under a year ago... I don't think there was a consensus back then. Either way, it's not like i even got an upvote, so let's just leave it, eh? – seadoggie01 Jul 5 '19 at 16:46
• The consensus was made in 2014. You can take it up with Meta, but until then this is invalid – MilkyWay90 Jul 5 '19 at 16:49

K (ngn/k), 10 bytes

"&"*-/"U "


Try it online!

and 2018 just because this is so late

K (ngn/k), 11 bytes

-"^"-*/"@!"


Try it online!

EDIT: I'm unsure when this language was created, it's a variant of k which has existed for a long time, but the gitlab link seems to indicate that it may be only a year or so old (judging by commit info), so this answer may be invalid as a result

• The non-competing rule has been abolished – MilkyWay90 Jul 5 '19 at 4:33

Aheui (esotope), 8 chars (24 bytes)

반밝따바뱟해망어


Try it online!

It's too easy for Aheui since it never use any kind of digits at all.

Explanation:

# An Aheui code starts with default stack "아".
반: push 2, move cursor right by 1(→).
밝: push 7, →
따: mul(push 14), →
바: push 0, →
뱟: push 2, move cursor right by 2(→→).
해: end.
망: print as integer, →
어: move cursor left by 1(←).


Note: Print instruction moves cursor in reverse direction if current storage is empty.

TI-BASIC, 7 bytes

int(₁₀^(³√(tan(cosh(cos(π


A significant improvement from the previously winning 12-byte TI-BASIC answer. Using one-byte functions allows the greatest number of chances to achieve a certain value within a given byte count.

Forth, 29 bytes

hex fbc 'B' '!' / / decimal .


Try it online!

C# .NET 75 bytes

public class p{public static void Main(){System.Console.Write((int)'ߞ');}}


Just displaying the integer value of the unicode character ߞ
Try online (also has 2015-2019)

Python, 8 bytes

ord('ߞ')


Cheap answer to convert the UTF-16 char to its value.

• Exact copy of MadTux's Python solution posted more than 5 years earlier. (Hint: the Leaderboard script embedded in the challenge description is the easiest way to search for the existing solutions in your chosen language, to see whether anybody got the same idea before.) – manatwork Aug 21 '19 at 8:00
• Oof, thanks. I looked at the leaderboard, but the Python result I found there was longer than 8 bytes. – GetHacked Aug 21 '19 at 12:35