[Question]
      [
So... uh... this is a bit embarrassing. But we don't have a plain "Hello, World!" challenge yet (despite having 35 variants tagged with [hello-world](/questions/tagged/hello-world "show questions tagged 'hello-world'"), and counting). While this is not the most interesting code golf in the common languages, finding the shortest solution in certain esolangs can be a serious challenge. For instance, to my knowledge it is not known whether the shortest possible Brainfuck solution has been found yet.
Furthermore, while all of ~~[Wikipedia](https://en.wikipedia.org/wiki/List_of_Hello_world_program_examples)~~ (the Wikipedia entry [has been deleted](https://en.wikipedia.org/wiki/Wikipedia:Articles_for_deletion/List_of_Hello_world_program_examples) but there is a [copy at archive.org](https://web.archive.org/web/20150411170140/https://en.wikipedia.org/wiki/List_of_Hello_world_program_examples)
), [esolangs](https://esolangs.org/wiki/Hello_world_program_in_esoteric_languages) and [Rosetta Code](https://rosettacode.org/wiki/Hello_world/Text) have lists of "Hello, World!" programs, none of these are interested in having the shortest for each language (there is also [this GitHub repository](https://github.com/leachim6/hello-world)). If we want to be a significant site in the code golf community, I think we should try and create the ultimate catalogue of shortest "Hello, World!" programs (similar to how our [basic quine challenge](https://codegolf.stackexchange.com/q/69/8478) contains some of the shortest known quines in various languages). So let's do this!
## The Rules
* Each submission must be a full program.
* The program must take no input, and print `Hello, World!` to STDOUT (this exact byte stream, including capitalization and punctuation) plus an optional trailing newline, and nothing else.
* The program must not write anything to STDERR.
* If anyone wants to abuse this by creating a language where the empty program prints `Hello, World!`, then congrats, they just paved the way for a very boring answer.
Note that there must be an interpreter so the submission can be tested. It is allowed (and even encouraged) to write this interpreter yourself for a previously unimplemented language.
* Submissions are scored in *bytes*, in an appropriate (pre-existing) encoding, usually (but not necessarily) UTF-8. Some languages, like [Folders](https://esolangs.org/wiki/Folders), are a bit tricky to score - if in doubt, please ask on [Meta](https://meta.codegolf.stackexchange.com/).
* This is not about finding *the* language with the shortest "Hello, World!" program. This is about finding the shortest "Hello, World!" program in every language. Therefore, I will not mark any answer as "accepted".
* If your language of choice is a trivial variant of another (potentially more popular) language which already has an answer (think BASIC or SQL dialects, Unix shells or trivial Brainfuck-derivatives like Alphuck), consider adding a note to the existing answer that the same or a very similar solution is also the shortest in the other language.
As a side note, please *don't* downvote boring (but valid) answers in languages where there is not much to golf - these are still useful to this question as it tries to compile a catalogue as complete as possible. However, *do* primarily upvote answers in languages where the authors actually had to put effort into golfing the code.
For inspiration, check [the Hello World Collection](https://helloworldcollection.github.io/).
## The Catalogue
The Stack Snippet at the bottom of this post generates the catalogue from the answers a) as a list of shortest solution per language and b) as an overall leaderboard.
To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:
```
## Language Name, N bytes
```
where `N` is the size of your submission. If you improve your score, you *can* keep old scores in the headline, by striking them through. For instance:
```
## Ruby, <s>104</s> <s>101</s> 96 bytes
```
If there you want to include multiple numbers in your header (e.g. because your score is the sum of two files or you want to list interpreter flag penalties separately), make sure that the actual score is the *last* number in the header:
```
## Perl, 43 + 2 (-p flag) = 45 bytes
```
You can also make the language name a link which will then show up in the snippet:
```
## [><>](https://esolangs.org/wiki/Fish), 121 bytes
```
```
/* Configuration */
var QUESTION_ID = 55422; // Obtain this from the url
// It will be like https://XYZ.stackexchange.com/questions/QUESTION_ID/... on any question page
var ANSWER_FILTER = "!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe";
var COMMENT_FILTER = "!)Q2B_A2kjfAiU78X(md6BoYk";
var OVERRIDE_USER = 8478; // This should be the user ID of the challenge author.
/* App */
var answers = [], answers_hash, answer_ids, answer_page = 1, more_answers = true, comment_page;
function answersUrl(index) {
  return "https://api.stackexchange.com/2.2/questions/" +  QUESTION_ID + "/answers?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + ANSWER_FILTER;
}
function commentUrl(index, answers) {
  return "https://api.stackexchange.com/2.2/answers/" + answers.join(';') + "/comments?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + COMMENT_FILTER;
}
function getAnswers() {
  jQuery.ajax({
    url: answersUrl(answer_page++),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      answers.push.apply(answers, data.items);
      answers_hash = [];
      answer_ids = [];
      data.items.forEach(function(a) {
        a.comments = [];
        var id = +a.share_link.match(/\d+/);
        answer_ids.push(id);
        answers_hash[id] = a;
      });
      if (!data.has_more) more_answers = false;
      comment_page = 1;
      getComments();
    }
  });
}
function getComments() {
  jQuery.ajax({
    url: commentUrl(comment_page++, answer_ids),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      data.items.forEach(function(c) {
        if (c.owner.user_id === OVERRIDE_USER)
          answers_hash[c.post_id].comments.push(c);
      });
      if (data.has_more) getComments();
      else if (more_answers) getAnswers();
      else process();
    }
  });
}
getAnswers();
var SCORE_REG = /<h\d>\s*([^\n,<]*(?:<(?:[^\n>]*>[^\n<]*<\/[^\n>]*>)[^\n,<]*)*),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/;
var OVERRIDE_REG = /^Override\s*header:\s*/i;
function getAuthorName(a) {
  return a.owner.display_name;
}
function process() {
  var valid = [];

  answers.forEach(function(a) {
    var body = a.body;
    a.comments.forEach(function(c) {
      if(OVERRIDE_REG.test(c.body))
        body = '<h1>' + c.body.replace(OVERRIDE_REG, '') + '</h1>';
    });

    var match = body.match(SCORE_REG);
    if (match)
      valid.push({
        user: getAuthorName(a),
        size: +match[2],
        language: match[1],
        link: a.share_link,
      });
    else console.log(body);
  });

  valid.sort(function (a, b) {
    var aB = a.size,
        bB = b.size;
    return aB - bB
  });
  var languages = {};
  var place = 1;
  var lastSize = null;
  var lastPlace = 1;
  valid.forEach(function (a) {
    if (a.size != lastSize)
      lastPlace = place;
    lastSize = a.size;
    ++place;

    var answer = jQuery("#answer-template").html();
    answer = answer.replace("{{PLACE}}", lastPlace + ".")
                   .replace("{{NAME}}", a.user)
                   .replace("{{LANGUAGE}}", a.language)
                   .replace("{{SIZE}}", a.size)
                   .replace("{{LINK}}", a.link);
    answer = jQuery(answer);
    jQuery("#answers").append(answer);
    var lang = a.language;
    lang = jQuery('<a>'+lang+'</a>').text();

    languages[lang] = languages[lang] || {lang: a.language, lang_raw: lang, user: a.user, size: a.size, link: a.link};
  });
  var langs = [];
  for (var lang in languages)
    if (languages.hasOwnProperty(lang))
      langs.push(languages[lang]);
  langs.sort(function (a, b) {
    if (a.lang_raw.toLowerCase() > b.lang_raw.toLowerCase()) return 1;
    if (a.lang_raw.toLowerCase() < b.lang_raw.toLowerCase()) return -1;
    return 0;
  });
  for (var i = 0; i < langs.length; ++i)
  {
    var language = jQuery("#language-template").html();
    var lang = langs[i];
    language = language.replace("{{LANGUAGE}}", lang.lang)
                       .replace("{{NAME}}", lang.user)
                       .replace("{{SIZE}}", lang.size)
                       .replace("{{LINK}}", lang.link);
    language = jQuery(language);
    jQuery("#languages").append(language);
  }
}
```
```
body {
  text-align: left !important;
  display: block !important;
}
#answer-list {
  padding: 10px;
  width: 290px;
  float: left;
}
#language-list {
  padding: 10px;
  width: 500px;
  float: left;
}
table thead {
  font-weight: bold;
}
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="https://cdn.sstatic.net/Sites/codegolf/all.css?v=ffb5d0584c5f">
<div id="language-list">
  <h2>Shortest Solution 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>
<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>
<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>
```

[Answer]
# Befunge-93, 21 bytes
```
"!dlroW ,olleH">:#,_@
```
[Try it online!](http://befunge.tryitonline.net/#code=IiFkbHJvVyAsb2xsZUgiPjojLF9A&input=)
**Explanation**
```
"!dlroW ,olleH"   Push the string onto the stack in reverse. Note that there is an
                    implicit null terminator since an empty stack will always pop zero.
>                 Start the output loop.
 :                Duplicate the character at the top of the stack.
  #               Skip the following operation to the right.
    _             Test if the character is null, dropping the duplicate copy.
   ,              If not, branch left and write the character to stdout.
  #               Skip the following operation to the left.
>                 Reverse direction and repeat the loop with the next character.
     @            Once the null is reached, branch right and exit.
```
[Answer]
# [Del|m|t](https://github.com/MistahFiggins/Delimit), 29 + 1 = 30 bytes
[Try it online!](https://tio.run/nexus/delimit#@2@rbKXskZqTk6@jEJ5flJOiqKyvbKRsp2yvbKms9P//f2UA)
```
=#:#Hello, World!#/#2#>#?#9#"
```
...With `#` passed as a command line argument.
This is a new language that I recently created, which uses regex to parse its source code. I highly recommend that you read the [documentation](https://github.com/MistahFiggins/Delimit/wiki) and [tutorial](https://github.com/MistahFiggins/Delimit/wiki/Tutorial).
**Explanation:**
The regex passed as an argument acts as a delimiter (hence the name), which parses the code into tokens, which are read as commands based on their ASCII values.
Because the regex is `#`, the tokens are `=`, `:`, `Hello, World!`, `/`, `2`, `>`, `?`, `9`, and `"`
These correspond to commands depending on their ASCII values mod 32:
```
(=) 29    29 pops the top value of the stack, and skips that many instructions.
          Right now, the top is 0, so it's a no-op. Later, we will use it to
          skip the following part that pushes the string
(:) 26, (H...) "H..."    26 pushes the next token as a string backwards onto the stack
(/) 15    Duplicates the top of the stack, so we have 2 copies of the top character.
(2) 18    Nots the top of the stack. It the top was 0, it is now 1
(>) 30, (?) 31    Iff the top of the stack is non-0, exit the program
(9) 25    Print the character
(") 2     Push 2 - This is used to skip the String pushing part when we...

          Go back to the start of the program and repeat
```
[Answer]
# [Valyrio](https://github.com/JaqueIsBaque/Valyrio), 17 bytes
```
s ‚à´ main [¬¥√ò]
```
`‚Äπ` and `‚Ä∫` start and end comments.
```
s ‚ÄπSets the mode to stack mode, usually used for code golf as its shorter‚Ä∫
‚à´ ‚ÄπTells the interpreter that the previous letter was a tag, not a command‚Ä∫
main [ ‚ÄπStarts the main code block‚Ä∫
¬¥ ‚ÄπPushes "Hello, World!" in unicode numbers to the stack (Alt-Shift-E on Mac)‚Ä∫
√ò ‚ÄπOutputs the stack as unicode characters‚Ä∫
] ‚ÄπEnds the main code block‚Äπ
```
[Answer]
## [Hillberth](https://github.com/tuxcrafting/hillberth), 32 bytes
```
[]H ,olH
.<   Wle
    ro
    ld!
```
If this code is weird looking, it's because the flow of an Hillberth program follows an Hilbert curve. So, the executed program is this:
```
[.<]H                                              !dlroW ,olleH
```
The code is similar to a Self-Modifying BrainFuck code, with the `H` command stopping the program.
[Answer]
# [KanyeC](https://github.com/nicksam112/kanyec), 78 bytes
"A programming language based on the brilliance of Kanye West."
```
I am the greatest
make her say "Hello, World!"
I still think I am the greatest
```
Yes, it *is* essentially just an [ArnoldC](https://github.com/lhartikk/ArnoldC/wiki/ArnoldC) substitution, but I thought I'd contribute it for the sake of completeness.
[Answer]
## [Samau](https://github.com/AlephAlpha/Samau/tree/master/OldSamau), 15 bytes
```
"Hello, World!"
```
Samau is yet another stack-based golfing language.
[Answer]
# [HODOR](https://github.com/ValyrioCode/Hodor), 2384 bytes
```
Walder
Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor
HODOR!
Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor
HODOR!
Hodor Hodor Hodor Hodor Hodor Hodor Hodor
HODOR!
HODOR!
Hodor Hodor Hodor
HODOR!
Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor!
HODOR!
Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor!
HODOR!
Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor
HODOR!
Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor Hodor
HODOR!
Hodor Hodor Hodor
HODOR!
Hodor! Hodor! Hodor! Hodor! Hodor! Hodor!
HODOR!
Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor!
HODOR!
Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor! Hodor!
HODOR!
HODOR!!!
```
I decided that my [NO!](https://codegolf.stackexchange.com/a/114877/66833) answer wasn't long enough so I finished my commemoration of [Hodor](http://gameofthrones.wikia.com/wiki/Hodor) and spend a while coding this.
Hodor uses an accumulator because he's learning to count and can't remember more than 1 number.
In short (because I'm not doing a line-by-line explanation) these are the main commands:
`Walder` Hodor hodor hodor hodor Hodor hodor hodor hodor
>
>  Start the program because Hodor's original name was Walder
>
>
>
`Hodor` Hodor hodor hodor hodor hodor
>
>  Add 1 to the accumulator
>
>
>
`Hodor!` Hodor hodor hodor hodor hodor
>
>  Subtract 1 from the accumulator
>
>
>
`HODOR!` Hodor hodor hodor hodor hodor hodor hodor
>
>  Output the accumulator as a Unicode character
>
>
>
`HODOR!!!` Hodor Hodor (Hodor hodor hodor)
>
>  Kill Hodor (End the program)
>
>
>
[Answer]
# [Turing](http://compsci.ca/holtsoft/doc/), 18 bytes
```
put"Hello, World!"
```
[Answer]
# Charcoal, 13 bytes
```
Hello, World!
```
Charcoal prints the canvas state at the end of execution, and any run of ASCII characters is considered a string, which is implicitly printed to the canvas.
[Answer]
# [NTFJ](https://github.com/ConorOBrien-Foxx/NTFJ), 106 bytes
```
~#~~#~~~@*~##~~#~#@*~##~##~~@::**~##~####@:*~~#~##~~@*~~#~~~~~@*~#~#~###@**~###~~#~@**~##~~#~~@*~~#~~~~#@*
```
[Try it online!](https://tio.run/nexus/ntfjc#PYzBDQAwCAKH4ecIvpyM1W09myY@QA7a8pwrLKRWjanMeEaqDGLB0tkWz9sakoWVIJ@8efcB "NTFJ (NTFJC) ‚Äì TIO Nexus")
NTFJ is an esoteric programming language, made by user @ConorO'Brien, that is intended to be a Turing tarpit. It is stack-based, and pushes bits to the stack, which can be later coalesced to an 8-bit number.
### How it works
```
Output          Stack
H  ~#~~#~~~@*
e  ~##~~#~#@*
   ~##~##~~@    l
ll ::**         l
o  ~##~####@:*  l o
,  ~~#~##~~@*   l o
   ~~#~~~~~@*   l o
W  ~#~#~###@*   l o
o  *            l
r  ~###~~#~@*   l
l  *
d  ~##~~#~~@*
!  ~~#~~~~#@*
```
[Answer]
**SASS, 32 bytes?**
```
\:after
  content:"Hello, World!"
```
[Answer]
# [MY](https://bitbucket.org/zacharyjtaylor/my-language/overview), 1 byte.
Here is the hex:
```
FF
```
I'm finally ready to reveal my language. It's still a major WIP, and the undefined byte meaning is temporary (except for maybe 0xFF). I will eventually update this to include a non-hacky solution when MY is able to do that.
[Answer]
# [Klein](https://github.com/Wheatwizard/Klein), 16 + 3 = 19 bytes
```
"Hello, World!"@
```
* +3 for `-A` flag
* Also contains a null argument for the topology, I'm not even sure how to score that.
[Try it online!](https://tio.run/##y85Jzcz7/1/JIzUnJ19HITy/KCdFUcnh////uo7/AQ "Klein ‚Äì Try It Online")
Competing for the bounty.
[Answer]
## [StupidScript](https://github.com/RedstoneKingdom/stupidscript), 214 bytes
It's a joke language that I just made. Mark Watney would be proud.
```
80.5 0.0
80.5 23.0
69.0 103.5
69.0 161.0
80.5 46.0
23.0 0.0
23.0 23.0
46.0 92.0
69.0 57.5
69.0 138.0
69.0 138.0
69.0 172.5
23.0 138.0
23.0 0.0
57.5 80.5
69.0 172.5
80.5 23.0
69.0 138.0
69.0 46.0
23.0 11.5
23.0 23.0
```
[Answer]
# [Fishing](http://esolangs.org/wiki/Fishing), ~~25~~ 24 bytes
```
[+_
|C]`Hello, World!`Ni
```
It exits with an error.
# Fishing, 34 bytes
```
v+CCCCCCCC^]
  `Hello,
  N`!dlroW
```
Without errors.
[Answer]
# [Aheui](https://esolangs.org/wiki/Aheui), ~~147~~ 144 bytes
```
Î∞úÎî∞Î∞§Îî∞Îπ†Î∞õÎÇòÌååÎπ†Î∞£Îã§Îπ†Î∞¶Îã§Îπ†Î∞õÌÉÄÎ∞¢Î∞¢Îî∞Î∞¶Îã§Î∞§Î∞£Îî∞Î∞¶Î∞¶Îî∞Îπ†Î∞£Îã§ÌååÎ∞õÎî∞Îπ†Î∞õÎã§ÌååÎπ†Îπ†Î∞†ÌÉÄÎ∞£Î∞¢Îî∞ÏïÑÎ©ìÌù¨
```
[Answer]
# [Shtriped](https://github.com/HelkaHomba/shtriped), 239 bytes
```
e n
e b
i b
+ x y
 +
  i x
  d y
  +
 +
 d x
0
 + b b b
1
 + b n n
 0
z x
 d x
 z x
D
 1
 s n
 z n n
 z b b
 i b
Y
 0
 0
Z
 1
 Y
 Y
B
 0
 1
1
Z
1
Y
1
Y
D
B
B
1
0
Z
Y
D
B
1
Y
B
0
Z
D
1
B
B
Y
1
0
D
Y
1
1
Y
B
Z
D
B
Y
1
0
Z
Y
D
B
1
1
1
1
B
0
D
```
[Try it online!](https://tio.run/##XU05DsQgDOz9iunTJF9AfALKCKSliaLNFgmfJzOmW9mG8RxwfX7fdtYyRsVhFbs1zoIbj2ExoOHmWbRqZxcyKxF2lW0THoxjtS67HBCKBsqXpD4d3TPQJ0l@dnZTUgenNr6ZOcknkg1EMs5NbPA9EktNrke/p5rdmf5ys5SNY7w "Shtriped ‚Äì Try It Online")
This Hello, World! in Shtriped terminates somewhat quickly, since it doesn't encode the entire string in one number.
[Answer]
# [Lean Mean Bean Machine](https://github.com/gunnerwolf/lmbm), 55 bytes
```
OOOOOOOOOOOOO
"""""""""""""
Hello, World!
!!!!!!!!!!!!!
```
I *think* this is the shortest.
Here's a somewhat more entertaining alternative approach in 96 bytes:
```
OOOOOOOOOO
"""
Hel
!!!""""
  !o, W
   !!!!
   !   "
       r
       !""
  !     d!
        !!
```
This one only sets 1 marble to each letter, and re-uses the `l` and `o` marbles, much less golfy, but more true to the spirit of the language.
[Answer]
# [Set](https://esolangs.org/wiki/Set), 123 bytes
```
set ! H
set ! 101
set ! 108
set ! 108
set ! 111
set ! 44
set ! 32
set ! 87
set ! 111
set ! 114
set ! 108
set ! 100
set ! 33
```
Needed to use raw ASCII codes because lowercase letters are reserved for variable names.
[Try it online!](https://tio.run/##K04t@f@/OLVEQVHBgwtCGxoYwlkWmCxDmKyJCZRhbARlWJhjKDI0NMFimAFMp/H//wA)
[Answer]
# MY, 60 bytes
```
27√°'‚Üê1A√°'‚Üê8A√°'2√ó‚Üê1B√°'‚Üê44√°'‚Üê2ƒ†'‚Üê78√°'‚Üê1B√°'‚Üê4B√°'‚Üê8A√°'‚ÜêA»¶'‚Üê33√°'‚Üê
```
[MY IS ON TIO!!](https://tio.run/##y638/9/I/PBC9UdtEwwdIbQFiDY6PB0k5AQRMjGB0EZHFoAocwuoDpi0E5JOIO14YhmIMjaGcP//BwA)
## How?
Outputs H, e, ll, o, <space>, W, o, r, l, d, ! to the console.
I created a 3rd answer to this question due to the differing techniques used, this uses concatenation on numbers (`27√°` pushes `72`), one uses increment and decrement, while another uses a builtin.
[Answer]
# [Braingolf](https://github.com/gunnerwolf/braingolf), 17 bytes
Got bored, made my own language, here's Hello World
```
"Hello, World!"&@
```
Explanation:
```
"Hello, World!"    Push the 13 chars of Hello World to the stack as charcode integers
               &@  Pop the entire stack and print as chars
```
Alternatively, here's hello world from before I added multi-char strings and printing:
```
#!#d#l#r#o#W# #,#o#l#l#e#H@@@@@@@@@@@@@
```
Explanation:
```
#!                                 Push the charcode of char '!' to the end of the stack
  ....................             Do this for every character in "Hello, World!" in reverse order
                      @@@@@@@@@@@@@  Pop and print the last element of the stack 13 times
```
[Answer]
# [Emoji](https://esolangs.org/wiki/Emoji), ~~23~~ 24 bytes
```
üí¨Hello, World!üí¨‚û°
```
Should be pretty clear. Just pushes `Hello, World!` and than outputs.
[Answer]
# Apps Script + Google Sheets, 39 bytes
### Script
```
function Q(){return"Hello, World!"}
```
### Sheet
```
=q()
```
## Original, 40 bytes
### Script
```
function Q(){return "Hello, World!"}
```
### Sheet
```
=q()
```
[Answer]
## [AsciiDots](https://github.com/aaronduino/asciidots), 18 bytes
```
.-$"Hello, World!"
```
[Try it online!](https://tio.run/##SyxOzsxMyS8p/v9fT1dFySM1JydfRyE8vygnRVHp/38A)
[Answer]
# [DOBELA](http://esolangs.org/wiki/DOBELA), 214 bytes
```
,,.,,,,.,..,,.,,,..,..,,,...,,.,,..,....,.,.,...,,.,,,,,,,.,..,,,..,....,..,..,,,..,..,,,..,,.,.,.,,.,,,$^
.                                                                                #
```
With comments:
```
!        d        l        r        o        W                 ,        o        l        l        e        H
,,.,,,,. ,..,,.,, ,..,..,, ,...,,., ,..,.... ,.,.,... ,,.,,,,, ,,.,..,, ,..,.... ,..,..,, ,..,..,, ,..,,.,. ,.,,.,,,$^
.                                                                                #
H = ascii 0x48 = 01001000 = ,.,,.,,,
```
Put bits in FIFO then print them by hitting `^` from below.
[Try it online](https://tio.run/##S8lPSs1J/P9fR0dPRwdE6OlBmHoQJpCACID5IAKsBqoIoQUhj8yH0BA9EB0qcVx6CvQCyv//AwA)
[Answer]
# [Triangularity](https://github.com/Mr-Xcoder/Triangularity), ~~71~~ 49 bytes
```
.... ....
..."!"...
.."ld"+..
." Wor"+.
"Hello,"+
```
[Try it online!](https://tio.run/##KynKTMxLL81JLMosqfz/Xw8IFEAEFxArKSpBWEo5KUraIJaSQnh@EZDJpeSRmpOTr6Ok/f8/AA "Triangularity ‚Äì Try It Online")
Saved 22 bytes thanks to an ingenious method by Mr. Xcoder!
## Old version
```
...........
...."H"....
..."ell"...
.."o, Wo"..
."rld!"W"".
.....J.....
```
[Try it online!](https://tio.run/##KynKTMxLL81JLMosqfz/Xw8BuECEkocSjK2UmpOjBGEr5esohOcrgdhKRTkpikrhSkoQ9XpeYPL/fwA "Triangularity ‚Äì Try It Online")
[Answer]
# [rk](https://github.com/aaronryank/rk-lang), 22 + 2 (`-e`) = 24 bytes
```
print: "Hello, World!"
```
Requires the `-e` flag (remove necessity for `rk:start`). [Try it online!](https://tio.run/##K8r@/7@gKDOvxEpBySM1JydfRyE8vygnRVHp////uqkA)
[Answer]
# [Stax](https://github.com/tomtheisen/stax), 8 [bytes](https://github.com/tomtheisen/stax/blob/master/docs/packed.md#packed-stax)
```
√®√Ø‚î¨‚ñÄ‚Ü®‚ï©4G
```
[Run and debug online!](https://staxlang.xyz/#c=%C3%A8%C3%AF%E2%94%AC%E2%96%80%E2%86%A8%E2%95%A94G&i=&a=1)
## Explanation
`√®√Ø‚î¨‚ñÄ‚Ü®‚ï©4G` is the packed form of the ASCII Stax code  ``jaH1"jS3!`, which is in turn a compressed string literal of `Hello, World!` with the ending backtick omitted.
[Answer]
# [Min](https://min-lang.org), 20 bytes
```
"Hello, World!" puts
```
[Answer]
## PHP (on a standard Apache Server, result needing to target STDOUT), ~~30~~ 27 Bytes
```
<?php die("Hello, World!");
```
Note: this is not to detract form earlier PHP example relied on an option assuming PHP wasn't being used as a webserver and abusing the HTML-effect outside of ?php tags to have an answer that was just "Hello, World!"
That said, that solution made some non-standard server assumptions which aren't common with PHP. So I'm presenting an alternative that assumes a normal server layout, but still needs to go to STDOUT. This is not to detract from the previous posters example, but to present one in a different setting with different constraints.
Note: originally thought using
```
<?php fwrite(STDOUT,"Hello, World!"); ?>
```
would be the only way, but then realized the die (normally used killing the script with an error) outputted to STDOUT and didn't use extra variables.
Updated: Cut off a few bytes recalling that "die" wont' bother with anything after itself, so didn't need the closing ?>.
Note: Worth noting, that if shorttags were on with a PHP5 server, could drop down 3 more bytes to 24 bytes with
```
<? die("Hello World!");
```
However, I was specifically going a standard server, and shortags are now off by default making a server with them on no longer standard.
Example (courtesy of Scrooble):
[Try It Online!](https://tio.run/##K8go@P/fxr4go0AhJTNVQ8kjNScnX0chPL8oJ0VRSdP6/38A)
]


[Question]
      [
A Sphenic Number is a number that is the product of exactly three distinct primes. The first few Sphenic numbers are `30, 42, 66, 70, 78, 102, 105, 110, 114`. This is sequence [A007304](https://oeis.org/A007304) in the OEIS.
## Your Task:
Write a program or function to determine whether an inputted integer is a Sphenic number.
## Input:
An integer between 0 and 10^9, which may or may not be a Sphenic Number.
## Output:
A truthy/falsy value indicating whether the input is a Sphenic Number.
## Examples:
```
30  -> true
121 -> false
231 -> true
154 -> true
4   -> false
402 -> true
79  -> false
0   -> false
60  -> false
64  -> false
8   -> false
210 -> false
```
## Scoring:
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), shortest code in bytes wins.

[Answer]
## bash, 43 bytes
```
factor $1|awk '{print $2-$3&&$3-$4&&NF==4}'
```
[Try it online!](https://tio.run/##HY5NCsIwGET3PcVQPpJVoPlREdouXXqHNDa0qInUiAXr2WNwZlaPt5jBPqfsbELb8pWj99lbl@ICkpt9X8E/j2UOCaQEacZICzKMnU9dZ748r5UvasAcoBtIJaG0hNwZlDYKhyMa7MtMdYkVSkY3RYiAmgJEj/oPh3ICHhSKFUZscPH2uhch5R8 "Bash – Try It Online")
Input via command line argument, outputs `0` or `1` to stdout.
Fairly self-explanatory; parses the output of `factor` to check that the first and second factors are different, the second and third are different (they're in sorted order, so this is sufficient), and there are four fields (the input number and the three factors).
[Answer]
# [MATL](https://github.com/lmendo/MATL), 7 bytes
```
_YF7BX=
```
[Try it online!](https://tio.run/##y00syfn/Pz7Szdwpwvb/f0MDUwA "MATL – Try It Online") Or [verify all test cases](https://tio.run/##y00syfmf8D8@0s3cKcL2v0vIf2MDLkMjQy4jY0MuQ1MTLiA0MOIyt@Qy4DIDIhMA).
### Explanation
```
_YF   % Implicit input. Nonzero exponents of prime-factor decomposition
7     % Push 7
B     % Convert to binary: gives [1 1 1]
X=    % Is equal? Implicit display
```
[Answer]
# C, ~~88~~ ~~78~~ ~~126~~ ~~58~~ ~~77~~ 73 + 4 (`lm`) = 77 bytes
```
l,j;a(i){for(l=1,j=0;l++<i;fmod(1.*i/l,l)?i%l?:(i/=l,j++):(j=9));l=i==1&&j==3;}
```
Ungolfed commented explanation:
```
look, div; //K&R style variable declaration. Useful. Mmm.
a ( num ) { // K&R style function and argument definitions.
  for (
    look = 1, div = 0; // initiate the loop variables.
    look++ < num;) // do this for every number less than the argument:
      if (fmod(1.0 * num / look, look))
      // if num/look can't be divided by look:
        if( !(num % look) ) // if num can divide look
          num /= look, div++; // divide num by look, increment dividers
      else div = 9;
      // if num/look can still divide look
      // then the number's dividers aren't unique.
      // increment dividers number by a lot to return false.
  // l=j==3;
  // if the function has no return statement, most CPUs return the value
  // in the register that holds the last assignment. This is equivalent to this:
  return (div == 3);
  // this function return true if the unique divider count is 3
}
```
[Try it online!](https://tio.run/##JcxBDoIwEADAr5gmJLu2COjJLg0f8dIslLRZwACejF@3kviAGS5H5pzFJPIQ8R2WFcQ1JrmaROs2UpiWHprLOVZiBLtYSGchVu4gWqOF5O6IJC45d6NPZpp8nOE/EbfXuiZ8rnHeA6ji1ttTsT1mZVhr44GxU/v6GpRVwcs2KDyKLwfx45ZLmX4 "C (gcc) – Try It Online")
[Answer]
# [Brachylog](https://github.com/JCumin/Brachylog), ~~6~~ 3 bytes
```
ḋ≠Ṫ
```
[Try it online!](https://tio.run/##SypKTM6ozMlPN/r//@GO7kedCx7uXPX/v5Gx4X8A "Brachylog – Try It Online")
### Explanation
```
ḋ        The prime factorization of the Input…
 ≠       …is a list of distinct elements…
  Ṫ      …and there are 3 elements
```
[Answer]
# [CJam](https://sourceforge.net/p/cjam), 11 bytes
```
rimFz1=7Yb=
```
[Try it online!](https://tio.run/##S85KzP3/vygz163K0NY8Msn2/39DA1MA "CJam – Try It Online") Or [verify all test cases](https://tio.run/##S85KzP1f/T8nM9etytDWPDLJ9n@BYW36f2MDLkMjQy4jY0MuQ1MTLiA0MOIyt@Qy4DIDIhMA).
### Explanation
Based on my MATL answer.
```
ri    e# Read integer
mF    e# Factorization with exponents. Gives a list of [factor exponent] lists
z     e# Zip into a list of factors and a list of exponents
1=    e# Get second element: list of exponents
7     e# Push 7
Yb    e# Convert to binary: gives list [1 1 1]
=     e# Are the two lists equal? Implicitly display
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 8 bytes
```
ÆEḟ0⁼7B¤
```
[Try it online!](https://tio.run/##y0rNyan8//9wm@vDHfMNHjXuMXc6tOT////GBgA "Jelly – Try It Online")
Uses Luis Mendo's algorithm.
Explanation:
```
ÆEḟ0⁼7B¤
ÆE       Prime factor exponents
  ḟ0     Remove every 0
    ⁼7B¤ Equal to 7 in base 2?
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 6 bytes
```
ÆE²S=3
```
[Try it online!](https://tio.run/##y0rNyan8//9wm@uhTcG2xv@P7jnc/qhpjfv//8YGOgqGRoY6CkbGQMLQ1ERHAYQMjHQUzC11FICyZiBsAgA "Jelly – Try It Online")
### How it works
```
ÆE²S=3  Main link. Argument: n
ÆE      Compute the exponents of n's prime factorization.
  ²     Take their squares.
   S    Take the sum.
    =3  Test the result for equality with 3.
```
[Answer]
# [Husk](https://github.com/barbuz/Husk), 6 bytes
```
≡ḋ3Ẋ≠p
```
[Try it online!](https://tio.run/##yygtzv7//1Hnwoc7uo0f7up61Lmg4P///8YGAA "Husk – Try It Online")
Returns 1 for sphenic numbers and 0 otherwise.
### Explanation
```
≡ḋ3Ẋ≠p    Example input: 30
     p    Prime factors: [2,3,5]
   Ẋ≠     List of absolute differences: [1,2]
≡         Is it congruent to...       ?
 ḋ3           the binary digits of 3: [1,1]
```
In the last passage, congruence between two lists means having the same length and the same distribution of truthy/falsy values. In this case we are checking that our result is composed by two truthy (i.e. non-zero) values.
[Answer]
# Ruby, ~~81~~ ~~49~~ 46 bytes
Includes 6 bytes for command line options `-rprime`.
```
->n{n.prime_division.map(&:last)==[1]*3}
```
[Try it online!](https://tio.run/##KypNqvyfZvtf1y6vOk@voCgzNzU@JbMsszgzP08vN7FAQ80qJ7G4RNPWNtowVsu49n@BQlq0kWWsDpAyNoBQhmDKBEoZxf7/l19QAtRf/F@3CGwiAA "Ruby – Try It Online")
[Answer]
# Mathematica, 31 bytes
```
SquareFreeQ@#&&PrimeOmega@#==3&
```
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), ~~7~~ 5 bytes
```
ÓnO3Q
```
[Try it online!](https://tio.run/##MzBNTDJM/f//8OQ8f@PA//@NDQA "05AB1E – Try It Online")
Uses Dennis's algorithm.
[Answer]
# Pyth, 9 bytes
```
&{IPQq3lP
```
[Try it here.](http://pyth.herokuapp.com/?code=%26%7BIPQq3lP&input=30&debug=0)
[Answer]
# [Actually](https://github.com/Mego/Seriously), 7 bytes
```
w♂N13α=
```
[Try it online!](https://tio.run/##S0wuKU3Myan8/7/80cwmP0Pjcxtt//83NgAA "Actually – Try It Online")
Explanation:
```
w♂N13α=
w       Push [prime, exponent] factor pairs
 ♂N     Map "take last element"
   1    Push 1
    3   Push 3
     α  Repeat
      = Equal?
```
[Answer]
# [Haskell](https://www.haskell.org/), 59 bytes
```
f x=7==sum[6*0^(mod(div x a)a+mod x a)+0^mod x a|a<-[2..x]]
```
[Try it online!](https://tio.run/##y0gszk7Nyfn/P02hwtbc1ra4NDfaTMsgTiM3P0UjJbNMoUIhUTNRG8gDs7QN4qDMmkQb3WgjPb2K2Nj/uYmZebYFRZl5JSppCiYGRv8B "Haskell – Try It Online")
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 14 bytes
```
k
k@è¥X ÉÃl ¥3
```
[Try it online!](https://codepen.io/justinm53/full/NvKjZr?code=awprQOilWCDJw2wgpTM=&inputs=MzA=,MTIx,MjMx,MTU0,NA==,NDAy,Nzk=,MA==,NjA=,NjQ=)
[Answer]
# [J](http://jsoftware.com/), 15 bytes
```
7&(=2#.~:@q:)~*
```
[Try it online!](https://tio.run/##y/r/P03B1krBXE3D1khZr87KodBKs06Liys1OSNfQUNHL03JQFPB2EDB0MhQwcjYUMHQ1EQBCA2MFMwtFQwUzIDI5P9/AA "J – Try It Online")
## Explanation
```
7&(=2#.~:@q:)~*  Input: integer n
              *  Sign(n)
7&(         )~   Execute this Sign(n) times on n
                 If Sign(n) = 0, this returns 0
          q:       Prime factors of n
       ~:@         Nub sieve of prime factors
    2#.            Convert from base 2
   =               Test if equal to 7
```
[Answer]
# Dyalog APL, 26 bytes
```
⎕CY'dfns'
((≢,∪)≡3,⊢)3pco⎕
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT///qKPdOSM1Ofv/o76pzpHqKWl5xepcGhqPOhfpPOpYpfmoc6GxzqOuRZrGBcn5QCUg9f/BGriMDbi4ICxDI0MY08gYzjQ0NYExEQwDIxjT3BLGMoMbZGYCAA)
[Answer]
# Mathematica, 44 bytes
```
Plus@@Last/@#==Length@#==3&@FactorInteger@#&
```
[Try it online!](https://tio.run/##y00sychMLv6fZvs/IKe02MHBJ7G4RN9B2dbWJzUvvSQDxDJWc3BLTC7JL/LMK0lNTy1yUFb7H1CUmQdUl6bvUG1soKNgaGSoo2BkDCQMTU10FEDIwEhHwdxSRwEoawbCJrX/AQ "Mathics – Try It Online")
[Answer]
# [Python 3](https://docs.python.org/3/), ~~54~~ 53 bytes
```
lambda n:sum(1>>n%k|7>>k*k%n*3for k in range(2,n))==6
```
*Thanks to @xnor for golfing off 1 byte!*
[Try it online!](https://tio.run/##FYxBCoMwFETX7SlmE4zyCyaxSoXkJN1YWluJfiXqotC7pwbmzeINzPLdPjOb2MPiHsduejw7cLvuk1TOsfC/xjlfeMGF6ecAj4EROn6/pCbOc2vrmDwnb0qC0oqgzVHqWhFSSk1oboRjrRNVez4tYeBNZsLsuDiINYOAZEIvj9M8/gE "Python 3 – Try It Online")
[Answer]
**C, 91 102 bytes, corrected (again), golfed, and tested for real this time:**
```
<strike>s(c){p,f,d;for(p=2,f=d=0;p<c&&!d;){if(c%p==0){c/=p;++f;if(c%p==0)d=1;}++p;}c==p&&f==2&&!d;}</strike>
s(c){int p,f,d;for(p=2,f=d=0;p<c&&!d;){if(c%p==0){c/=p;++f;if(c%p==0)d=1;}++p;}return c==p&&f==2&&!d;}
```
/\* This also works in 93 bytes, but since I forgot about the standard rules barring default int type on dynamic variables, and about the not allowing implicit return values without assignments, I'm not going to take it:
```
p,f,d;s(c){for(p=2,f=d=0;p<c&&!d;){if(c%p==0){c/=p;++f;if(c%p==0)d=1;}++p;}p=c==p&&f==2&&!d;}
```
(Who said I knew anything about C? ;-)
Here's the test frame with shell script in comments:
```
/* betseg's program for sphenic numbers from
*/
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#include <math.h> /* compile with -lm */
/* l,j;a(i){for(l=1,j=0;l<i;i%++l?:(i/=l,j++));l=i==1&&j==3;} */
#if defined GOLFED
l,j;a(i){for(l=1,j=0;l++<i;fmod((float)i/l,l)?i%l?:(i/=l,j++):(j=9));l=i==1&&j==3;}
#else
int looker, jcount;
int a( intval ) {
  for( looker = 1, jcount = 0;
    looker++ < intval;
    /* Watch odd intvals and even lookers, as well. */
    fmod( (float)intval/looker, looker )
      ? intval % looker /* remainder? */
        ? 0 /* dummy value */
        : ( inval /= looker, jcount++ /* reduce the parameter, count factors */ )
      : ( jcount = 9 /* kill the count */ )
  )
    /* empty loop */;
  looker = intval == 1 && jcount == 3; /* reusue looker for implicit return value */
}
#endif
/* for (( i=0; $i < 100; i = $i + 1 )) ; do echo -n at $i; ./sphenic $i ; done */
```
I borrowed betseg's previous answer to get to my version.
This is my version of betseg's algorithm, which I golfed to get to my solution:
```
/* betseg's repaired program for sphenic numbers
*/
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
int sphenic( int candidate )
{
  int probe, found, dups;
  for( probe = 2, found = dups = 0; probe < candidate && !dups; /* empty update */ )
  {
    int remainder = candidate % probe;
    if ( remainder == 0 )
    {
      candidate /= probe;
      ++found;
      if ( ( candidate % probe ) == 0 )
        dups = 1;
    }
    ++probe;
  }
  return ( candidate == probe ) && ( found == 2 ) && !dups;
}
int main( int argc, char * argv[] ) { /* Make it command-line callable: */
  int parameter;
  if ( ( argc > 1 )
       && ( ( parameter = (int) strtoul( argv[ 1 ], NULL, 0 ) ) < ULONG_MAX ) ) {
    puts( sphenic( parameter ) ? "true" : "false" );
  }
  return EXIT_SUCCESS;
}
/* for (( i=0; $i < 100; i = $i + 1 )) ; do echo -n at $i; ./sphenic $i ; done */
```
[Answer]
# Javascript (ES6), 87 bytes
```
n=>(a=(p=i=>i>n?[]:n%i?p(i+1):[i,...p(i,n/=i)])(2)).length==3&&a.every((n,i)=>n^a[i+1])
```
Example code snippet:
```
f=
n=>(a=(p=i=>i>n?[]:n%i?p(i+1):[i,...p(i,n/=i)])(2)).length==3&&a.every((n,i)=>n^a[i+1])
for(k=0;k<10;k++){
  v=[30,121,231,154,4,402,79,0,60,64][k]
  console.log(`f(${v}) = ${f(v)}`)
}
```
[Answer]
# [Python 2](https://docs.python.org/2/), ~~135~~ 121 bytes
* Quite long since this includes all the procedures: prime-check, obtain-prime factors and check sphere number condition.
```
lambda x:(lambda t:len(t)>2and t[0]*t[1]*t[2]==x)([i for i in range(2,x)if x%i<1and i>1and all(i%j for j in range(2,i))])
```
[Try it online!](https://tio.run/##XYwxDsIwEAR7XnFNpDtE4bi0cD7iuDBKAheZS2K5MK83JKJANLtbzM76yo9FdN1sX2N43oYAxeB3ZRNHwUydDjJAdsqfs2v30N7aQugYpiUBAwukIPcR9aUQT1Aavrb7ibujQozIzXzQ8y/NRJ7qv0QpMif4eDZkMmtiycD1DQ "Python 2 – Try It Online")
[Answer]
# [Python 2](https://docs.python.org/2/), 59 bytes
```
lambda x:6==sum(5*(x/a%a+x%a<1)+(x%a<1)for a in range(2,x))
```
[Try it online!](https://tio.run/##K6gsycjPM/qfZhvzPycxNyklUaHCyszWtrg0V8NUS6NCP1E1UbtCNdHGUFNbA0Kn5RcpJCpk5ikUJealp2oY6VRoav4vKMrMK1FI0zAxMNL8DwA "Python 2 – Try It Online")
[Answer]
# J, 23 bytes
```
0:`((~.-:]*.3=#)@q:)@.*
```
[Try it online!](https://tio.run/##y/r/P91WT0HBwCpBQ6NOT9cqVkvP2FZZ06HQStNBT4urAChpbKBgZGyoYGhqomBiYMSVBhSyUDA0MlQwUTC3VDBQMAMiEwWu1OSMfIV0hQIYI@3/fwA "J – Try It Online")
Handling 8 and 0 basically ruined this one...
`q:` gives you all the prime factors, but doesn't handle 0. the rest of it just says "the unique factors should equal the factors" and "the number of them should be 3"
[Answer]
# PHP, 66 bytes:
```
for($p=($n=$a=$argn)**3;--$n;)$a%$n?:$p/=$n+!++$c;echo$c==7&$p==1;
```
Run as pipe with `-nR` or [try it online](http://sandbox.onlinephpfunctions.com/code/285093bffbdb0bb5f7ac3cb1125b6bbb91c4f5e1).
Infinite loop for `0`; insert `$n&&` before `--$n` to fix.
**breakdown**
```
for($p=($n=$a=$argn)**3;    # $p = argument**3
    --$n;)                  # loop $n from argument-1
    $a%$n?:                     # if $n divides argument
        $p/=$n                      # then divide $p by $n
        +!++$c;                     # and increment divisor count
echo$c==7&$p==1;            # if divisor count is 7 and $p is 1, argument is sphenic
```
**example**
argument = `30`:
prime factors are `2`, `3` and `5`
other divisors are `1`, 2\*3=`6`, 2\*5=`10` and 3\*5=`15`
their product: `1*2*3*5*6*10*15` is `27000` == `30**3`
[Answer]
# VB.NET (.NET 4.5), 104 bytes
```
Function A(n)
For i=2To n
If n Mod i=0Then
A+=1
n\=i
End If
If n Mod i=0Then A=4
Next
A=A=3
End Function
```
I'm using the feature of VB where the function name is also a variable. At the end of execution, since there is no return statement, it will instead pass the value of the 'function'.
The last `A=A=3` can be thought of `return (A == 3)` in C-based languages.
Starts at 2, and pulls primes off iteratively. Since I'm starting with the smallest primes, it can't be divided by a composite number.
Will try a second time to divide by the same prime. If it is (such as how 60 is divided twice by 2), it will set the count of primes to 4 (above the max allowed for a sphenic number).
[Try It Online!](https://tio.run/##hdJRS8MwEAfw596nOPYgK1JJ02xjDxGCOhhYXxz44ku3ZXrQXaBNxW9fY1UMKCRvCb/8udzljfqhaYt909OhYOuLs2M31u44tBbrEm7pjIRNj8Tevthu3Ax88OQYzZxz2LgOScudQ4btCRnDzXAgdq@WwVzqEvhZE9zxEbenPwKNVvBg3z0YbXQ1sZ/8MXsc9lg3xJBlN45719qrp468vSe281klEItrnOFFqKQSeQ4Zfq9/dCnLXx02CS6riIdNKn2hovSFSnCFUelJLGSEhUzw1TrKXq0TWsSVpHq4jDu@TGoV6@mVn@MNQ53G/PXDxg8)
[Answer]
# JavaScript (ES6), 80 bytes
```
n=>(p=(n,f=2)=>n%f?p(n,f+1):f,(a=p(n))<n&&(b=p(n/=a))<n&&(c=p(n/=b))==n&a<b&b<c)
```
Using a recursive function to get the smaller factor.
Output 1 if sphenic, false if there are 2 or less factors and 0 otherwise
**Test**
```
F=
n=>(p=(n,f=2)=>n%f?p(n,f+1):f,(a=p(n))<n&&(b=p(n/=a))<n&&(c=p(n/=b))==n&a<b&b<c)
;[30,121,231,154,4,402,79,0,60,64,8,210].forEach(
  x=>console.log(x,F(x))
)
```
[Answer]
# Dyalog APL, ~~51~~ ~~49~~ ~~48~~ ~~46~~ ~~45~~ 43 bytes
```
1∊((w=×/)∧⊢≡∪)¨(⊢∘.,∘.,⍨){⍵/⍨2=≢∪⍵∨⍳⍵}¨⍳w←⎕
```
[Try it online!](http://tryapl.org/?a=%7B1%u220A%28%28w%3D%D7/%29%u2227%u22A2%u2261%u222A%29%A8%28%u22A2%u2218.%2C%u2218.%2C%u2368%29%7B%u2375/%u23682%3D%u2262%u222A%u2375%u2228%u2373%u2375%7D%A8%u2373w%u2190%u2375%7D30&run) (modified so it can run on TryAPL)
I wanted to submit one that doesn't rely on the dfns namespace whatsoever, even if it is **long**.
[Answer]
# J, ~~15~~ ~~14~~ 19 bytes
Previous attempt: `3&(=#@~.@q:)~*`
Current version: `(*/*3=#)@~:@q: ::0:`
# How it works:
```
(*/*3=#)@~:@q: ::0:  Input: integer n
               ::0:  n=0 creates domain error in q:, error catch returns 0
            q:       Prime factors of n
         ~:@         Nub sieve of prime factors 1 for first occurrence 0 for second
(*/*3=#)@            Number of prime factors is equal to 3, times the product across the nub sieve (product is 0 if there is a repeated factor or number of factors is not 3)
```
This passes for cases 0, 8 and 60 which the previous version didn't.
[Answer]
# Regex (ECMAScript), 46 bytes
```
^((?=(xx+?)\2*$)(?=(x+)(\3+$))\4(?!\2+$)){3}x$
```
[Try it online!](https://tio.run/##TY/BbsIwEER/BSIEu6QJCdAecE1OPXDh0B6bVrJgcdwax7INpFC@PQ2VKvU2ozfS6H2Io/Abp2xIvFVbcvvafNJX67ihU@@Z5FNjAc58ORm37wAFh6aJCyyn4wH@thihnMUDxHIORb@c3uJldm0G7XhyxjTUL8EpIwFTr9WG4OEumSMyzzN2qpQmAM0dia1WhgCxz81Ba7xIrlNvtQowSkbI1A7AcJlqMjJUuJx@fyu/FmtQ3ArnaWUCyNfsDfEP0H9glnmRL24YQ@XqU7QyR6HVtueEkbToRbFmu9oBU4@cmIpj7A6jJkodWRIBFKZ7ETYVuE7OD4e2Uwpws8iZPQQfXDdh12ubJfl9lv0A "JavaScript (SpiderMonkey) – Try It Online")
This works similarly to [Match strings whose length is a fourth power](https://codegolf.stackexchange.com/questions/19262/match-strings-whose-length-is-a-fourth-power/21951#21951) and very similarly to part of [Is this a consecutive-prime/constant-exponent number](https://codegolf.stackexchange.com/questions/164911/is-this-a-consecutive-prime-constant-exponent-number/179412#179412):
```
^
(                   # Loop the following:
    (?=(xx+?)\2*$)  # \2 = smallest prime factor of tail
    (?=
        (x+)(\3+$)  # \3 = tail / {smallest prime factor of tail}; \4 = tool to make tail = \3
    )\4             # tail = \3
    (?!\2+$)        # assert that tail is no longer divisible by \2
){3}                # Execute the loop exactly 3 times
x$                  # assert tail == 1
```
]


[Question]
      [
The [Fibonacci sequence](http://oeis.org/A000045) is a sequence of numbers, where every number in the sequence is the sum of the two numbers preceding it. The first two numbers in the sequence are both 1. Here are the first few terms:
```
1 1 2 3 5 8 13 21 34 55 89 ...
```
---
Write the shortest code that either:
* Generates the Fibonacci sequence without end.
* Given `n` calculates the `n`th term of the sequence. (Either 1 or zero indexed)
You may use standard forms of input and output.
(I gave both options in case one is easier to do in your chosen language than the other.)
---
For the function that takes an `n`, a reasonably large return value (the largest Fibonacci number that fits your computer's normal word size, at a minimum) has to be supported.
---
### Leaderboard
```
/* Configuration */
var QUESTION_ID = 85; // Obtain this from the url
// It will be like https://XYZ.stackexchange.com/questions/QUESTION_ID/... on any question page
var ANSWER_FILTER = "!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe";
var COMMENT_FILTER = "!)Q2B_A2kjfAiU78X(md6BoYk";
var OVERRIDE_USER = 3; // This should be the user ID of the challenge author.
/* App */
var answers = [], answers_hash, answer_ids, answer_page = 1, more_answers = true, comment_page;
function answersUrl(index) {
  return "https://api.stackexchange.com/2.2/questions/" +  QUESTION_ID + "/answers?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + ANSWER_FILTER;
}
function commentUrl(index, answers) {
  return "https://api.stackexchange.com/2.2/answers/" + answers.join(';') + "/comments?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + COMMENT_FILTER;
}
function getAnswers() {
  jQuery.ajax({
    url: answersUrl(answer_page++),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      answers.push.apply(answers, data.items);
      answers_hash = [];
      answer_ids = [];
      data.items.forEach(function(a) {
        a.comments = [];
        var id = +a.share_link.match(/\d+/);
        answer_ids.push(id);
        answers_hash[id] = a;
      });
      if (!data.has_more) more_answers = false;
      comment_page = 1;
      getComments();
    }
  });
}
function getComments() {
  jQuery.ajax({
    url: commentUrl(comment_page++, answer_ids),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      data.items.forEach(function(c) {
        if (c.owner.user_id === OVERRIDE_USER)
          answers_hash[c.post_id].comments.push(c);
      });
      if (data.has_more) getComments();
      else if (more_answers) getAnswers();
      else process();
    }
  });
}
getAnswers();
var SCORE_REG = /<h\d>\s*([^\n,<]*(?:<(?:[^\n>]*>[^\n<]*<\/[^\n>]*>)[^\n,<]*)*),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/;
var OVERRIDE_REG = /^Override\s*header:\s*/i;
function getAuthorName(a) {
  return a.owner.display_name;
}
function process() {
  var valid = [];

  answers.forEach(function(a) {
    var body = a.body;
    a.comments.forEach(function(c) {
      if(OVERRIDE_REG.test(c.body))
        body = '<h1>' + c.body.replace(OVERRIDE_REG, '') + '</h1>';
    });

    var match = body.match(SCORE_REG);
    if (match)
      valid.push({
        user: getAuthorName(a),
        size: +match[2],
        language: match[1],
        link: a.share_link,
      });
    else console.log(body);
  });

  valid.sort(function (a, b) {
    var aB = a.size,
        bB = b.size;
    return aB - bB
  });
  var languages = {};
  var place = 1;
  var lastSize = null;
  var lastPlace = 1;
  valid.forEach(function (a) {
    if (a.size != lastSize)
      lastPlace = place;
    lastSize = a.size;
    ++place;

    var answer = jQuery("#answer-template").html();
    answer = answer.replace("{{PLACE}}", lastPlace + ".")
                   .replace("{{NAME}}", a.user)
                   .replace("{{LANGUAGE}}", a.language)
                   .replace("{{SIZE}}", a.size)
                   .replace("{{LINK}}", a.link);
    answer = jQuery(answer);
    jQuery("#answers").append(answer);
    var lang = a.language;
    lang = jQuery('<a>'+lang+'</a>').text();

    languages[lang] = languages[lang] || {lang: a.language, lang_raw: lang, user: a.user, size: a.size, link: a.link};
  });
  var langs = [];
  for (var lang in languages)
    if (languages.hasOwnProperty(lang))
      langs.push(languages[lang]);
  langs.sort(function (a, b) {
    if (a.lang_raw.toLowerCase() > b.lang_raw.toLowerCase()) return 1;
    if (a.lang_raw.toLowerCase() < b.lang_raw.toLowerCase()) return -1;
    return 0;
  });
  for (var i = 0; i < langs.length; ++i)
  {
    var language = jQuery("#language-template").html();
    var lang = langs[i];
    language = language.replace("{{LANGUAGE}}", lang.lang)
                       .replace("{{NAME}}", lang.user)
                       .replace("{{SIZE}}", lang.size)
                       .replace("{{LINK}}", lang.link);
    language = jQuery(language);
    jQuery("#languages").append(language);
  }
}
```
```
body {
  text-align: left !important;
  display: block !important;
}
#answer-list {
  padding: 10px;
  width: 290px;
  float: left;
}
#language-list {
  padding: 10px;
  width: 290px;
  float: left;
}
table thead {
  font-weight: bold;
}
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="https://cdn.sstatic.net/Sites/codegolf/all.css?v=ffb5d0584c5f">
<div id="language-list">
  <h2>Shortest Solution 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>
<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>
<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>
```

[Answer]
# [APL(Dyalog Unicode)](https://dyalog.com), 16 bytes [SBCS](https://github.com/abrudz/SBCS)
```
{‚äÉ‚äÉ(+/,‚äÉ)‚ç§‚ä¢/‚çµ/1}
```
[Try it on APLgolf!](https://razetime.github.io/APLgolf/?h=AwA&c=c3vUNqH6UVczEGlo6@sAKc1HvUsedS3Sf9S7Vd@wFgA&f=e9Q39VHbBLdDKx71bjYyAAA&i=AwA&r=tryapl&l=apl-dyalog&m=dfn&n=f)
Straightforward "repeatedly add previous two elements" style approach. Not as short as [using pascal's triangle](https://codegolf.stackexchange.com/questions/85/fibonacci-function-or-sequence/223225#223225), but I'm still pretty proud of this :-)
-1 thanks to [Ad√°m](https://codegolf.stackexchange.com/users/43319/ad%c3%a1m) for reminding me of the atop operator, also known as the "atoperator". Also from Ad√°m, an optional "full program" version of this for -2:
```
‚äÉ‚äÉ(+/,‚äÉ)‚ç§‚ä¢/‚éï/1
```
Code breakdown:
```
{‚äÉ‚äÉ(+/,‚äÉ)‚ç§‚ä¢/‚çµ/1} full dfn
             ‚çµ/1  make a list of n 1s
            /      reduce over them with the following tacit function
          ‚ç§‚ä¢       apply the following tacit function(?) to only the
                   previous element (in js, think (a,b)=>f(a))
    (  , )          return a list of
     +/               sum of elements ([5,3]=>8)
        ‚äÉ             first element ([5,3]=>5)
                      ‚çù([5,3]=>[8,5])
                   after the reduce, you're left with
                   a scalar of the value [fib(n),fib(n-1)]
  ‚äÉ                take the first element of this scalar (the array)
 ‚äÉ                 take the first element of the array (this is the end result)
```
As you can see, I'm still learning how APL works :P
If there are any terminology fixes you want to make in my explanation, go ahead; You have my blessing.
[Answer]
# [Seed](https://github.com/TryItOnline/seed), ~~4694~~ 4502 bytes
```
39 23345386873944734309285705649562214322923535338513787840726059344836991733232701124858784406171983413525769035739193091317312821286862091673034093258254737808529480740867073160694207283540732802589654087348246306424108351751311067631335648365532710947883728455312678903999543414986443810435493370315134647072481870757046559560767136040676281671376819795324434856453735428264762843673716931661746853554648863000837820618766325590788356124601042099541341483064315601051750207795784533758073620813013115058115202328602261019521188162907432705317709462265407997435677959431637608739188384820535674569023665708824769117130584628086812767619300150936306513016713438624735631896208226558553705578499273228365561706607508974248633654644472401969256417949202545503229189330457914013293106347633234904257897628188377211123547522316430704423351649833550317940803484242023657434716958957587230473447472170005697587796499855927956924703860969370032077181183813997697920001129271041258462117064842855557817828287309864524148521039064850419014169734078927801370682493891194692916817142423371375512874755307643229558474820620773013367601053438535142499961672800471263088573030714197841432529737819978024272023115971994335629080760807110601625840500005576870897474597727212673444634680054468191797452281171657965522840129388173724585980135600170025063620602628298627811946062091546889131371926823568681212834659514998682306098670560578318063077703702015608052686405555782215469820110984687203004291914156230320625462064509758167591458209331235212640744714944466265540624319127738893716421169144022527159634296736260757337640921918849758954315864968212488657203226533587353649351778992581839569265033006103790337825946891770665589403131544197363786202809251067880755092540881383788858825619755294045426872602952477879200662412263820311579658891410984567942455376104064634087560919309116469779337448222971714205506106434861563361065264676346668562754032388044586603191705003186050941101737238753507972188516844227916598403811945061789829209022797794856907795280845148337927336190754837895578035971541077446106601429711198909985434167448288125565008326994953358507196336677928811063398215196756813330927829954298340363790942335608247284708980931664255175263323494474655761771711383684020341286483311232450751637188832338282365001980619004736926421020545780168645284628043949398052855672494054844858796879547004560821501647027627620931639915989753539985160519138882067784198444595441811191399424880792691274895217945599103951284792036009843684640644727200173221626567038906492094115422297154223582626065131092394499833564570471955561529154762920901660552470118203300492660926353444889031479441391716424199093929419050805652092712224713014163928963683320445942834620765638299957157761471954992453965174566767052457734421384797861892548612233678879032571407415763995799697084460449481011980933595196444998930307697403672188673825999360332797937744985054511100836407779016165673872373310879592118399300133957780585475517066306666920397584925551254210311998315301028471463539416320653567122160674748915331494295984381121190145666938252633808615711556028673805375510446823318750130981978154654997326727239404525161535622829359058005003740269566983082692378752252198224696254750416200980706704359975518565261545420238758226454680563033057001226125143840414367435620075434502664984902148647078854467653648067041037379150849558209574954581189083630370505506375071080959718696461782683034278484505125465265492405192125616634322283908654348532913099106491870966062276727286614470801650571178850146397543614007581120988735292604484768834605242986004904531743614154630006898576385883749714930636531225280325429278056803694383205579251797535306160456389603169599349989707250713018909969811190663566801819447003975601708056252841800628364818930316430260043879135073603348919031644234002981192629576497660461677947610006543231706577837438811265977164354969644885825582261812180155492583995120383156018469389467006878690072374841382066122175919585112489442594496493463386891710103741087324632245353507660394419350165419526162955982962335197477336304033108148298040661871462588450794544521467248068540365914505422139306015926783904272029251862004795498004645359369772500371366215160030879374914060894959826814924777847813129579229461420328680050563398486579073401384070598971755243256100966805691895631455236232588087146040702221938793149485419052426135144305222421870942178316091451568136489010664122415628294236744095902991276097097917
```
[Try it online!](https://tio.run/##LdiJlV03DAPQVlKC9if2E1eQ/s/kQuM4sTN/kUgQAPH8358///78zPpnzLn2vOd@s9b65pqtxt1f22fVPmP0NceoMbdf8@4@v/vd1b5x2q651p2nqn9zjjm@1vtYd@cTq53@9bpz9bnH/k61uV3Syw19@kYfd/jv3DO8cr7Z5mo1x75jq@S77e5R67ZvtXu@5hunnVrD5XduNcxxm4/X8YMG1h3rzHbWWL35RP@U23s735l9Th0pdm919lbru3c6aHmhj/Nd9VXVXgpedc9a8/a23FNzfm12Z62zlKHDfv0JpOU4KLXvfH2etnLVuD0/fef2@sptToLJAfPnNE07xafW1PLXT2kLVOtcEG9X3KuJpoHvDiDe7xyg7GqpeB8In6YyoKm2p9ybplWY19N1A5GrTcHMvg3BCePbZwseu@3r99FM7J42xumt1x69X6UP96yMEizfByccCL5fldf3ycHlsqPDgF6@NS/ofcG7axv0mOdA55qHuXc8mO50kpGCZYDrhAdNLTUzsp3aAhvUj285anaDVXWu39eUlJSWqobBjzdKuLUD/t2u6gzmTC/DEJXH0tWpAfn@1Sr9bsNuobOj52xrf9V9ag4zaGcqNjReBVw31ZtlWPLBppPA@vYYWicSs1@0s/2A4zPn5pZ2kfiqJOjCwOgzYhzd5vANl@Lp@pSn9EZllde/ckxpUm/4VBBogGjq17aSzbMbGqQ7lgL100@L3CpsXn08fHvwyP2OClgdhfwirTB6j3DFoDE9H9u@V60vBSoKvZx1weEMk6t5jc78C16m9vW0hU8@sDfhasJUcP85hBlpK4xNsWEafj9CZqa4ka8T2DFmPIAD1U0c2RF@czq53BW7ofrIv2uUvtf4AibGFj9BPdxAUqQ@@S36Rp3033YLpLyGPEMIbCzDgzWBg507kJmP@D/HG5hPoFIYalh8JD9hBELQgiLGQr0KKMTVMrKxMUWPhIMeA65Aezi152PYd28MDlA1AOmbj/QQczu76Bl13nBGxdgcbVb47mTYGf1HwZHzbdsRR2dvnNzY8QVkXZeBYxTs0JWtAhAwM2SBxkqJi7zQC@Lb23yV2maIHEAMHBEVE1xORMa@BmUXgX76r7jTwikSZufDXD5DgOGoE0eJ8Bg/AtgZPUawcl08tG9V14nBx8926oyQDQ8b9/Rm/BnlCJTI5mP9oSLt8KP5seMYIK854PyicxSjMMhCIWzhHF@WBzo5JT5/EYIU/USJpBIPxTBGxCrUln1C9msEORPkeksRT0wwICOcBFPYFjpkkutBzdpsniwL1hWjD5f4nyH9XWmwoqMv28JWHCTxPc2YXTo62QLHiOjCT@a6spdAz/hxSMW8RwPLoHha5vCF0XiBH4zYzB8lp1vnZsh4rTnaZEV8A4UVyjfCxtwJXQQ19Ja3lZY1VG81xInXzuaAND9Vkzf2CmAVqlnW6rdffBw/emxWM15zul0Zt8qqPK9ZWNtQxmdrDXlAdMikFcmCHZ6tkQ/FZaeiLFMUIgwukcBh0FlmI3GhZawuePZKAiZEkxG0MWdXMucsufHXrOOmJ6JHEoBn6BAhINXZb2kx5m12GszaApoqhRnynalZQy39x5vDQpz3dcsibniecf4uryUjlfqpksHyMbf7HPyTedAdsirFsNRtufUEBusu/77imTcJ8abEqWAo0sBC0TfW@cUBDREHKhy/QTuOn92G24qLOtfNujZPC6Pi5rHjFRYLIWFrEDgh6Yr7xbior0fkJ4sl7h9eoBTQH1Pzp4mNqDrbGOlHEmG97QaCL46NGoRERT6vpcctE0HxbCz7aTwBO9yLftOkXm6yVVefjuSF5yraNONpt2QH7TgdTYQKNOiw5IEVvIYUoB2zjjIAERe1YrQywxqLlVZN/5WXdCD0kG5PFKEwGvLKF/sfYFYFz7D/WYQ/NT1jG7EbO7/HFB2XOTEA6xfv0N/VxEN//ZFwxsUrKQM89daXT4a5T5LMMcZVog04Ij1WSifGHVaZaXQSAyYL@PWMZSYdEKLkmoSVNKaIZCSKUT@AbgLIfpHH7vBPBh7HhffOSt5hLrZnaN1qRuMbi88cKmii2EtpPWxAt2xss3Sr/rhhqINzLk8u2LkirURqiW6QwRjkHq9Hqz31tGxTOEqqGJ@okU2eTZVxYN4JCedzXjbtlGzw7E446qo9lwMfcrtS7cSjtzxp7GwdoKPEqay1L6HF/N0ig5muTFpx9n5DIIfH3tszyUTHlX2MWzPEROIWi4eUnMEkEjfOi7VO/GJosvNJpBMCPfrcF/iZ7IpZZ23dd2cWFJOicB/cb7HKeuiXZI3tN6E2gfWZP5QYIYpXPPVqZMWcLaE88jA/DuKTmV9agJrsimCWJ7UZdgIW3jv37PcwIbEG6MpaqTyM1En8SLAGtfVhYWMubjnXzNJCCw8qTXo33WbQYMw@puRwHFmEF/qKZhJtImVTE23ftzLTPJrYyDciyWY1uEqKmIlFeZQaWS4zXHxxksnThdjGc5PNsqm/X/9juideyZCy70wf4Z@k8pQVzFD47RqkiBOG@BiiLxRLh4/@J7ksF@Vmnqm@PB3kKS3afHF9pBWcANvO0xA2hPn13rZpADJyBxzIQKKRsdWWsMq2svKdCjo5FOsiR30nIwpSyZi5xNwy2pXAMfZjX0/uU@7OTHcEbcoM@PdZjUcnZKNWIGVLVlBMwBx6UsiJP/VkNw8Q@z1a6zqRaOV5wZxmntzjqC2MzFMvuXl5xARfSEiSiO/SWtiw8qB38pRndVDgec8wicrJAJ5O2nMgzAdHYk6ePxFH8eFoVg4XpowsP1q4iS3npcuWFcLfE2vtuDxSzzxJJb1n6Elqdkg8OvE/z8ObQyagP/17gD4JBiY144EhFqLapIkTFbn0KOPLkuQvqBaPtr2MaSVf3pftI3Y7eiV1yjQzD3j5C4v29m5PCMwzRkZa53lDHgfzvGmdCgQjfwPB7dJ2y/doD3ypKC5591tY9HF6HmqQa2djjSdDfyTJJxQy@hdwEJGZQjLp8mV02KJcklMcATrZ6b7i@wj6/fz8Dw "Seed ‚Äì Try It Online")
[Answer]
# [Desmos](https://desmos.com/calculator), 41 bytes
### Code in ticker:
```
l->join(l,l[L]+l[L-1])
```
### Code not in ticker
```
l=[1,1]
L=l.length
```
[Try it online](https://www.desmos.com/calculator/xvokybqceh)
[Answer]
## Dyalog APL, 17 characters (17 bytes SBCS)
```
{({‚çµ,+/¬Ø2‚Üë‚çµ}‚ç£‚çµ)‚ç∫}
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT9dNrShJzUtJTfn/v1qj@lHvVh1t/UPrjR61TQSyax/1LgZSmo96d9X@T3vUNuFRb9@jvqme/o@6mg@tNwYp6psaHOQMJEM8PIP/GyqkKRiZAgA "APL (Dyalog Extended) ‚Äì Try It Online")
The arguments are the initial sequence on the left, and the number of additional terms to generate on the right. The call can be made shorter by [replacing](https://tio.run/##SyzI0U2pTMzJT9dNrShJzUtJTfn/v1qj@lHvVh1t/UPrjR61TQSyax/1LgZSmoa1/9MetU141Nv3qG@qp/@jruZD641BSvqmBgc5A8kQD8/g/2kKRqYA "APL (Dyalog Extended) ‚Äì Try It Online") the `‚ç∫` with `1`, but then it can't generate an arbitrary sequence, only the one the question is actually about. Incidentally, replacing the `+` with a `-` will [produce the other half of the sequence](https://tio.run/##SyzI0U2pTMzJT9dNrShJzUtJTfn/v1qj@lHvVh1d/UPrjR61TQSyax/1LgZSmo96d9X@T3vUNuFRb9@jvqme/o@6mg@tNwYp6psaHOQMJEM8PIP/GygYKqQpGJkCAA "APL (Dyalog Extended) ‚Äì Try It Online").
As a bonus, the Java answer mentions Binet's formula (with rounding), which I [happened to have already written down](https://tio.run/##SyzI0U2pTMzJT9dNrShJzUtJTfn/v/pRT5eeqbbGo96tWo96V2g/6phxePuj3sW2QI6h5uHtplp6prX/0x61TXjU2/eob6qn/6Ou5kPrjR@1TQTygoOcgWSIh2fw/zSFR72bjUwB "APL (Dyalog Extended) ‚Äì Try It Online") (23 characters):
```
{‚åä.5+(‚çµ*‚ç®+‚àò√∑‚ç£=‚ç®1)√∑5*.5}
```
[Answer]
## Python
```
a,b,n=0,1,10
while n:a,b,n=b,a+b,n-1;print b
```
[Answer]
Python, 34 chars first variant, 31 chars for second variant,
```
a,b=1,1
while 1:print a;a,b=b,a+b
```
Second variant:
```
f=lambda x:x<2 or f(x-2)+f(x-1)
```
[Answer]
## Python O(1) Nth number, 91 char
48 characters for the import, a newline, 42 for the rest. I know it's longer than most here and that the question is a bit old, but I looked through the answers and I didn't see any that use the constant-time floating-point calculation.
```
from math import trunc as t,pow as p,sqrt as s
r=s(5);i=(1+r)/2;f=lambda n:t(p(i,n)/r+.5)
```
From there you call `f(n)` for the nth number in the sequence. Eventually it loses precision, and is only accurate up through `f(70)` (190,392,490,709,135). `i` is the constant Phi.
[Answer]
## Perl, 51 (Loopless)
The following code uses Binet's formula to give the Nth Fibonacci number without using any loops.
```
print((($p=5**.5/2+.5)**($n=<>)-(-1/$p)**$n)/5**.5)
```
[Answer]
## PHP - ~~109~~ ~~97~~ ~~88~~ 49 characters
```
<?for($a=$b++;;$b+=$a=$b-$a){$s+=$b%2*$b;echo$a;}
```
[Answer]
Perl - 39 chars
```
($a,$b)=($b,$a+$b||1),print"$b
"while$=
```
[Answer]
# C#
### Generated as a stream (65 chars):
```
IEnumerable<int>F(){for(int c=1,s=1;;){s+=c=s-c;yield return c;}}
```
Could be reduced to 61 characters using non-generic `IEnumerable`. Of course, if you include the required `System.Collections.Generic`, then it's a few more characters.
[Answer]
# APL: 26 characters
This is a function which will print out the `n` and `n-1` Fibonacci numbers:
```
{({‚çµ+.√ó2 2‚ç¥1 1 1 0}‚ç£‚çµ)0 1}
```
For example,
```
{({‚çµ+.√ó2 2‚ç¥1 1 1 0}‚ç£‚çµ)0 1}13
```
yields the vector:
```
233 144
```
[Answer]
**Mathematica,26 chars**
```
If[#>1,#0[#-1]+#0[#-2],#]&
```
[Answer]
## F# - 42 chars
```
Seq.unfold(fun(a,b)->Some(a,(b,a+b)))(0,1)
```
[Answer]
# [JAGL](https://github.com/globby/Jagl) V1.0 - 13 / 11
```
1d{cdc+dcPd}u
```
Infinite Fibonacci sequence. Or, if not required to print:
11 bytes
```
1d{cdc+cd}u
```
[Answer]
# Octave, 26 chars
```
f=@(n)([1 0]*[1 1;1 0]^n)(2)
```
Basically, a copy of my solution from [Calculating (3 + sqrt(5))^n exactly](https://codegolf.stackexchange.com/questions/48779/calculating-3-sqrt5n-exactly/48788#48788).
![[a b] x [1 1 ;1 0] equals [a+b a]](https://i.stack.imgur.com/gKY9a.gif)
, so
![[f(1) f(0)] x [1 1 ;1 0]^n equals [f(n+1) f(n)]](https://i.stack.imgur.com/5TCJa.gif)
It's a disaster to do unnecessary\* loops in Octave/Matlab. It's neither elegant, nor fast, let alone golfy.
---
\*All loops that can be vectorized are unnecessary :).
[Answer]
# ArnoldC, 451 bytes
```
IT'S SHOWTIME
HEY CHRISTMAS TREE a
YOU SET US UP 1
HEY CHRISTMAS TREE b
YOU SET US UP 1
HEY CHRISTMAS TREE c
YOU SET US UP 1
STICK AROUND c
TALK TO THE HAND a
GET TO THE CHOPPER a
HERE IS MY INVITATION a
GET UP b
ENOUGH TALK
TALK TO THE HAND b
GET TO THE CHOPPER b
HERE IS MY INVITATION b
GET UP a
ENOUGH TALK
GET TO THE CHOPPER c
HERE IS MY INVITATION 1e300
LET OFF SOME STEAM BENNET a
ENOUGH TALK
CHILL
YOU HAVE BEEN TERMINATED
```
This is actually my first ArnoldC program. Horrible for golfing, but great for lolz!
Produces an stream of Fibonacci numbers up to 1.1253474885494065e+274.
## Explanation
```
IT'S SHOWTIME               #start program
HEY CHRISTMAS TREE a        #declare a...
YOU SET US UP 1             #and set it to 1
HEY CHRISTMAS TREE b        #declare b...
YOU SET US UP 1             #and set it to 1
HEY CHRISTMAS TREE c        #declare c...
YOU SET US UP 1             #and set it to 1
STICK AROUND c              #while c is truthy
TALK TO THE HAND a          #output a
GET TO THE CHOPPER a        #assign a to...
HERE IS MY INVITATION a     #a...
GET UP b                    #plus b
ENOUGH TALK                 #end assignment
TALK TO THE HAND b          #output b
GET TO THE CHOPPER b        #assign b to...
HERE IS MY INVITATION b     #b...
GET UP a                    #plus a
ENOUGH TALK                 #end assignment
GET TO THE CHOPPER c        #assign c to...
HERE IS MY INVITATION 1e300 #whether 1e300...
LET OFF SOME STEAM BENNET a #is greater than a (returns 0 or 1)
ENOUGH TALK                 #end assignment
CHILL                       #end while
YOU HAVE BEEN TERMINATED    #end program
```
[Answer]
# Ruby, 28 bytes
```
->f{loop{f<<p(f[-1]+f[-2])}}
```
Usage:
```
->f{loop{f<<p(f[-1]+f[-2])}}[[-1,1]]
```
[Answer]
# ùîºùïäùïÑùïöùïü, 3 chars / 6 bytes (noncompetitive)
```
–ú»´√Ø
```
`[Try it here (Firefox only).](http://molarmanful.github.io/ESMin/interpreter2.html?eval=true&input=3&code=%D0%9C%C8%AB%C3%AF)`
More builtins!
`math.js + numbers.js = hella functions`
[Answer]
# [PARI/GP](http://pari.math.u-bordeaux.fr), 9 bytes
```
fibonacci
```
Alternate solution (21 bytes), for those disliking the built-in:
```
n->([1,1;1,0]^n)[1,2]
```
Alternate alternate solution (21 bytes):
```
n->imag(quadgen(5)^n)
```
I also posted all three solutions (in ungolfed form) to [Rosetta Code's Fibonacci page](http://rosettacode.org/wiki/Fibonacci_sequence#PARI.2FGP).
[Answer]
# Reng v.2.1, 18 bytes
(Noncompeting, postdates question)
```
11{:nAo}#xxx:)+x5h
```
`11` initializes the stack with 2 `1`s. `{:nAo}#x` sets the command `x` to mean "duplicate and output as number" (`:n`) then "output a newline" (`Ao`, A = 10). Then, `xx` prints the initial 2 `1`s. `:` duplicates the TOS and `)` rotates the stack, so it becomes `b a b`. `+` adds the two figures, making it `b (a+b)`. `x` prints and leaves this new result on the stack. `5h` jumps back `5` spaces, and the loop continues.
[Try it out here!](https://jsfiddle.net/Conor_OBrien/avnLdwtq/) [Or check out the github!](https://github.com/ConorOBrien-Foxx/Assorted-Programming-Languages/tree/master/Reng)
[Answer]
# Fuzzy Octo Guacamole, 11 bytes
```
01(!aZrZo;)
```
This takes the infinite route.
Explanation:
`01` pushes `0` and then `1` to the stack.
`(` starts a infinite loop.
`!` sets the register, saving the value on the top of the stack and storing it. It doesn't pop though.
`a` adds the 2 values.
`ZrZ` reverses the stack, pushes the register contents, and reverses again. This pushes the stored number to the *bottom* of the stack.
`o;` peeks and prints.
`)` ends the infinite loop.
Then the whole things starts again from the `(`.
---
As a a side note, this is quite fast to hit the max long size possible in Python. The last number it prints is `12200160415121876738`, and it repeats that forever.
[Answer]
# Python 2, 43 bytes
```
def f(n):k=9**n;return k**-~-~n/~-(k*~-k)%k
```
[Answer]
# Perl 5, 23 bytes
22 bytes, plus 1 for `-nE` instead of `-e`.
```
say$.-=$b+=$.*=-1;redo
```
[Hat tip.](http://c2.com/cgi/wiki?PerlGolf)
[Answer]
# [Cylon](https://github.com/tkaden4/Cylon) (Non-Competing), 12 bytes
The language is in development, Im just putting this up here.
```
1:√∏√å[:√¨+√Å])r
```
An explanation:
```
1    ;pushes a 1 to the stack
:    ;duplicates the top of the stack
√∏    ;reads a number from stdin, pushing it to the stack
√å    ;non-pushing loop, doesn't push counter to the stack, but deletes it
[    ;start of function, to be pushed to the stack
  :  ;duplicate top of stack
  √¨  ;rotate the stack, moving the copy to the back
  +  ;replaces top two objects on the stack with their sum
  √Å  ;push the result to the shadowing stack (non-consuming)
]    ;end of function
)    ;switch to shadowed stack
r    ;standard library call, reverses a stack
     ;stack implicitly printed
```
[Answer]
# bc, 21
```
for(b=1;b=a+(a=b);)a
```
The trailing newline is significant.
Outputs the entire sequence. `bc` has arbitrary precision arithmetic, so this continues forever.
[Answer]
# [OIL](https://github.com/L3viathan/OIL), 46 bytes
This program writes an infinite unstoppable stream of fibonacci numbers. It is mostly copied from the standard library but fit to the requirements and golfed.
```
14
add
17
17
14
swap
17
17
4
17
11
6
0
0
1
```
[Answer]
# [Python 2](https://docs.python.org/2/), 30 bytes
```
f=lambda n:n<3or f(n-2)+f(n-1)
```
[Try it online!](https://tio.run/##K6gsycjPM/r/P802JzE3KSVRIc8qz8Y4v0ghTSNP10hTG0QZav4vKMrMK9HITSzQSNNRKErMS0/VMNRRMDLV1NT8DwA "Python 2 ‚Äì Try It Online")
One catch: this outputs `True` instead of `1`. This is allowed by [this meta consensus](https://codegolf.meta.stackexchange.com/a/9067).
[Answer]
# [Gaia](https://github.com/splcurran/Gaia), 6 [bytes](https://github.com/splcurran/Gaia/blob/master/codepage.md)
```
0‚ÇÅ@+‚Çå‚Çì
```
I might make a built-in for this in the future, but built-ins are boring anyway.
### Explanation
```
0‚ÇÅ      Push 0 and 1
  @     Push an input
   +‚Çå‚Çì  Add the top two stack elements, without popping them, (input) times
        Implicitly print the top stack element.
```
[Answer]
# Python 2, ~~49~~ 40 chars
```
a,b=0,1
exec"a,b=b,b+a;"*input()
print b
```
### Function form, 44 chars
```
def f(n):a,b=0,1;exec"a,b=b,b+a;"*n;return b
```
My take on this challenge. Didn't find this kind of an answer yet. I hope it's a valid one.
Print's n:th Fibonacci number. Functions by multiplying the string inside exec n times and then executing it as Python.
Edit: input() instead of int(raw\_input())
]


[Question]
      [
# Challenge
So, um, it seems that, while we have plenty of challenges that work with square numbers or numbers of other shapes, we don't have one that simply asks:
Given an integer `n` (where `n>=0`) as input return a truthy value if `n` is a perfect square or a falsey value if not.
---
## Rules
* You may take input by any reasonable, convenient means as long as it's permitted by [standard I/O rules](https://codegolf.meta.stackexchange.com/q/2447/58974).
* You need not handle inputs greater than what your chosen language can natively handle nor which would lead to floating point inaccuracies.
* Output should be one of two consistent truthy/falsey values (e.g., `true` or `false`, `1` or `0`) - truthy if the input is a perfect square, falsey if it's not.
* This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") so lowest byte count wins.
---
## Test Cases
```
Input:  0
Output: true
Input:  1
Output: true
Input:  64
Output: true
Input:  88
Output: false
Input:  2147483647
Output: false
```

[Answer]
# [Ohm](https://github.com/nickbclifford/Ohm), 2 bytes
```
Æ²
```
Uses `CP-437` encoding.
## Explanation
Implicit Input -> Perfect square built-in -> Implicit Output...
[Answer]
# Java 8, 20 bytes
```
n->Math.sqrt(n)%1==0
```
Input is an `int`.
[Try it here.](https://tio.run/##hY7BCoJAEEDvfcVcgt2DkhAhiP2BXjxGh3Hdak1nzR2FCL/d1vIaXQZm3oM3NY4Y2E5TXd1n1aBzkKGh1wbAEOv@gkpDvqwApbWNRgIlPAKSib9OGz8cIxsFORCkMFNwzJBvoXv0LEhuozTdzcnidUPZeG/VR2sqaH1MFNwbup7OgPJbKp6OdRvagcPOI25IUKhEJD/Nn/yw/yPEsVy/nuY3)
[Answer]
# [Add++](https://github.com/SatansSon/AddPlusPlus), ~~24~~ ~~13~~ 11 bytes
```
+?
S
%1
N
O
```
[Try it online!](https://tio.run/##S0xJKSj4/1/bnitOz5RL1ZDLj8v/////RoYm5iYWxmYm5gA "Add++ – Try It Online")
I removed the clunky function at the top and rewrote it into the body of the question to remove 11 bytes.
As the first section is already explained below, let's only find out how the new part works
```
S   Square root
%1  Modulo by 1. Produced 0 for integers and a decimal for floats
N   Logical NOT
```
## Old version, 24 bytes
```
D,i,@,1@%!
+?
^.5
$i,x
O
```
[Try it online!](https://tio.run/##S0xJKSj4/99FJ1PHQcfQQVWRS9ueK07PlEslU6eCy/////9GhibmJhbGZibmAA "Add++ – Try It Online")
The function at the top (`D,i,@,1@%!`) is the main part of the program, so let's go into more detail.
```
D,     Create a function...
  i,   ...called i...
  @,   ...that takes 1 argument (for this example, let's say 3.162 (root 10))
    1  push 1 to the stack; STACK = [1, 3.162]
    @  reverse the stack;   STACK = [3.162, 1]
    %  modulo the stack;    STACK = [0.162]
    !  logical NOT;         STACK = [False]
+?     Add the input to accumulator (x)
^.5    Square root (exponent by 0.5)
$i,x   Apply function i to x
O      Output the result
```
[Answer]
# [Python 3](https://docs.python.org/3/), ~~28 27~~ 25 bytes
* Thanks to @mdahmoune for 1 byte: compare int of root squared with original
* 2 bytes saved: lambda shortened
```
lambda x:int(x**.5)**2==x
```
[Try it online!](https://tio.run/##K6gsycjPM/6fZhvzPycxNyklUaHCKjOvRKNCS0vPVFNLy8jWtuJ/QRFIKE3DUFOTC8Y2QmIbI7EtkdWgaDDV1PwPAA "Python 3 – Try It Online")
[Answer]
# [CJam](https://sourceforge.net/p/cjam), 12 bytes
```
{_),2f##)!!}
```
[Try it online!](https://tio.run/##S85KzP1flPm/Ol5TxyhNWVlTUbH2f91/MxMA "CJam – Try It Online")
[Answer]
# JavaScript on NodeJS & Chrome, 51 bytes
```
// OLD: t=n=>{i=Number.isSafeInteger;return i(n)&&i(n**.5)}
i=Number.isSafeInteger;t=n=>i(n)&&i(n**.5)
// TestCases:
let l=console.log;l(`t(1): ${t(1)}; t(64): ${t(64)}; t(88): ${t(88)};`)
```
[Try it online!](https://tio.run/##LYhBCsIwEEX3niILKUnBgKBSDHHvxo0XaKxjiYwTSaZuSs4eo3Tz/3vv6T4uDdG/eUPhDqWwJXuavb1MrxtE7dPVPeBMDCNEE4GnSMJLUk1Tt231XuUVAgu0Q6AUEDSG0aDsWW7VUazn32cjWB52i1f4h65bQoVselVK@QI "JavaScript (Node.js) – Try It Online")
[Answer]
# Python, ~~53~~ ~~50~~ ~~49~~ ~~48~~ ~~49~~ 48 bytes
This should in theory work for an input of any size. Returns `True` if the given number is a square, `False` otherwise.
```
f=lambda n,x=0:x<=n if~-(x<=n!=x*x)else f(n,x+1)
```
[Try it online!](https://tio.run/##RcrRCsIgFMbx@57iRDdaC7SJk8iHsU2Z4NxwBnbTq5sS2N35/b@zveO8@j5nI51anpMC3yVJ7ukhPVjzuaJ6HWU6J6zdrsGg8nChOG/B@ohIVwrB@PAjraSNnFVz1oIQNQjRwo2ygYmes6EOf2EMcIKgx1fY7erB2cXGYjXOespf "Python 3 – Try It Online")
### Explanation:
```
f=                                                # assign a name so we can call it
  lambda n,x=0:                                   # counter variable x
               x<=n                               # counter bigger than input?
                    if~-(         )               # "negate" inner condition
                         x<=n                     # counter not bigger
                            n!=x*x                # and n not square of x
                                   else f(n,x+1)  # else recurse
```
The condition is just a de-Morgan'd `if x>n or n==x**2`, i.e. we return if the counter is bigger than the input, or we found a proof for squareness.
Saved 1 byte thanks to Gábor Fekete.
[Answer]
# [Actually](https://github.com/Mego/Seriously), 6 bytes
```
;ur♂²c
```
[Try it online!](https://tio.run/##S0wuKU3Myan8/9@6tOjRzKZDm5L//zcAAA "Actually – Try It Online")
-2 bytes from Erik the Outgolfer
Explanation:
```
;ur♂²c
;ur       range(n+1) ([0, n])
   ♂²     square each element
     c    does the list contain the input?
```
This takes a while for large inputs - TIO will timeout.
[Answer]
# [C (gcc)](https://gcc.gnu.org/), ~~66~~ ~~43~~ 42 bytes
```
f(float n){return!(sqrt(n)-(int)sqrt(n));}
```
[Try it online!](https://tio.run/##PctBCsIwEEDRfU8xVoQZMCKCq4h3CUnTBpKpJtNV6dWNFYLL/@BbNVpbj4FtXNzwKOLCfJme3V@SkekHHn2cjZDuAgskExhphVfey2N/cv0ZPN7uBKQhD7JkhquGrbYPmNbGByzvLMikcJ@pBemt1o/10Yylqpi@ "C (gcc) – Try It Online")
Thanks to TheLethalCoder for the tip!
@hvd Thanks for saving a byte!
[Answer]
# [PowerShell](https://github.com/TryItOnline/TioSetup/wiki/Powershell), 26 bytes
```
!([math]::Sqrt("$args")%1)
```
[Try it online!](https://tio.run/##Xc7RCoIwFAbg@z3FaczYwCBrqAhB79BlREgd82KZbpMC89nXMDPw3P3f@Q@c@vFEbUpUyrECdtC5BT/ec1uesuzQaMspy/XNUBFEwvWE7DkBPyFfh8CsblGMOZrlWM4gTT0UuTKTbCKZyHQby@S/EfCGALqhwSrv@KrxYvHqf2PnL2s0rbIelv5lVg1IGR99hc10JLJfm5LefQA "PowerShell – Try It Online")
[Answer]
# MIPS, 112 bytes
```
main:li $v0,7
syscall
sqrt.d $f0,$f0
mfc1 $a0,$f0
li $v0,1
beqz $a0,t
li $a0,0
syscall
b e
t:li $a0,1
syscall
e:
```
[Try it online!](https://tio.run/##Ky7IzP3/PzcxM88qJ1NBpcxAx5yruLI4OTEnh6u4sKhEL0VBJc1AB4i5ctOSDRVUEiEcqGJDrqTUwiqwaAlYDMgwgBuQpJDKVWIFFTaEC6da/f9vZPIfAA "Assembly (MIPS, SPIM) – Try It Online")
Outputs `1` if the input is square, `0` if not.
## Explanation
```
main:li $v0,7      #Start of program. Load service 7 (read input as float to $f0).
                   #Input can be an integer, but MIPS will interpret it as a float.
syscall            #Execute.
sqrt.d  $f0,$f0    #Overwrite $f0 with its square root, stored as a double.
mfcl    $a0,$f0    #Move $f0 to $a0.
li      $v0,1      #Load service 1 (print int from $a0).
beqz    $a0,t      #Branch to label 't' if $a0 = 0. Otherwise continue.
#If input is non-square...
li      $a0,0      #Load 0 into $a0.
syscall            #Execute (print $a0).
b e                #Branch to label 'e'.
#If input is square...
t:li    $a0,1      #Start of label 't'. Load 1 into $a0.
syscall            #Execute (print $a0).
e:                 #Start of label 'e'. Used to avoid executing 't' when input isn't square.
```
A double in MIPS is 16 hexes. It shares its address with a float containing its low-order 8 hexes (`$f0` in this case). The high-order hexes are stored in the next register (`$f1`), also as a float.
```
          float             double
$f0     0000 0000     1111 1111 0000 0000
$f1     1111 1111
```
Taking the square root of a non-square number requires the entire double in order to be stored, meaning the high and low floats are populated. The square root of a square number only needs a few hexes from the double to be stored, and it is stored specifically in its high-order hexes. This means the low float is left at `0`.
If the low float equals `0`, the input is a square number.
[Answer]
# [Whitespace](https://web.archive.org/web/20150618184706/http://compsoc.dur.ac.uk/whitespace/tutorial.php), 95 bytes
```
[S S S N
_Push_0][S N
S _Duplicate_top][T N
T   T   _Read_STDIN_as_integer][N
S S N
_Create_Label_LOOP][S N
S _Duplicate_top][S N
S _Duplicate_top][T S S N
_Multiply_top_two][S S S N
_Push_0][T  T   T   _Retrieve_input][S N
T   _Swap_top_two][T    S S T   _Subtract][S N
S _Duplicate_top][N
T   S S N
_If_0_jump_to_Label_TRUE][N
T   T   T   N
_If_negative_jump_to_Label_FALSE][S S S T   N
_Push_1][T  S S S _Add][N
S N
N
_Jump_to_Label_LOOP][N
S S S N
_Create_Label_TRUE][S S S T N
_Push_1][T  N
S T _Print_as_integer][N
N
N
_Stop_program][N
S S T   N
_Create_Label_FALSE][S S S N
_Push_0][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.
Outputs `1`/`0` for truthy/falsey respectively. A few bytes could be saved if something like `00`/`0` for truthy/falsey is allowed instead.
[Try it online](https://tio.run/##JYxRCoBACES/x1N4iOg@EQv1FxR0fHfeijg4b9T/ur/xPsc5qjIzXAopesQhbklIGjiBgoiEA8ZabMKbBdTX9lX7NgE) (with raw spaces, tabs and new-lines only).
**Explanation in pseudo-code:**
```
Read STDIN as integer, and store it in the heap
Integer i = 0
Start LOOP:
  Integer temp = i*i - input from heap
  If(temp == 0):
    Call function TRUE
  If(temp < 0):
    Call function FALSE
  i = i + 1
  Go to next iteration of LOOP
function TRUE:
  Print 1 as integer
  Stop program
function FALSE:
  Print 0 as integer
  (implicitly stop the program with an error)
```
*Here a port of this approach in Java:*
```
int func(int input){
  for(int i=0; /*infinite loop*/; i++){
    int m = input - i*i;
    if(m==0) return 1;
    if(m<1) return 0;
  }
}
```
[Try it online.](https://tio.run/##XVBBboMwELznFaOcDCgJRFUVlfKEnnJse3AJVJvCGuF1pKrK2ykYtyU9eOWZ2d0Z7Vlf9OZ8@hiGstHW4kkTf60AK1qoBLGgdlyq6UPcOYkmFahNP3NFmmMXE9fEJBUaY7p4l4OSJHTCL2lRzPPYgGLKf6RatUWRRugrcT0jWwqP2S@fzvx1Nb2xdO6tGeOFlBdDJ7RjcnWUnvj9@RU6uEtlRaVR/geyJbi/W6LD4aZxn93CvYfef2ns1f/3OX5aqdqtcbLtxkjSsPJysn7Ai6yTcNRpIGy9DsM3)
[Answer]
# [Rockstar](https://codewithrockstar.com/), 55 bytes
First time posting a solution to one of my own challenges, if you'll forgive me the indulgence.
Outputs `1` for truthy or nothing for falsey.
```
listen to N
X's0
while N-X
let X be+1
if X*X is N
say 1
```
[Try it here](https://codewithrockstar.com/online) (Code will need to be pasted in)
[Answer]
# [V (vim)](https://github.com/DJMcMayhem/V), 34 bytes
```
C<C-r>=sqrt(<C-r>")
<esc>:s/.\+\.0\n
:s/.\+/1
```
[Try it online!](https://tio.run/##K/v/39nGWbfIzra4sKhEA8xU0uSySS1OtrMq1teL0Y7RM4jJ44Kw9Q25/v83NPivWwYA "V (vim) – Try It Online")
Returns empty string for a square, `1` for non-square.
## Explanation
```
C<C-r>=sqrt(<C-r>")
C                   cut the input line, enter insert mode
 <C-r>=             evaluate the following math command:
       sqrt(      ) square root of
            <C-r>"  cut input line in register "
<esc>:s/.\+\.0\n/
<esc>               exit insert mode
     :s/.\+\.0\n/   remove instance of <digits>.0
                    this removes a perfect square root.
:s/.\+/1            replace any other non-newline chars left with
                    a single 1.
```
[Answer]
# Knight, ~~32~~ ~~33~~ ~~32~~ 30 bytes
```
;=i+1=xP;W!>0=i-i 1|-^i 2xQ1Q0
```
[Try it online!](https://tio.run/##rVldU9tKEn22f8XgFLbGlhNJsFW3MDJFciFFLYEEks0D@AYhyzC1suyVZAgL7F/Pdvd8aGSb7Gb38mBZM6d7us/0dPeYuH8Txz9eiSxOF@NktyjHYvb6dti0R1JxXRuKy4d5sgTKRXZTGyrFVGLGyURkCUtTls6yG/pomtHPJ18@ML96Pf98xoLq9W/7Z2y7ej08ecd@q17PvjC/Ah8en1vYky/HFvTLyYf98786BWcOfrTZv/y/cDO7fw7Lysn4NspZl1cCNgpsNSqGQ7ZdzZ0cfMXJDCbJoyeG33d3lzC4DGHQTcCkKUdgDfP29PSYQPixR07uoG@WIWfvJQDkLVvvonSRcH6RjXizSX7ArlyMwrPWwemh82MQip4ffv84@Lox9ELRF8x/6v8hWPD9k//J@8EB1BpIuS4IJtGUhahh0GzCMvMoLxKHs8dmQ2QlE4NmA0ZpSZd1J4sshhESjuG9nM7dYp5dBKPw0XO9Z9DREKCO8PD0cODNG1Qv5uz@VpRJMY/ipNmA72niwDiIO9IMl7Uuy8vscnKZs8fni5HDd161OJnSEBPmGGtD1nnV4Uyq0KMbMHqZwXCvJ0fAzkaSFok98CzNiW@T@O9sMstZtpheJ3mh7GGOKMbiRpRaK6yO7viu8Ug@u8z3WI91leW9Hmd91vE6sARaKjjLk3KRZ0wHiRSjOBks23AX5SK6ThNtBRiRzu6T3IlhPW0Ie3pi2riY3mIi4luHK3rEGtdF6LuwR6EZXrIOj50KT4Bk48XcwS1litM@g7dVg2USKKQ2acZlp1PZ1OrITQNh8MAYxUAJJA34DpbNo6Jk5W0CyqK8BLDagK5mFDc05uiJNtY6Sy8aC58@p41uVGSQ@Ri6pZhlYDZGrDcC02LNSLGYz5FwrqNKj9j02/EHtFtkow4dyvMM4hgSGEauslyy8rljTrkcOMQBTGY7mMTQTB1klP@kqw7ajaZGaTqLnW3P9Tk6iMPGCXIwW6RplD/Yjlb7c2Ztz8eOsYwWVPKLbEmalvBxCZUU1nm6f/D23dWnjePfTy2HbbXXYq3eYFXvRk3x@6PzFzSWSU4qo2zM/rGI9CuqvbOX2FpdQhLwvmO4OFrDBQlv14XrmGdKlfkiwx0aqCTcLWeFo3MlHQAI7VLEjGavF5OLYHuk7JAb3ab0YAwo5nCsyokDUPB/M03HLZ13qAi5qGRZARwKo0CWN7l@DbfL/K26n@g8xuIea5X5ImlBDJpxDEkYn0SQQXCihZHVqkhAP9F3VYeIjm9vZ7MUZq7rDLzoa@XWzxzq/rpHtpnXK2amaGP2p9oIQVvO0tSxTXWZ50KF@B9MzlZMxir8Yf/jiYu1WAYavB5d@J7nQTiBK/Cq3wrxz@RbyfAxsGLU8hYZgDcXPwL63Ap9XdIxw2FVxwd9BvKxBYDDo@ODLptAchw0TGir9TANx9HcTZOMOgCLK90mSc7g3L1ExrIg1iYsbVhwHEG9BNTiXeJiAEVF4KTJG/F0vrQDRJIYVSkEaRIjXKa4F2V863SBmZWuCjhi6i/GOtXZ7@wwXEUCQiQU@zLIwrxNTin1qjOshSwfUBWuENR@ljmWLupAL0b8sQozaKAot8uFz2Dhuu4cMp7D2973Cf5VyI@ABK2So5ukTKF5dNq0l23cISyRY5HxgZg4Du0nNgTxbY62uBCnnMttDr3BWlvhwakNkOsdyPVk54jZQBEy0PYiSSp3Vla@rfyReDPzrppBSZtig7kCDEYDxF84n82TzLEWdlt5i1oFsCqcykoJ8RgG3vZvNK6aC0d2JBMwfYxOQQsHIetifwdw6B3oDdeApXV4OTDIeiG1QnhiAckV3aCH1iKqUUM3ZIHds1Q0Vp58Ak@S79DG4Wlf8XOjtut0R9jATLYCPF4JD1glrfNiwX/v7Kg@cU0gm8ynKlDrhNpiB2sQ10VoONzmVWO5kg616Dk1h85mgYL1w7AqDHRC62OvC5mUtyqonsDykkSZUvtSCVM1y94BlVsUC6cVC3gw5MUHSZP7WaOOtdt0ser3ETqSbe4ltdsNbdbm624B9jjwxpk@arll/qIs9O6bmJC9njSoZwyiPAn5ElMyhpa1PbKbbtR3W95SEQ19P9OxFMg9x/6XDoPcAELhMJ7yUHsZ8PWhGkelfqiu0@9VNHH9HXVx6EZdepYqRyi/@ivRaUU7tup1e6VQt9qdNSwsl@c1PHRXeJD7uo6F6RrXuoQJbSUkADXIoQwZdi7hkoegQb9P@hRRVDKXN1oyWtZO/5ufEvNmPTGbPxXaXC/0B7FZc0heHWgssL0cKNol6yHr@4ZlwgL1Ppyzvg9nzLfBwS@idyE91rBhiFBad0ePeJpyIjoYeorrgFO70g2J/@bygaBJcgXuCJRgscTAd7wy3CZ50ilYNoMeWqSlyNh99AC8sfEM7qRlcpPkIDOfZUlWighvEXCSZ@w@YbfRXQJApQjhJZtG2QLC5@E1jqJ318g4UEFMFIu0xB8NaHGT8DSkb2P0kkuU2XIGsqQe9b2M9F42xMB2ayiP7udRirXxAbzOxmkyZleV2VdGyyN@k42ZtUjlzBCV9fv6nRO8oaBdy/Rnkwd3KViXCh8mvVpeDOtZcY/Zh3/XPgYouqN@f2szCdhjtUaRBl1mZUPU4UlJXXIDWQcQuxFCtbG6oCEcSgyt2Xi2w6bJNJ5jmGVseLX3/7oy/BNcGWpXNtb4EipflCt7L7MvV11jMk7vsRogMIhAF9CNdXZWL8Y9nXlsBca8dpX@0Jd1tWHPllSpxMg//TfyKgdZaoz8oLNjo2tt7jI2rLJuffqXLzK6t61uMohr1G4zJhUSBjWOwpq0lSZRAhG9nhGTJn8F9@SvXnajWfOO2b2LEjuqd@0IteT3gp0ti5b38soQWh1Wzy5Aq3ekTF08XHMWtmoN7bkkeknpYLnkBetK3hY3fUBgpLdp8D80RGgYPnErYtP8m3bI7o0C8BBX7fnYJFGDIONfTtKDED11EmD1cTKJIEmCZ7rDFBlMijH9iBTFJZSpzmbcwZ4TRzh74RaLykwNhG5Q/ZAwjUSGzSqL8pvYJaXdLny/4/hzFd0v8d85jkfW1K9xzz/8fwM "C (gcc) – Try It Online")
Takes input from standard in, outputs by error code (1 if input is square, 0 otherwise).
Expanded code:
```
;=i +1 (=x PROMPT)
;WHILE !> 0(=i -i 1)
  | (-(^i 2) x)
    QUIT 1
QUIT 0
```
---
+1 bytes from @Jonah because I somehow didn't notice this failed on input `1`
-2 bytes from @Jonah by using short circuit evaluation of `|` instead of `IF`
[Answer]
# Pyth, 5 bytes
```
/^R2h
```
[Try it here!](http://pyth.herokuapp.com/?code=%2F%5ER2h&test_suite=1&test_suite_input=0%0A1%0A64%0A88&debug=0)
[Answer]
# [QBIC](https://drive.google.com/drive/folders/0B0R1Jgqp8Gg4cVJCZkRkdEthZDQ), ~~16~~ 18 bytes
```
[:|~b/a=a|_Xq}?b=0
```
*Added two bytes for 0-case*
This runs through `i = 1 ... n` to see if `n / i == i`. Prints `1` if such an `i` is found, prints `-1` for `N=0` and `0` in all other cases. Both `1` and `-1` are considered truthy in QBasic (`-1` being the actual value for true, but `IF (n)` only is false on `n=0`).
[Answer]
# J, 8 bytes
```
(=~<.)%:
```
Explanation:
* `%:` square root
* `=~` is the argument equal to itself
* `<.` floor of
* `=~<.` a J hook, which modifies the right argument by applying `<.`
* so, "is the floor of the square root equal to itself?"
Note: If we want to save the above to a variable as a verb, we must do, eg:
```
issq=.(=~<.)@%:
```
[Answer]
# C, 33 bytes
```
#define f(x)sqrt(x)==(int)sqrt(x)
```
Takes an integer `x`. Checks if the square root of `x` is the square root of `x` rounded to an integer.
[Try it online!](https://tio.run/##S9ZNT07@r5yZl5xTmpKqYJObWJKhl2H3XzklNS0zL1UhTaNCs7iwqARI2dpqZOaVwHj/cxMz8zQ0qwuKgIJpGkqqKUo6aRpmJpqa1rX/AQ)
[Answer]
# [Pari/GP](http://pari.math.u-bordeaux.fr/), 8 bytes
```
issquare
```
[Try it online!](https://tio.run/##K0gsytRNL/ifpmCr8D@zuLiwNLEo9X9afpFGHlDEUEfB0MBAR6GgKDOvRCNPR0FJQddOQUlHIU0jT1NT8z8A "Pari/GP – Try It Online")
[Answer]
## Pyke, 3 bytes
```
,$P
```
[Try it here!](http://pyke.catbus.co.uk/?code=%2C%24P&input=3)
```
,   -   sqrt(input)
 $  -  float(^)
  P - is_int(^)
```
This could be two bytes (and is in older versions) if Pyke didn't helpfully automatically cast the results of sqrt to an integer if it's a square number.
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 8 bytes
```
¬﹪ＸＮ·⁵¦¹
```
[Try it online!](https://tio.run/##S85ILErOT8z5///Qmvc7V73fs@P9nnWHtj9q3Hpo2aGd//@b/NfN/G/43/K/oel/I4P/uvn/dcHwPwA "Charcoal – Try It Online")
### Explanation
```
¬           Not
 ﹪      ¦¹ Modulo 1
   Ｘ  ·⁵   To the power of .5
     Ｎ     Next input as number,
```
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), ~~5~~ 3 bytes
```
t.ï
```
[Try it online!](https://tio.run/##MzBNTDJM/f@/xOXw@kcNuw53/P9vyQUA "05AB1E – Try It Online")
~~Longer than @Erik's but just wanted to give it a shot.~~
Now shorter than Erik's but fails for large numbers...
# Explanation
```
t            # square roots the input
 .ï          # checks if number on stack is an int
             # implicit output of result (0 or 1)
```
[Answer]
# **Python 3,** ~~39~~ 38 Bytes
```
lambda n:n in(i*i for i in range(n+1))
```
@mathmandan I had the same idea, and this implementation is 1 byte shorter. I wanted to comment on your post but do not yet have 50 reputation. I hope you see this!
This is just brute force, and I did not get it to complete `2147483647` in a
 reasonable amount of time.
Thanks @DJMcMayhem for suggesting i remove the space after `in`
[Try it Online](https://tio.run/##K6gsycjPM/6fZhvzPycxNyklUSHPKk8hM08jUytTIS2/SCETyFEoSsxLT9XI0zbU1PxfUJSZV6KRpgFkc8HYRkhsYyS2JbIaFA2mSBwzEySOhQXQDgA)
[Answer]
# Excel, ~~18~~ 16 bytes
```
=MOD(A1^0.5,1)=0
```
[Answer]
# Common Lisp, 30 bytes
```
(defun g(x)(=(mod(sqrt x)1)0))
```
[Try it online!](https://tio.run/##S87JLC74/18jJTWtNE8hXaNCU8NWIzc/RaO4sKhEoULTUNNAU/O/RkFRZl6Jgka6gpkJkAsA)
or, with the same length,
```
(defun g(x)(integerp(sqrt x)))
```
[Answer]
# [><>](https://esolangs.org/wiki/Fish), 22+3 = 25 bytes
```
01-\:*=n;
(?!\1+::*{:}
```
[Try it online!](https://tio.run/##S8sszvj/38BQN8ZKyzbPmkvDXjHGUNvKSqvaqvb///@6ZQqGZgA "><> – Try It Online")
Input is expected on the stack at program start, so +3 bytes for the `-v` flag.
[Answer]
# Ruby, 16 bytes
```
->n{n**0.5%1==0}
```
Trivial solution.
[Answer]
# [tinylisp](https://github.com/dloscutoff/Esolangs/tree/master/tinylisp), 67 bytes
```
(load library
(d S(q((n)(contains?(map(q((x)(* x x)))(c 0(1to n)))n
```
[Try it online!](https://tio.run/##FYo5DoAgEEV7T/HLP1ZYWHsITzAuMSQ4KFLA6VHLt2RvNfjnao0h6obgl6Spdtww8yZNuEbL6u2ZeOr1uyLsUVBEvgjHIUfYB9b@AzOY1I4dDqMTaS8 "tinylisp – Try It Online")
Generates a list of numbers from 0 through `n`, maps a lambda function that squares each one, and checks if `n` is in the resulting list of squares. Wildly inefficient, of course.
---
Here's a 77-byte solution that doesn't use the library and runs an order of magnitude faster:
```
(d _(q((x n s)(i(e n s)1(i(l n s)0(_(a x 1)n(a s(a x(a x 1
(d S(q((n)(_ 0 n 0
```
[Try it online!](https://tio.run/##JYuxDYQwEARzqthwLzMBlbgA6xAIWfLfg/0BVO8/INpZaeaX7Sq57b1zQeJBnjA0Yeb6wOhUHgpMVJwYxXzbze8fPI13asKE4HLoLF9dUPJctV4y8KM7IljVttWVKYj0Pw "tinylisp – Try It Online")
This one uses a helper function `_` which tracks a counter `x` and its square `s`. At each level of recursion, we return success if `s` equals `n` and failure if `s` is greater than `n`; otherwise, if `s` is still less than `n`, we recurse, incrementing `x` and calculating the next `s` by the formula `(x+1)^2 = x^2 + x + x + 1`.
[Answer]
# [Julia 0.6](http://julialang.org/), 12 bytes
```
n->√n%1==0
```
[Try it online!](https://tio.run/##yyrNyUw0@19s@z9P1@5Rx6w8VUNbW4P/BUWZeSU5eRrFehqGVkYGmpr/AQ "Julia 0.6 – Try It Online")
Pretty straightforward, having the Unicode `√` for square-root saves a few bytes.
]