# 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

# ><>, 7 bytes

aa+nen;


You can try it on The Online ><> interpreter.

## Explanation

a        # push 10
a       # push 10
+      # push sum of top two values (10 + 10 = 20)
n     # output top value as number
e    # push 14
n   # output top value as number
;  # halt program


This doesn't print the following:

20
14


because n outputs the top value as a number without a newline.

## Alternate Solution (9 bytes)

This one actually puts 2014 on the stack as a single number and outputs it.

cbde**+n;


I basically just tried random values for this one :P

# ABC, 11 bytes

aacncacaaac


## Explanation

a increments the accumulator, c outputs it and n sets it to 0.

## Wj, 4 bytes

ë‘"C


## Explanation

ë‘"  % Push a list
C % Convert to list of ord codes [20,14]

flag:j % Join without a separator
$$$$


# MathGolf, 2 bytes

ID


Try it online!

## Explanation

I   # push 20
D  # push 14
# implicit output


## Spice, 145 97 bytes

Improvement using multiplication to get the 9 from 2*2*2+1, as we already had those values.

;t;z;o;n;i@LEN i z;ADD i i i;LEN i o;PUT i i i;LEN i t;MUL t t i;MUL t i i;ADD o i n;OUT t z o n;


## Un-golfed explanation

;t;z;o;n;i@ - Declare vars
LEN i z;    - Get the length of [], 0, and store in z
ADD i i i;  - Adding implicitly uses the first element, or 0 if there is none, so we insert 0 into i
LEN i o;    - Store length of [0], 1, in o
PUT i i i;  - Insert 0th element of i into i at position i[0] (we're increasing the array size)
LEN i t;    - Store length of [0, 0], 2, into t
MUL t t i;  - Multiply t, 2, by itself and store in i
MUL t i i;  - Multiply t, 2, by i, 4, and store in i
ADD o i n;  - Add o, 1, to i, 8 and store in n
OUT t z o n;- Write to console - "[2] [0] [1] [9]"


## Original

;t;z;o;n;i@LEN i z;ADD i i i;LEN i o;PUT i i i;LEN i t;PUT i i i;PUT i i i;PUT i i i;PUT i i i;PUT i i i;PUT i i i;PUT i i i;LEN i n;OUT t z o n;


## Un-golfed explanation

In Spice, all variables are double arrays. Importantly, variables that have no assigned value are either treated as an empty list [] or 0 depending on the operation. The built-in LEN will give the length of an array and we can therefore produce numbers:

;t;z;o;n;i@ - Declare vars
LEN i z;    - Get the length of [], 0, and store in z
ADD i i i;  - Adding implicitly uses the first element, or 0 if there is none, so we insert 0 into i
LEN i o;    - Store length of [0], 1, in o
PUT i i i;  - Insert 0th element of i into i at position i[0] (we're increasing the array size)
LEN i t;    - Store length of [0, 0], 2, into t
PUT i i i;  - Now repeat until there are 9 elements...
PUT i i i;
PUT i i i;
PUT i i i;
PUT i i i;
PUT i i i;
PUT i i i;
LEN i n;     - ... and store in n
OUT t z o n; - Write to console - "[2] [0] [1] [9]"


For the original 2014 version, you save bytes for less PUTs - 95 bytes. So this solution will improve next year!

# FEU, 69 bytes

a/abcdeghij
m/a/bb/b/cc/c/dd/d/ee/e/ff/f/gg/g/hh/h/ii/i/jj/j/kk/g
U/k


Try it online!

# Excel, 12

=UNICODE("ߞ


Second best I could do was =ARABIC("MMXIV at 14 bytes.

## Jelly, 10 bytes

⁹⁴×H_⁴Ḥ¤’’


Explanation:

⁹            Set the current value to 256.
⁴×          Multiply by 16. The current value is now 4096.
H         Divide by 2. The current value is now 2048.
_⁴Ḥ¤     Subtract by 16/2. The current value is now 2016.
’’   Decrement twice. The current value is now 2014.


# MAWP, 30 28 bytes

!!+!!!!++!*+/!+!!+!+!!++++*:


Try it!

This will be fun to golf.

This is longer than @Lyxal 's answer, but outputs only one time as one number.

• 15 bytes – Lyxal Sep 28 at 9:10

# Hexagony, 18 bytes

g{A*'-"'-'"Av<@!}/

   g { A
* ' - "
' - ' " A
v < @ !
} / .


I had trouble getting it to fit in 19 bytes (side length 3) because I was always 1 short, then I rearranged my memory accessing to be 1 shorter, which also allowed me to use a very efficient layout. Then I was able to shift a no-op somewhere in the code to the very end saving a byte.

Try it online!

# Husk, 4 bytes

c'ߞ


Try it online!

# Poetic, 112 bytes

twos a bad thing
using a two?o,hardly!i am using a poem
a numeric poem?oh,clearly,but a limited one for certain


Try it online!

Objective C

NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"yyyy"];
NSLog(@"%@",[formatter stringFromDate:[NSDate date]]);

• From the comments: Gelatin: “Is it acceptable to use the current year?” Joe Z.: “No, it has to be 2014 exactly.” – manatwork Jan 1 '14 at 13:17
• Because the question is a code-golf question, please add the character count. – ProgramFOX Jan 1 '14 at 13:31
• What happened to you, Smalltalk ? You look...different. – bug Jan 7 '14 at 1:17
• NSLog(@"%i",'&'*('F'-'A')); – Albert Renshaw Feb 16 '17 at 18:57
• @Cœur sorry meant this NSLog(@"%i",'&'*('V'-'!')); – Albert Renshaw Mar 17 '18 at 20:08

# Perl, 24 bytes

print-ord(A)+ord for U,O


Pure ascii, no nonprinting characters or utf8-only characters used. Uses the 21st and 15th letters of the alphabet to print 20, 14.

### C# (56 characters)

Class P{static void Main(){Console.Write(','*','+'N');}}

• This doesn't print anything. – shamp00 Jan 5 '14 at 15:05
• 26 characters = 4 bytes?? I don't think so... – jub0bs Jan 6 '14 at 12:24
• Sorry. I just included the logic only. Now I included the whole program. – Merin Nakarmi Jan 7 '14 at 3:34
• You need System.Console to use Console. – shamp00 Jan 8 '14 at 14:24
• using System; will be on the header. So.... – Merin Nakarmi Jan 8 '14 at 17:50

BAT (windows batch), 7 characters

echo %*


save as a.bat and invoke as a 2014

is there any restriction on using command line parameters? – Einacio

I don't think so, but echo $1 still has a number in it. – Joe Z. not a so valid answer, but noone was posting an answer in this wonderful language • Does BAT have an equivalent to sh’s$@ for “all parameters”? – Zev Eisenberg Jan 10 '14 at 23:29
• @ZevEisenberg that's what i used, altought it seems someone didn't like it – Einacio Jan 13 '14 at 15:14

PHP (27) - not shortest ASCII PHP but more readable

<?=hexdec($e=hexdec(E)).$e;


# Bat (Windows batch), 13 bytes (characters)

echo.^T |od -x


(^T is one character.)

# Bash, 15 bytes

echo "^T "|od -x


(^T is one character.)

• How about: printf %x \'— 13 characters. – Isaac Aug 30 '19 at 22:26

# PYTHON

print(str(len('Happy new year to me')) + str(len('Happy new year')))

• This has a 1 in it. – Joe Z. Jan 11 '14 at 23:16
• oh whoops let me fix it – Oliver Ni Jan 11 '14 at 23:17
• Must str('Happy new year') be wroted as str(len('Happy new year'))? – AMK Jan 11 '14 at 23:28
• sorry. I fixed it. – Oliver Ni Jan 13 '14 at 4:53

PHP, 22 bytes

echo ord('').ord('')


Edit

SE is stripping the characters. Working version here: http://codepad.org/unzjXNY2.

• this produces "00" when I run it. Please explain. – Darren Stone Jan 14 '14 at 20:32
• SE is stripping the characters. Added a codepad example. – MichaelRushton Jan 14 '14 at 22:40
• You can swap out echo  with <?=, to make it 2 characters shorter. – cjfaure Feb 8 '14 at 19:36

# k 11 & 17 chars

this 11-char one is from a colleague

@:[:']*.(.)


this 17-char one is the best i could come up with on my own; it's a variant on ASCII abuse:

.,/$-/"i"$$zzfl  and just for interest, here are a few others of mine: ."c"$"RPQT"-"e"$" " / ascii (only 2.x) ."c"$-/"e"$("RPQT";" ") / ascii (all versions) -_-(s*(exp acos@-=)xexp x)-(s xexp s:x*x)%x:+/= / port of David Carraher's solution above .,/$#:'(;();;) / another approach

• @David Carraher my latest improvements on my port of your algo--two implementations, both 39 chars: -_-(xpp:exp acos@-#)-f*x*x*x:f*f:# f+(x*_p*p:exp acos@-#)-fxxx:ff:# (i don't have the rep to comment on your post yet) – Aaron Davies Jan 10 '14 at 2:02

## Delphi (26bytes & 26 chars)

ord('-')*ord('/')-ord('e')


Ascii values
- : 45
/ : 47
e : 101
45*47 = 2115 - 101 = 2014

You never said we couldn't put it on an external page!

## Javascript - 19 Chars

location='//x.vu/u'


PS. It took 2 tries to get a shortened URL without numbers :P

• Yes, but sadly your code is far from being the shortest. :P – Joe Z. Jan 1 '14 at 18:26
• @Joe Z. Right, you could include an HTML script src instead :P – Cilan Jan 1 '14 at 23:10
• location.href.match(/-(\d+)-/).pop() – Alf Eaton Jan 3 '14 at 9:18
• location='http://goo.gl/miVwHe' would be shorter in my opinion. – Konrad Borowski Jan 4 '14 at 11:23
• @xfix Thanks for the tip, I even removed 'http:' :) – Cilan Feb 8 '14 at 19:24

## e-TeX, 21 bytes

\the\numexpr*j\bye

It contains an invisible control character with code 19 (0x13) before the asterisk. A version with printable ASCII characters needs two more bytes:

\the\numexpr^^S*j\bye


In TeX  takes the character code of the next token:

• [0x13] (^^S): 19
• j: 106

\numexpr calculates: 19 * 106 = 2014

The result is a DVI file with "2014" on the first page.

Variant with 2014 as page number:

\pageno\numexpr^^S*j~\bye


(25 bytes, if ^^S is replaced by the byte with character code 19).

# Java without the weird unicode charas @ 115

enum A{A;public static void main(String[]z){int a=A.ordinal(),b=a++;System.out.print(""+(a<<a)+b+a+(a<<(a<<a)));}}


enumerators are pretty handy :)

## GTB, 38

π/π→A:A++B:A+A→C:C*C→D~B*C*C+B*C-C-A-A


Compile assuming : at front

• π is 2 bytes and → is 3, bringing the byte count to 49. – Joe Z. Jan 7 '14 at 2:18
• @JoeZ. All characters at tibasicdev.wikidot.com/83lgfont are 1 byte. – Timtech Jan 7 '14 at 12:10

## Python, 8 characters

ord('ߞ')


I think this ought to be valid :P

Ok, if you want me to use print(),

### 15 characters

print(ord('ߞ'))


# Cardinal, 14 chars

%n=*+.-d++.
d


The pointer starts at %, reads in the character ‘d’(ASCII 100), creates a duplicate as inactive value (the bottom of the stack), adds active and inactive values, resulting in 200, adds 1, prints out the result 201, subtracts one, divides by inactive value (100), resulting in 2, adds two, prints out 4. Cardinal pointer stacks can only carry values up to 255 (OEM 437 range), everything above leads to a wrap-around.

0             100             100             200             201
0               0             100             100             100
>n=*+.-d++.    %>=*+.-d++.    %n>*+.-d++.    %n=>+.-d++.    %n=*>.-d++.
d              d              d              d              d
———————————————————————————————————————————————————————————————————————
201             200               2               3               4
100             100             100             100             100
%n=*+>-d++.    %n=*+.>d++.    %n=*+.->++.    %n=*+.-d>+.    %n=*+.-d+>.

print:"201"
———————————————————————————————————————————————————————————————————————
4
100
%n=*+.-d++>

print:"4"


Result:

Executing program..

2014

Execution complete.


# C, 24 / 68

main(){printf("MMXIV");}


Haha, Roman Numerals For The Win!

Or, for real:

main(){printf("%i%i%i%i",strlen("aa"),nil,strlen("a"),sizeof(int));}