[Question]
      [
## Introduction
In our recent effort to collect catalogues of shortest solutions for standard programming exercises, here is PPCG's first ever vanilla FizzBuzz challenge. If you wish to see other catalogue challenges, there is ["Hello World!"](https://codegolf.stackexchange.com/questions/55422/hello-world) and ["Is this number a prime?"](https://codegolf.stackexchange.com/questions/57617/is-this-number-a-prime).
## Challenge
Write a program that prints the decimal numbers from 1 to 100 inclusive. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”.
## Output
The output will be a list of numbers (and Fizzes, Buzzes and FizzBuzzes) separated by a newline (either `\n` or `\r\n`). A trailing newline is acceptable, but a leading newline is not. Apart from your choice of newline, the output should look exactly like this:
```
1
2
Fizz
4
Buzz
Fizz
7
8
Fizz
Buzz
11
Fizz
13
14
FizzBuzz
16
17
Fizz
19
Buzz
Fizz
22
23
Fizz
Buzz
26
Fizz
28
29
FizzBuzz
31
32
Fizz
34
Buzz
Fizz
37
38
Fizz
Buzz
41
Fizz
43
44
FizzBuzz
46
47
Fizz
49
Buzz
Fizz
52
53
Fizz
Buzz
56
Fizz
58
59
FizzBuzz
61
62
Fizz
64
Buzz
Fizz
67
68
Fizz
Buzz
71
Fizz
73
74
FizzBuzz
76
77
Fizz
79
Buzz
Fizz
82
83
Fizz
Buzz
86
Fizz
88
89
FizzBuzz
91
92
Fizz
94
Buzz
Fizz
97
98
Fizz
Buzz
```
The only exception to this rule is constant output of your language's interpreter that cannot be suppressed, such as a greeting, ANSI color codes or indentation.
## Further Rules
* This is not about finding the language with the shortest approach for playing FizzBuzz, this is about finding the shortest approach in every language. Therefore, no answer will be marked as accepted.
* Submissions are scored in bytes in an appropriate preexisting encoding, usually (but not necessarily) UTF-8. Some languages, like Folders, are a bit tricky to score--if in doubt, please ask on Meta.
* Nothing can be printed to STDERR.
* Feel free to use a language (or language version) even if it's newer than this challenge. If anyone wants to abuse this by creating a language where the empty program generates FizzBuzz output, then congrats for paving 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.
* 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 and ???), consider adding a note to the existing answer that the same or a very similar solution is also the shortest in the other language.
* Because the output is fixed, you may hardcode the output (but this may not be the shortest option).
* You may use preexisting solutions, as long as you credit the original author of the program.
* Standard loopholes are otherwise disallowed.
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.
## Catalogue
```
var QUESTION_ID=58615;var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe";var COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk";var OVERRIDE_USER=30525;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.toLowerCase(),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>b.lang_raw)return 1;if(a.lang_raw<b.lang_raw)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}#answer-list{padding:10px;width:290px;float:left}#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="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]
# [Perl 5](https://www.perl.org/) ([ppencode](https://esolangs.org/wiki/ppencode)-compatible), ~~1232~~ 690 bytes
Today I learned that `and` has higher precidence than `or` or `xor`; I suffered from making a proper control flow
```
eval q y eval q x ord or return cos while chop and chop and chop x and print chr ord uc qw q for q and print chr ord q tie gt and print chr length q else x oct oct ord q eq le and print chr length q else x oct oct ord q eq le and return cos for uc y xor eval q y print uc chr ord q dbmopen and and print chr ord q dump and and print chr length q else x oct oct ord q eq le and print chr length q else x oct oct ord q eq le and return cos if length q q s s q eq chr ord reverse length or not chr ord reverse length y or eval q x print length unless length q q s s q eq chr ord reverse length or not chr ord reverse length x xor print chr hex qw q and q while s qq q and length ne ord qw q eq
```
[Try it online!](https://tio.run/##vVLtCsMgDHyVvMQeqNO0CtZvW/v0LrVujtL9GWNIIORyyV3Qole3UnAZFDjYoCUZjOcU4DEmr4GZAKuQCoEJY2HQ/JTkmlovdaSCr/TEwK00bKQ57gJ3ECXCFE@QQj1FQSiqgLsSFo@oFHTU8CXjzcyuifRtkCl5uT9GUr1L5PfZWNSVf2WBp9legH8xIcfOchDo1canOI8LeprVesioNvETukE/RG6yGpS0whB@tyrXo3fnAvPxUXZ7rv0zWuBaqdE0HrdY6@pSHg "Perl 5 – Try It Online")
## How it works
```
# fizz part
eval q y
   # if(length%3==0)
   eval q x
      # instead of length or return 1
      ord or return cos
   while
      # instead of s/...//
      chop and chop and chop
   x and

   # print 'Fizz'
   print chr ord uc qw q for q and
   print chr ord q tie gt and
   print chr length q else x oct oct ord q eq le and
   print chr length q else x oct oct ord q eq le and
   # for truthy
   return cos
for
   # instead of $_
   uc
y
xor
# buzz part
eval q y
   # print 'Buzz'
   print uc chr ord q dbmopen and and
   print chr ord q dump and and
   print chr length q else x oct oct ord q eq le and
   print chr length q else x oct oct ord q eq le and
   # for truthy
   return cos
if
   # instead of length%5, /[05]$/
   length q q s s q eq chr ord reverse length or
   not chr ord reverse length
y
or
# this block is done when length%15==0 or length%3&&length%5
eval q x
   print length
unless
   # instead of length%5
   length q q s s q eq chr ord reverse length or
   not chr ord reverse length
x
xor
# newline
print chr hex qw q and q
while
   s qq q and
   # ord qw q eq == 101
   length ne ord qw q eq
```
---
## Previous
```
eval q y eval q kill and length or return cos while s q qq and s q qq and s q qq and s q qq and s q qq and s q qq and s q qq and s q qq and s q qq and s q qq and s q qq and s q qq and s q qq and s q qq and s q qq and ok and print chr ord uc qw q for q and print chr ord q tie gt and print chr length q else x oct oct ord q eq le and print chr length q else x oct oct ord q eq le and print uc chr ord q dbmopen and and print chr ord q dump and and print chr length q else x oct oct ord q eq le and print chr length q else x oct oct ord q eq le and return cos for uc y or eval q y eval q kill and length or return cos while s q qq and s q qq and s q qq and s q qq and s q qq and ok and print uc chr ord q dbmopen and and print chr ord q dump and and print chr length q else x oct oct ord q eq le and print chr length q else x oct oct ord q eq le and return cos for uc y or eval q y eval q kill and length or return cos while s q qq and s q qq and s q qq and ok and print chr ord uc qw q for q and print chr ord q tie gt and print chr length q else x oct oct ord q eq le and print chr length q else x oct oct ord q eq le and return cos for uc y or print length xor print chr length q q x x x x eq while s qq q and length ne ord qw q eq
```
[Try it online!](https://tio.run/##7VLRDoMgDPyV@4l90IadGhEs4tSvZxWIm4t7WrZsyUIIhB7X67UdOX0IgS5HDcaMfGlqrXE0BTSZ0lewDo784AyU7TFWtSb0gmOOqO@92iYenauNh6qcVFJgUOBRMGcpi3fiDF8TSv8Qyl4wSPeECVb5tOMXYgG89ENk3RQUp9Z2ZGJ4T2ExtN1O8H0a7/q/@CZi52UsPjg5m17@zfqtEX/iSCLKJNP6sGFmoU1L6FZTONeVYYZSyjFmDeEK "Perl 5 – Try It Online")
### Explained
```
# fizzbuzz part
eval q y
   # length%15==0?
   eval q k
         ill and length or return cos
      while
s q qq and s q qq and s q qq and
s q qq and s q qq and s q qq and
s q qq and s q qq and s q qq and
s q qq and s q qq and s q qq and
s q qq and s q qq and s q qq and o
   k and
   # then print FizzBuzz, as in first ppencode
   print chr ord uc qw q for q and
   print chr ord q tie gt and
   print chr length q else x oct oct ord q eq le and
   print chr length q else x oct oct ord q eq le and
   print uc chr ord q dbmopen and and
   print chr ord q dump and and
   print chr length q else x oct oct ord q eq le and
   print chr length q else x oct oct ord q eq le and
   # cos is for TRUTHY
   return cos
 # don't change $_ outside
 for uc
# buzz part, like above
y or eval q y
   eval q kill and length or return cos while s q qq and s q qq and s q qq and s q qq and s q qq and ok and print uc chr ord q dbmopen and and print chr ord q dump and and print chr length q else x oct oct ord q eq le and print chr length q else x oct oct ord q eq le and return cos for uc
# fizz part, like above
y or eval q y
   eval q kill and length or return cos while s q qq and s q qq and s q qq and ok and print chr ord uc qw q for q and print chr ord q tie gt and print chr length q else x oct oct ord q eq le and print chr length q else x oct oct ord q eq le and return cos for uc
# no special strings
y or print length
# print LF
xor print chr length q q x x x x eq
# pretty familiar, isn't it?
while s qq q and length ne ord qw q eq
```
[Answer]
# [Fact](https://github.com/RocketScienc/Fact), 11 bytes [(SBCS)](https://github.com/RocketScienc/Fact/blob/main/zalgosbcs.jl)
```
ef̀|3 5^ŹFh̃õ
```
## Explanation
```
e            1e2 (i.e. 100)
 f̀           for i in 1:100
  |3 5           Divisibility by [3, 5] (vectorizes)
      ^          String repeat by (vectorizes):
       ŹF            "FizzBuzz"
         h̃           Halved (i.e. ["Fizz", "Buzz"])
          õ      Logical OR with i
                 (in Fact, lists are false when all items are "" or 0
                  or when the list is empty)
Implicit grid (smash inner lists and join outer list by newline)
```
[Fork and test](https://replit.com/@RocketScienc/Fact-1)
## Fact, 15 bytes
```
ef̀|3 5^'b̀M̀b̀Ò'h̃õ
```
No `"FizzBuzz"` builtin, simply uses string compression
[Answer]
# Python, ~~108~~ 102 bytes
*Thanks to [caird coinheringaahing](https://codegolf.stackexchange.com/users/66833/caird-coinheringaahing) for -6 bytes!*
```
for x in range(1,101):
    y=""
    if x%3<1:y="Fizz"
    if x%5<1:y+="Buzz"
    y=y or x
    print(y)
```
[Answer]
# [Quipu](https://esolangs.org/wiki/Quipu), 101 bytes
```
1&0&'F0&'B1&\n
++[]'i[]'u[]/\
1%3&'z5&'z6&0&
1&%%'z%%'z==??
%%3&/\5&/\0&
1&>>  >>6&[]
>>      ??/\
::
```
[Try it online!](https://tio.run/##zVltc9s2Ev7OX7FhxxIZN5J1N@0H1ZKvTtvpa9K5dKYfLN8NTEESG4pkCdCOqtFvz@0uAJrUiy3G9cwlI9sEHuzLs8sFsFKRSMTHfv9XobSEVVYWEGVTCXEKeiHN30pGOs5SEOmUB@M0L7VDmAcL6cE3WZKIAlQ8TxUsxK0EncGNBKkikcsp3MV6AdMayIuXeVaguKz3DrVH0g1ECLJSl6UWN4nsfV0UYnVZzmay8LKbP3AWfhFoh/ygZTpV8HWer3WxWv@QalnkhcSfwa@iUPirEt@bFdnycqWlCi4TuejlRTbvzaXmoTAMN5HQ0WIdCSUhl0Oz/NsPkczJlNE4L@JUJ2ngmxmQRZEVQ/BPc0lifpFKibkMPRYQyyHUjKnEwGgMlaAaoJIGp7h2V95/SdxUfnhb6rezy6xEp/fLfJPZwMxi5M0PNxsvSoRSsOVPsDTyh/BO49p5WHG5Awkd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Zubr26E/6d3GBQobDj6hp8/F/)
Ungolfed:
```
" 0  1  2  3  4  5  6"
"--------------------"
 1& 0& 'F 0& 'B 1& \n
 ++ [] 'i [] 'u [] /\
 1% 3& 'z 5& 'z 6& 0&
 1& %% 'z %% 'z == ??
 %% 3& /\ 5& /\ 0&
 1& >>    >> 6& []
 >>          ?? /\
 ::
```
Thread 0 increments the accumulator (`acc`) every iteration, stopping execution if `acc == 101`, then jumps to thread 1.
Thread 1 checks if `(acc % 3) > 0`. If so, it jumps to thread 3, otherwise it jumps to thread 2.
Thread 2 prints `Fizz`, then jumps to thread 3.
Thread 3 checks if `(acc % 5) > 0`. If so, it jumps to thread 5, otherwise it jumps to thread 4.
Thread 4 prints `Buzz`, then jumps to thread 6.
Thread 5 looks back to thread 1 to see if `(acc % 3) == 0`. If so, it jumps to thread 6, otherwise it prints `acc`, then jumps to thread 6.
Thread 6 prints a newline, then jumps back to thread 0.
I think this could probably be refactored to golf away some of the whitespace, but I'm not doing that since if I do, I'll likely get sucked in and do nothing else for ~8 hours or so. :/
[Answer]
# [Crystal](https://crystal-lang.org), 114 bytes
```
1.upto(100)do|n|case when n%15==0;puts "FizzBuzz"when n%5==0;puts "Buzz"when n%3==0;puts "Fizz"else puts n end end
```
[Try it online!](https://tio.run/##Sy6qLC5JzPn/31CvtKAkX8PQwEAzJb8mryY5sThVoTwjNU8hT9XQ1NbWwLqgtKRYQckts6rKqbSqSgkqhySFLGyMqkMpNQdoHJifp5CalwLC//8DAA "Crystal – Try It Online")
#### How it works:
First, it tells it to repeat the code 100 times, with the iteration as n.
If n mod 15 = 0, then output FizzBuzz.

If n mod 5 = 0, then output Buzz.

If n mod 3 = 0, then output Fizz.
If none of those are true, just output the iteration, n.
[Answer]
# Kustom, 72 bytes
This somehow gets a decent score for what it is?
I'm not sure if this language even has an official name, but it's used in a few Android customization apps (KLWP, KWGT, and KLCK).
[Kustom function documentation](https://help.kustom.rocks/s1-general/knowledgebase/top/c2-functions) for those curious
```
$fl(1,100,"i+1","if(i%3=0&i%5=0,FizzBuzz,i%3=0,Fizz,i%5=0,Buzz,i)","
")$
```
and a bit more readable:
```
$fl(
    1,
    100,
    "i+1",
    "if(
        i%3 = 0 & i%5 = 0,
        FizzBuzz,
        i%3 = 0,
        Fizz,
        i%5 = 0,
        Buzz,
        i
    )",
    "
"
)$
```
[Answer]
# [Rattle](https://github.com/DRH001/Rattle), ~~54~~ 44 bytes
```
Fizz&Buzz|!I=[g+bs%3[0b0b^0]g%5[0b1b^0]B]100
```
[Try it Online!](https://www.drh001.com/rattle/?flags=&code=Fizz%26Buzz%7C!I%3D%5Bg%2Bbs%253%5B0b0b%5E0%5Dg%255%5B0b1b%5E0%5DB%5D100&inputs=)
This [was] my first answer in my new programming language! (This answer has since been golfed, and works on my new online interpreter)
~~Eventually, this programming language might have a more concise way to solve this challenge.~~
^this ended up being true - after a couple updates, 10 bytes can be shaved off the original answer (without implementing trivial built-ins)
# Explanation
```
Fizz&Buzz         a variable containing the text Fizz and Buzz
|                 signals the end of the input
!                 is a flag to disable implicit printing at EOF
I                 splits the variable into parts and stores it in consecutive memory slots
=                 sets top of stack to 0
[                 start outer loop
g+bs              gets value at slot 3 (starts at zero), increments, appends it to a buffer, saves it to slot 3
%3                takes the current value on stack and pushes the value mod 3 to stack
[0b0b^0]          if the value on stack is equal to 0, concatenates value from memory slot 0 ("Fizz") to a buffer and nullifies the 0th element of the buffer
g%5               pushes value from slot 3 to stack, takes the value and pushes the value mod 5 to stack
[0b1b^0]          if the value on stack is equal to 0, concatenates the value from memory slot 1 ("Buzz") to the buffer and nullifies the 0th element of the buffer if not null already
B                 if the buffer is non-empty, prints buffer
]100              end outer loop - repeats 100 times
```
[Answer]
# Julia 59 char, 59 bytes
Below works in the Julia REPL
`(x->(t="Fizz"^(x%3<1)*"Buzz"^(x%5<1);t>"" ? t : x)).(1:100)`
an alternative solution of same char/byte length in Julia REPL is
`(x->(s=x%3<1;t=x%5<1;(x,"Fizz"^s*"Buzz"^t)[s|t+1])).(1:100)`
In search of the 59 char/59 bytes solution which includes a print statement.
[Answer]
# [Thunno 2](https://github.com/Thunno/Thunno2) `N`, 11 [bytes](https://github.com/Thunno/Thunno2/blob/main/docs/codepage.md "Thunno 2 codepage")
```
ɦık+Ḋkg×Jn|
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m728JKM0Ly_faGm0kp9S7IKlpSVpuhYbTi47sjFb--GOruz0w9O98mqWFCclF0MlF0BpAA)
Add a trailing `£` if you want it flagless.
## [Thunno 2](https://github.com/Thunno/Thunno2), ~~18~~ 17 [bytes](https://github.com/Thunno/Thunno2/blob/main/docs/codepage.md "Thunno 2 codepage")
```
ɦı35dḊʋ⁴ȥæÞ½×Jn|£
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m728JKM0Ly_faMGCpaUlaboW-04uO7LR2DTl4Y6uU92PGrecWHp42eF5h_Yenu6VV3No8ZLipORiqFKYFgA)
No questionable constants.
#### Explanation
```
ɦık+Ḋkg×Jn|  # Full program
ɦ            # Push 100
 ı           # Map over [1..100]:
  k+         #  Push [3, 5]
    Ḋ        #  Divisible by [3, 5] (vectorises)
     kg      #  Push ["Fizz", "Buzz"]
       ×     #  Multiply element-wise
        J    #  Join by nothing
         n|  #  Logical OR with the number
             # N flag joins by newlines
             # Implicit output
```
```
ɦı35dḊʋ⁴ȥæÞ½×Jn|£  # Full program
ɦ                  # Push 100
 ı                 # Map over [1..100]:
  35d              #  Push [3, 5]
     Ḋ             #  Divisible by [3, 5] (vectorises)
      ʋ⁴ȥæÞ        #  Push compressed string "FizzBuzz"
           ½       #  Split in half to get ["Fizz", "Buzz"]
            ×      #  Multiply element-wise
             J     #  Join by nothing
              n|   #  Logical OR with the number
                £  #  Print the result
```
[Answer]
# [Mouse](https://en.wikipedia.org/wiki/Mouse_(programming_language)), 75 bytes
```
1I:(I.101<^0J:I.3\0=["Fizz"J.1+J:]I.5\0=["Buzz"J.1+J:]J.0=[I.!]"!"I.1+I:)$
```
Ungolfed:
```
1 I:               ~ Start a loop index at 1
( I. 101 < ^       ~ While I < 101...
  0 J:             ~ Begin a divisibility indicator at 0
  I. 3 \ 0 = [     ~ If I % 3 == 0
    "Fizz"         ~ Print "Fizz" to STDOUT
    J. 1 + J:      ~ Increment J
  ]
  I. 5 \ 0 = [     ~ If I % 5 == 0
    "Buzz"         ~ Print "Buzz" to STDOUT
    J. 1 + J:      ~ Increment J
  ]
  J. 0 = [         ~ If neither 3 nor 5 divides I
    I. !           ~ Print I to STDOUT
  ]
  "!"              ~ Print a newline
  I. 1 + I:        ~ Increment I
)
$
```
[Answer]
# Processing, 74 bytes
This is based on the Java answer by Geobits. I converted it into Processing and since Processing is similar to Java, the code is a lot similar to Geobits'.
```
for(int i=0;i++<100;)println((i%3<1?"Fizz":"")+(i%5<1?"Buzz":i%3<1?"":i));
```
[Answer]
# PHP, ~~73~~ 71 bytes
```
<?for($i=0;$i++<100;)echo$i%3?$i%5?$i:@Buzz:@Fizz.($i%5?"":@Buzz),"
";
```
All the most terrible things. I wanted the wrongheaded ternary to do something magical, but it did not.
[Answer]
# Common Lisp, 121
```
(dotimes(x 100)(flet((d(n)(= 0(mod(1+ x)n))))(princ(cond((d 15)"FizzBuzz")((d 3)"Fizz")((d 5)"Buzz")(t(1+ x)))))(terpri))
```
Readable:
```
(dotimes (x 100)
  (flet ((d (n) (= 0 (mod (1+ x) n))))
    (princ (cond ((d 15) "FizzBuzz")
                 ((d 3) "Fizz")
                 ((d 5) "Buzz")
                 (t (1+ x)))))
  (terpri))
```
[Answer]
# Ruby, 59
I wanted to make a Ruby version using the slick modulo/integer-division/string-multiplication trick from [**feersum's Python answer**](https://codegolf.stackexchange.com/a/58623/11071) (though unfortunately Ruby doesn't handle string multiplication the same way, so I spent some bytes on that):
```
100.times{|i|puts "#{i+1}\r"+"Fizz"*(i%3/2)+"Buzz"*(i%5/4)}
```
Note that this uses a carriage return `\r` without a newline. I don't know how portable this is; it works on my Linux and should work on Linux in general, as well as on Mac, but I'm not sure how Windows handles it. Without that, here's a 61-byte version:
```
100.times{|i|puts ("Fizz"*(i%3/2)+"Buzz"*(i%5/4))[/.+/]||i+1}
```
[Answer]
# Commodore Basic, 87 bytes
```
1F┌I=1TO100:F=F+1:B=B+1:IFF=3T|?"FIZZ";:F=0
2IFB=5T|?"BUZZ";:B=0
3IFF>0A/B>0T|?I;
4?:N─
```
Or in "shifted mode" to get both lower- and upper-case letters, but with the byte values of lowercase and uppercase swapped relative to ASCII-1967 (press `COMMODORE`+`SHIFT`):
```
1fOi=1to100:f=f+1:b=b+1:iff=3tH?"Fizz";:f=0
2ifb=5tH?"Buzz";:b=0
3iff>0aNb>0tH?i;
4?:nE
```
Usual PETSCII-to-Unicode substitutions: `┌` = `SHIFT+O`, `|` = `SHIFT+H`, `/` = `SHIFT+N`, `─` = `SHIFT+E`
Commodore Basic doesn't have a "modulus" operation, so I need to use alternate methods to figure out when to print what: keeping a pair of counters turns out to be fewer bytes than dividing and checking for integer-ness. It also doesn't have a true logical "and" (despite the manual saying otherwise), so I need to do an explicit comparison against zero to decide if I should print the plain number.
[Answer]
# F#, ~~129~~ ~~116~~ ~~113~~ 111
```
Seq.iter(fun x->printfn"%s"(["Fizz";"";""].[x%3]+(if x%5=0 then"Buzz"elif x%3>0 then string x else""))){1..100}
```
[Answer]
## [Gol><>](https://github.com/Sp3000/Golfish), 40 bytes
```
`e2RFL5%zR"zzuB"L3%zR"zziF"lQlRoaoC|LN|;
```
Updated for 0.4.0! I'm still tinkering with loops and trying to figure out how to do things best, but this is looking good so far.
[Try it online](https://golfish.herokuapp.com/?code=%60e2RFL5%25zR%22zzuB%22L3%25zR%22zziF%22lQlRoaoC%7CLN%7C%3B&input=&debug=false).
## Explanation
```
`e            Push 'e', or 101
2RF ... |     Execute F for loop twice - the first time activates the loop, and the
              second time updates it. This effectively makes the loop start from 1
L5%z          Push 1 if loop counter % 5 is 0, else 1
R"zzuB"       Push "Buzz" (top of stack) number of times
L3%z          Push 1 if loop counter % 3 is 0, else 1
R"zziF"       Push "Fizz" (top of stack) number of times
lQ ... |      If the stack is not empty...
  lRo         Output stack
  ao          Output newline
  C           Continue for loop
LN            Otherwise, print loop counter with newline
;             Terminate program
```
As we can see, there's a lot of abuse of `R`, which pops the top of the stack and executes the next instruction that many times.
[Answer]
# Jolf, ~~42~~ ~~33~~ 31 bytes
[Try it here!](http://conorobrien-foxx.github.io/Jolf/#code=wp_OnHp-MWR8XSJGaXp6QnV6eiI_JUgzNDA_JUg1NDhI) Replace `ƒ` with `\x9f`. I'm stealing ETHproduction's method of fizzbuzzing.
```
ƒΜz~1d|]"FizzBuzz"?%H340?%H548H
```
---
## Old version, 42 bytes
```
γ"Fizz"ƒΜz~1d?mτͺ35H+γζ?m|3Hγ?m|5HΖ"Buzz"H
γ"Fizz"                                     γ = "Fizz"
        Μz~1d                               map 1..100 with the following function
             ?mτͺ35H                        if both 3 and 5 | H
                    +γζ                      return γ + ζ
                       m|3H                 else if 3 | H
                           γ                 return γ
                             ?m|5H          else if 5 | H
                                  Ζ"Buzz"    return ζ = "Buzz"
                                         H  else return H
       ƒ                                    join by newlines
```
I might be able to golf it down by using the dictionary in Jolf, but who would want to with such a perfect score?
[Answer]
# D, 130 bytes
```
import std.stdio,std.conv;void main(){string x;for(int i;i++<100;x=((i%3?"":"Fizz")~(i%5?"":"Buzz")),writeln(x?x:i.to!string)){};}
```
Ungolfed:
```
module FizzBuzz;
import std.stdio;
import std.conv;
void main() {
  string x;
  for (
    int i;
    i++ < 100;
    x = ((i % 3 ? "" : "Fizz")
      ~ (i % 5 ? "" : "Buzz")),
    writeln(x ? x : i.to!string)
  ){};
}
```
Or, building a string, for **142 bytes**,
```
import std.stdio,std.conv;void main(){string x,y;for(int i;i++<100;x=((i%3?"":"Fizz")~(i%5?"":"Buzz")),y~=(x?x:i.to!string)~"\n"){};write(y);}
```
Ungolfed:
```
module FizzBuzz;
import std.stdio;
import std.conv;
void main() {
  string x,y;
  for (
    int i;
    i++ < 100;
    x = ((i % 3 ? "" : "Fizz")
      ~ (i % 5 ? "" : "Buzz")),
    y ~= (x ? x : i.to!string) ~ "\n"
  ){};
  write(y);
}
```
[Answer]
## [Hoon](https://github.com/urbit/urbit), 126 bytes
```
%+
turn
(gulf [1 100])
|=
a/@
=+
[=((mod a 3) 0) =((mod a 5) 0)]
"{?:(-< "Fizz" "")}{?:(-> "Buzz" "")}{?:(=(- [| |]) <a> "")}"
```
Map over the list [1...100] with the function, interpolating the strings "Fizz" and "Buzz". If both mods are false, then it also interpolates the number.
This uses the fact that =+ pushes the value to the top of the context, which you can access with - and navigate with -< or -> for head/tail. Unfortunately, it looks pretty ugly because it needs a newline after runes to minimize byte count, along with not having built in operator functions.
I'm not entirely sure if this counts as a valid entry: It simply returns a list of strings to be printed by the shell, which is optimal. The other way would be to use ~& to print each element as it's mapped over, but it would still be rendered as "Fizz" or "Buzz" (with quotes) since it's a typed print, along with the shell then printing out the entire list anyways since it's the return value.
[Answer]
# Vim, ~~66, 57~~ 56 keystrokes
```
i1<esc>qqYp<C-a>q98@q3Gqy:s/\d*/Fizz<CR>3j@yq@y5Gqz:s<CR>ABuzz<esc>5j@zq@z
```
Further golfing, and explanation on the way.
[Answer]
# Javascript, 56 bytes
```
for(f=0;f++<100;alert(f%5?b||f:b+'Buzz'))b=f%3?'':'Fizz'
```
Assuming 100 alerts is an acceptable output method.
[Answer]
# Ruby, ~~82~~ ~~72~~ ~~70~~ 68 bytes
based on other answers:
```
puts (1..100).map{|i|(x=(i%3<1?"Fizz":"")+(i%5<1?"Buzz":""))>""?x:i}
```
old solution:
```
(1..100).map{|i|$><<"Fizz"if f=i%3<1
$><<"Buzz"if b=i%5<1
$><<i if !(f||b)
puts()}
```
[Answer]
# AppleScript, ~~104~~ ~~102~~ 100 bytes
```
""
repeat with i from 1to 100
result&{"FizzBuzz",i,"Fizz","Buzz"}'s item((i^4mod 15+7)div 4)&"
"
end
```
If you run it in Script Editor, the result has "quotes" around it. If you run it with `osascript`, there are no "quotes", but the result ends with an extra blank line.
I steal the technique from [Lynn's Lua answer](https://codegolf.stackexchange.com/a/58837/4065), where the script picks from a list of possible values to print. I use `(i^4mod 15+7)div 4` to calculate the index 1, 2, 3, or 4. It's different from Lua's `i^2%3+i^4%5*2+1`.
In AppleScript, `i^4` raises i to 4th power. It returns a `real`, which is a floating-point number, but the value is equal to the correct integer.
The values of n = `i^4mod 15` with i from 1 to 15 are
```
i = 1   2   3   4   5   6   7   8   9  10  11  12  13  14  15
n = 1   1   6   1  10   6   1   1   6  10   1   6   1   1   0
```
So n is 0.0 for "FizzBuzz", 1.0 for i, 6.0 for "Fizz", or 10.0 for "Buzz". This pattern continues with i from 16 to 100. I need to map the values 0.0, 1.0, 6.0, 10.0 to a list index; lists in AppleScript start at index 1.
```
n          = 0.0   1.0   6.0  10.0
(n+2)mod 7 = 2.0   3.0   1.0   5.0
(n+7)div 4 = 1     2     3     4
```
My 104-byte answer used `(n+2)mod 7`, but that mapping had 5.0 instead of 4.0, so it needed a list of 5 items, where the extra item `0,` cost 2 bytes. My 102-byte answer uses `(n+7)div 4`. My 100-byte answer deletes 2 extra spaces.
[Answer]
# Forth, ~~107~~ ~~101~~ 98 bytes
```
: f 101 1 do i 5 mod i 3 mod if dup if i . then else ." Fizz" then 0= if ." Buzz" then cr loop ; f
```
Ungolfed + close Python equivalent:
```
: f              \ def f():
  101 1 do       \     for i in range(1, 101):
    i 5 mod      \         a = i % 5  # Not an actual variable, pushed onto the stack
    i 3 mod      \         b = i % 3
    if           \         if b:      # b is popped
      dup        \             c = a
      if         \             if c:
        i .      \                 print(i, end='')
      then
    else         \         else:
      ." Fizz"   \             print('Fizz', end='')
    then
    0=           \         a = (a == 0)
    if           \         if a:
      ." Buzz"   \             print('Buzz', end='')
    then
    cr           \         print()
  loop
;
f                \ f()
```
[Run it!](https://tio.run/##PcpBCoAgEEbhq/y0L5RoU7Rp0UXSScEaqdx4@SkRWn3weMTX49qdCiIjCFppaBiGx4CDzWdfJZgUCx4dHmdP2HBbdA1Wn3NTk5rL8bUl/W27EJgjJpDICw)
[Answer]
# Go, ~~130~~ ~~129~~ 134 bytes
```
package main;import."fmt";func main(){for i:=1;i<101;i++{o:="";if i%3<1{o+="Fizz"};if i%5<1{o+="Buzz"};if o==""{Print(i)};Println(o)}}
```
I wish i had ternary operators...
Edit:
@Dust pointed out that I printed to `stderr` so my solution actually increased in size :(
[Try it online!](https://tio.run/##NctBCsMgEIXhq8hAQRFKpXSTiZssus4VJNQwtDpBzCbi2U1I283j54M3c2uLm95ufongKCKFhVO@gg8Z0K9xOlmq4jkJ6qxB6s3tWK0LdxYAyQu63HtTWFt40rZB/drjZ8P6N7bHoYyJYpakKp71iZJVra3t "Go – Try It Online")
[Answer]
# [12-BASIC](http://12me21.github.io/12-basic/), ~~73~~ ~~55~~ 50 bytes
```
FOR I=1TO 100?"FIZZ"*!(I%3)+"BUZZ"*!(I%5)OR I
NEXT
```
The first code golf program I've written in the language I'm creating.
I should probably avoid code golf while working on it though...
[Answer]
# C#, 119 bytes
```
class q{static void Main(){for(var i=0;i++<100;)System.Console.WriteLine(i%3*i%5>0?i+"":$"{i%3:;;Fizz}{i%5:;;Buzz}");}}
```
[Try it online!](https://tio.run/##DcjBCsIgGADgVxFpoMmGEbvMWlDQqU4dOos5@GEp@dugic9u3j4@g61BU4qZNSL5JIw6giGLhxe5a3CMp8kHtuhA4CgVCHHYSan444fRvruLd@hn2z0DRHsDZxk0@y00/ShPICgdNjTVGZS6wrrm6r76/K2mXOVcyh8 "C# (Visual C# Compiler) – Try It Online")
---
I was wondering how close I could get to the long standing [124 byte C# answer by Pierre-Luc](https://codegolf.stackexchange.com/questions/58615/1-2-fizz-4-buzz/58641#58641), so I challenged myself to try. After unexpectedly beating it by just one byte (123 bytes, [Try it online!](https://tio.run/##LcmxCsIwEADQXwkBIUewpIiLqQgKTjo5OIczwkGbSC4WbOm3RwOu7yGvkbEU7B2zeM2cXSYUY6SHuDoKCuZnTGp0SdDeWNK6a42xcPtw9kNzioFj75t7ouwvFLxStNp07UGeaZrkTkrQP9lWOb6r/LuWJgC7LKV8AQ)), I took the advice from @LiamK's three year old comment and used string interpolation to shave off another 4 bytes. I'm genuinely surprised by how well this worked out!
[Answer]
# [K (oK)](https://github.com/JohnEarnest/ok), ~~49~~ ~~46~~ 43 bytes
**Solution:**
```
`0:{$[a:,/$&`Fizz`Buzz!~5 3!'x;a;x]}'1+!100
```
[Try it online!](https://tio.run/##y9bNz/7/P8HAqlolOtFKR19FLcEts6oqwam0qkqxzlTBWFG9wjrRuiK2Vt1QW9HQwOD/fwA "K (oK) – Try It Online")
**Explanation:**
```
`0:{$[a:,/$&`Fizz`Buzz!~5 3!'x;a;x]}'1+!100 / the solution
                                       !100 / range 0..99
                                     1+     / add 1
   {                               }'       / apply lambda {} to each number
    $[                        ; ; ]         / conditional, $[if;then;else]
                        5 3!'x              / apply modulo (!) of each 5 and 3 to the input x
                       ~                    / not (0->1, anything else->0)
            `Fizz`Buzz!                     / turn results into a dictionary
           &                                / keys where true
          $                                 / convert to strings
        ,/                                  / flatten
      a:                                    / save as a
                               a            / result if a is not empty - so Fizz / Buzz
                                 x          / result if a is empty - so 1, 2, 4
`0:                                         / print to stdout
```
**Notes:**
* -6 bytes thanks to @ngn with a new approach
[Answer]
# [Julia 1.0](http://julialang.org/), 72 bytes
```
(n->println([n,"Fizz","Buzz","FizzBuzz"][sum(n.%[1,3,5,5].<1)])).(1:100)
```
[Not the shortest solution possible](https://code-golf.io/scores/fizz-buzz/julia), but I like the obfuscation. [Try it online!](https://tio.run/##yyrNyUw0rPj/XyNP166gKDOvJCdPIzpPR8kts6pKSUfJqRRMgXhgZmx0cWmuRp6earShjrGOqY5prJ6NoWaspqaehqGVoYGB5v//AA "Julia 1.0 – Try It Online")
### Explanation
We apply an anonymous function `(n->...)` itemwise `.( )` to the range `1:100`.
The function body does this (using sample input `n=5`):
```
n.%[1,3,5,5]          # Modulo n by each of these numbers                     [0,2,0,0]
.<1                   # Itemwise, is each remainder zero?                     [true,false,true,true]
sum(  )               # Count number of trues in the array                    3
                      # This will be 4 for multiples of 15, 3 for multiples
                      # of 5, 2 for multiples of 3, and 1 for other numbers
[n,"F","B","FB"][  ]  # Index (1-based) into this array                       "Buzz"
println(  )           # Print, with a newline
```
]


[Question]
      [
Write the shortest program or function which generates these 1000 numbers or a sequence (0- or 1-indexed) which begins with them.
```
[0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0,
 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1,
 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0,
 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1,
 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0,
 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1,
 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0,
 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1,
 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0,
 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1,
 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0,
 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1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 0, 0, 0, 1, 1, 1, 1, 0, 0,
 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1,
 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0]
```

[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~11~~ 10 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
*Saved 1 byte thanks to @Dennis*
```
ȷḶ×⁽q£:ȷ5Ḃ
```
[Try it online!](https://tio.run/##AR0A4v9qZWxsef//yLfhuLbDl@KBvXHCozrItzXhuIL//w "Jelly – Try It Online")
### How?
I first noticed that the pattern alternates between runs of length 4 and length 3, skipping the length-4 step every few runs. This led me to look for a number which could be divided into the current index, then taken mod 2 and floored—i.e. retrieving the least significant bit—to give the bit at that index in the series. After much trial and error, I found that `3.41845` does exactly that, but multiplying by its approximate reciprocal (`.29253`) is a byte shorter.
```
ȷḶ×⁽q£:ȷ5Ḃ    Main link. Arguments: none
ȷ             Yield 1e3, i.e. 1000.
 Ḷ            Lowered range; yield [0, 1, 2, ..., 999].
  ×⁽q£        Multiply each item by 29253.
      :ȷ5     Floor-divide each item by 1e5, i.e. 100000.
         Ḃ    Take each item mod 2.
```
[Answer]
# [Ruby](https://www.ruby-lang.org/), ~~34 29 26~~ 22 bytes
```
$.+=184while p$./629%2
```
[Try it online!](https://tio.run/##KypNqvz/X0VP29bQwqQ8IzMnVaFARU/fzMhS1ej/fwA "Ruby – Try It Online")
Quick explanation: this works because of the magic number 629. I noticed that the sequence starts repeating after the 629th element, and I tried to "improve" some existing answer, using only integer math. I found that the other "magic number" (0.29253) is actually 184/629.
[Answer]
# [Dyalog APL](https://www.dyalog.com/), ~~99~~ ~~83~~ 82 bytes
```
a←{⍵/0 1}¨(↓3 2⍴4 3 3)
{a⊢←↓⍉↑a{⍺∘{⍵/⊂⍺}¨⍵}¨↓3 3⍴⍵}¨(9/5)∘⊤¨1386531 496098
1000⍴∊a
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT9dNzkksLs5M/v@ooz3tf@KjtgnVj3q36hsoGNYeWqHxqG2ysYLRo94tJgrGCsaaXNWJj7oWAdUAxR/1dj5qm5gIVL3rUccMsKZHXU1AHlAfkAMiQZqNgZohXA1LfVNNoNJHXUsOrTA0tjAzNTZUMLE0M7C04DI0MDAAKezoSgQ55H8aAA "APL (Dyalog Classic) – Try It Online")
Definitely not the intended solution as this still has a lot of hardcoded data, but it's a start.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 31 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
Given the pattern there is probably an even shorter way...
```
ĖŒṙḂ
“ṁ⁽⁺ḄæI’BḤ+3żḂ$ẎÇo2Ç+3Çḣȷ¬
```
**[Try it online!](https://tio.run/##AUkAtv9qZWxsef//xJbFkuG5meG4ggrigJzhuYHigb3igbrhuITDpknigJlC4bikKzPFvOG4giThuo7Dh28yw4crM8OH4bijyLfCrP// "Jelly – Try It Online")**
### How?
Exploits the repeating run length structure that is apparent to a depth of three.
```
ĖŒṙḂ - Link 1, make runs of bits: list of lengths    e.g. [5,3,5,3,3]
Ė    - enumerate                      [[1,5],[2,3],[3,5],[4,3],[5,3]]
 Œṙ  - run-length decode      [1,1,1,1,1,2,2,2,3,3,3,3,3,4,4,4,5,5,5]
   Ḃ - bit (modulo by 2)      [1,1,1,1,1,0,0,0,1,1,1,1,1,0,0,0,1,1,1]
“ṁ⁽⁺ḄæI’BḤ+3żḂ$ẎÇo2Ç+3Çḣȷ¬ - Main link: no arguments
“ṁ⁽⁺ḄæI’                   - literal 234931870193324
        B                  - to binary = [1,1,0,1,0,1,0,1,1,0,1,0,1,0,1,1,0,1,0,1,0,1,1,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,1,0,1,0,1,0,1,1,0,0]
         Ḥ                 - double    = [2,2,0,2,0,2,0,2,2,0,2,0,2,0,2,2,0,2,0,2,0,2,2,0,2,0,2,0,2,0,2,2,0,2,0,2,0,2,2,0,2,0,2,0,2,2,0,0]
          +3               - add three = [5,5,3,5,3,5,3,5,5,3,5,3,5,3,5,5,3,5,3,5,3,5,5,3,5,3,5,3,5,3,5,5,3,5,3,5,3,5,5,3,5,3,5,3,5,5,3,3]
              $            - last two links as a monad:
             Ḃ             -   bit     = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
            ż              -   zip     = [[5,1],[5,1],[3,1],[5,1],[3,1],[5,1],[3,1],[5,1],[5,1],[3,1],[5,1],[3,1],[5,1],[3,1],[5,1],[5,1],[3,1],[5,1],[3,1],[5,1],[3,1],[5,1],[5,1],[3,1],[5,1],[3,1],[5,1],[3,1],[5,1],[3,1],[5,1],[5,1],[3,1],[5,1],[3,1],[5,1],[3,1],[5,1],[5,1],[3,1],[5,1],[3,1],[5,1],[3,1],[5,1],[5,1],[3,1],[3,1]]
               Ẏ           - tighten   = [5,1,5,1,3,1,5,1,3,1,5,1,3,1,5,1,5,1,3,1,5,1,3,1,5,1,3,1,5,1,5,1,3,1,5,1,3,1,5,1,3,1,5,1,5,1,3,1,5,1,3,1,5,1,3,1,5,1,3,1,5,1,5,1,3,1,5,1,3,1,5,1,3,1,5,1,5,1,3,1,5,1,3,1,5,1,3,1,5,1,5,1,3,1,3,1]
                Ç          - call the last Link (1) as a monad
                           -           = [1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,1,1,0,1,1,1,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0,1,1,1,0,0,0,0,1,1,1,0,0,0,0,1,1,1,0,0,0,0,1,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,0,0,0,0,1,1,1,0,0,0,0,1,1,1,0,0,0,0,1,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,0,0,0,0,1,1,1,0,0,0,0,1,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,0,0,0,0,1,1,1,0,0,0,0,1,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,0,0,0,0,1,1,1,0,0,0,0,1,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,0,0,0,0,1,1,1,0,0,0,0,1,1,1,0,0,0,0,1,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,0,0,0,0,1,1,1,0,0,0,0,1,1,1,0,0,0,0,1,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,0,0,0,0,1,1,1,0,0,0,0,1,1,1,0,0,0,0,1,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,0,0,0,0,1,1,1,0,0,0,0,1,1,1,0,0,0,0,1,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,0,0,0,0,1,1,1,0,0,0,0,1,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,1,0]
```
[Answer]
# Java 8, ~~75~~ ~~64~~ 62 bytes
```
v->{for(int i=0;i<1e3;)System.out.print((int)(i++*.29253)%2);}
```
Prints the entire sequence without delimiter to save bytes, because they will only be `0` and `1` anyway.
Ports of [*@ETHproductions*' Jelly answer](https://codegolf.stackexchange.com/a/162777/52210), because I doubt I find anything shorter..
[Try it online.](https://tio.run/##LY5NDoIwEIX3nmI2Jq2GRiEuTMUbyIbEjXFRSzHFUggtJIZw9joIyUwm8/O@eZUYRFQVnyCNcA5uQttxA6CtV10ppIJsbgGGRhcgyX0uA@U4mzAxnBdeS8jAQgphiK5j2XQE9aDTA9eXo0o4zb/Oq5o1vWdthzsyH1Ci9/sdi8/xKaHbmPIp8IXZ9i@DzBX9f12jMZJ7FL8fT0EXU5ZJYntjVj9T@AE)
**Explanation:**
```
v->{                     // Method with empty unused parameter and no return-type
  for(int i=0;i<1e3;)    //  Loop `i` in range [0,1000)
    System.out.print(    //   Print:
      (int)(i++*.29253)  //    `i` multiplied with 0.29253,
                         //    and then truncated of their decimal values by casting to int
      %2);}              //    Modulo-2 to result in either 0 or 1
```
---
Old answer returning the resulting array (**75 bytes**):
```
v->{int i=1000,r[]=new int[i];for(;i-->0;)r[i]=(int)(i*.29253)%2;return r;}
```
[Try it online.](https://tio.run/##7VbPS8MwFL77VzwKQqJr6CY7aOjGDh6dh4Igo4eYZZqapTNJq2P0b6/p2sFAhgreLPkB773k@97hg/dlrGRhtnytuWLWwh2TencGILUTZsW4gHkT7hOLFDh6yOUSSkx9svLHb@uYkxzmoCGGugwnO/8WZDyMomhgFmmsxfv@u0zpKjeIyjCcRBQbn4iRL2AkL8joejS@wucjaoQrjAZDq5q2BJviSXmCjqdsGlj7NlHijNTPi5Th4xbFx0ZwJ5a@mQNxuosG7Rru1/fR8JdRj/g3@P8TsddSr6Venb06ey39ELGiRwOfcVcw1Yx7wpEulMJtNdlaJ9YkLxzZeKPglEbBzAhwL2LbXGDZWkwhuESZ90CkcFKRmTFsa4l484gWHazEoOPA0@DxNglugvl9gE@znK58IXJ5a2JQR9D5qqr@BA)
**Explanation:**
```
v->{                   // Method with empty unused parameter and integer-array return-type
  int i=1000,          //  Index `i`, starting at 1000
      r[]=new int[i];  //  Result-array of size 1000
  for(;i-->0;)         //  Loop `i` in range (1000,0]
    r[i]=              //   Set the item in the array at index `i` to:
      (int)(i*.29253)  //    `i` multiplied with 0.29253,
                       //    and then truncated of their decimal values by casting to int
      %2;              //    Modulo-2 to result in either 0 or 1
  return r;}           //  Return the resulting integer-array
```
[Answer]
# [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), 96 bytes
I searched for a cellular automaton that looks at the 4 neighbors to the left and produces the walking left pattern seen in the data when you Partition the data into length 7 and keep every third row.
This cellular automaton will run for 29 generations each of which is triplicated, matching the sequence perfectly for characters 1 to 629. However the sequence starts repeating at the 630th character rather than continuing the observed pattern, so extra code is needed to handle the repeat of the truncated pattern. I generate the main pattern twice to get to 1258 characters.
```
Most@Flatten[{#,#,#}&/@CellularAutomaton[{271,2,-{{4},{3},{2},{1}}},{0,0,0,0,1,1,1},29]]~Table~2
```
Without that glitch we could do it in a shorter 74 bytes. The 47 is the number of generations needed to get to 1000 characters (this actually goes to 1008=48\*7\*3)
```
{#,#,#}&/@CellularAutomaton[{271,2,-{{4},{3},{2},{1}}},{0,0,0,0,1,1,1},47]
```
[Try it online!](https://tio.run/##y00syUjNTSzJTE78n2b73ze/uMTBLSexpCQ1L7paWQcIa9X0HZxTc3JKcxKLHEtL8oGK84FyRuaGOkY6utXVJrU61cZAbATEhrW1QNJABwINQbBWx8gyNrYuJDEpJ7XO6H9AUWZeiUPafwA "Wolfram Language (Mathematica) – Try It Online")
[Answer]
# [Python 3](https://docs.python.org/3/), 42 bytes
```
x=184
while x/629%2:print(x//629%2);x+=184
```
[Try it online!](https://tio.run/##K6gsycjPM/7/v8LW0MKEqzwjMydVoULfzMhS1ciqoCgzr0SjQh/C1bSu0AYp@v8fAA "Python 3 – Try It Online")
Port of [G.B.](https://codegolf.stackexchange.com/a/162814/109916)'s answer.
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), ~~41~~ 33 bytes, port
Thank Rick Hitchcock for 4+ bytes
```
f=i=>i>999?'':(i*.29253&1)+f(-~i)
```
[Try it online!](https://tio.run/##y0osSyxOLsosKNHNy09J/e9m@z/NNtPWLtPO0tLSXl3dSiNTS8/I0sjUWM1QUztNQ7cuU/O/dXJ@XnF@TqpeTn66hpuGpuZ/AA "JavaScript (Node.js) – Try It Online")
# [JavaScript (Node.js)](https://nodejs.org), 121 bytes, original
```
_=>'8888y888'[s='replace'](/8/g,'aaa3yyy')[s](/y/g,'aaa3aa3')[s](/a/g,34)[s](/./g,t=>(_=+!+_+[]).repeat(t)).slice(3,1003)
```
[Try it online!](https://tio.run/##NYzBCsMgEES/pad1MTUp9hAo5pifkCCLlZAiMUQp@PV2oe0wA493mBe9KftzO8p1T8/QZtOcmWDkVB7YbOAMRyQfYBH92K8dEJGutQLazKr@FfeniJW@f1kxFzMJZ@RFOmkXVPwXqIiCqHLcfBC6uw2Dxvbwac8pBhXTKmaB2D4 "JavaScript (Node.js) – Try It Online")
[Answer]
# [Stax](https://github.com/tomtheisen/stax), ~~13~~ 11 [bytes](https://github.com/tomtheisen/stax/blob/master/docs/packed.md#packed-stax)
```
í?♫~╘äqx-G▄
```
[Run and debug it at staxlang.xyz!](https://staxlang.xyz/#p=a13f0e7ed48471782d47dc&i=&a=1)
Port to Stax of @ETHproductions's [Jelly answer](https://codegolf.stackexchange.com/a/162777/73884) (before its modification) with some modifications by @recursive to save two bytes.
[Answer]
# [Z80Golf](https://github.com/lynn/z80golf), 27 bytes
```
00000000: 018d 2b7b 1f1f e601 f630 ff09 3001 1313  ..+{.....0..0...
00000010: 7bfe 9220 ee7a fe04 20e9 76              {.. .z.. .v
```
[Try it online!](https://tio.run/##VYwxCsMwEAT7vGL7wLEnGcnybyJy58bgzoX8eFlO0mRYFqaZNnPdN@@dPxZQ5zdCzRXq6rBEhadIuLMgcqhGjYDI85QbfiaPb0FHI1c3lBAIs/yCGycEWkFO@GMEIO2@o/cL "Z80Golf – Try It Online")
Translated from this C code:
```
for (n = 0; n >> 16 != 1170; n += 11149 + 65536)
    putchar('0'|n>>18&1);
```
Disassembly:
```
  ld bc, 11149
loop:
  ld a, e
  rra
  rra
  and 1
  or '0'
  rst $38           ; putchar
  add hl, bc        ; Add 11149 to n = DEHL.
  jr nc, just_one   ; Add 65536 to n, possibly with carry from low 16 bits.
  inc de
just_one:
  inc de
  ld a, e
  cp 1170 & 255
  jr nz, loop
  ld a, d
  cp 1170 >> 8
  jr nz, loop
  halt
```
This is essentially a fixed-point arithmetic approach: (11149 + 65536) / 218 ≈ 0.29253, the constant used by other answers.
[Answer]
# [J](http://jsoftware.com/), 17 bytes
```
2|<.0.29253*i.1e3
```
A J port of ETHproduction's Jelly answer.
[Try it online!](https://tio.run/##y/r/36jGRs9Az8jSyNRYK1PPMNX4f2pyRr5CvKlBbAymHAA "J – Try It Online")
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 13 bytes
```
A³Ç*.29#ý f u
A³             // Given 10³,
  Ç            // map over it as a range, returning the given number
   *.29253     // times the constant,
           f u // floored and mod-2.
```
Japt version of [ETHproduction's Jelly answer](https://codegolf.stackexchange.com/a/162777/16484).
Bug fixed thanks to [Oliver](https://codegolf.stackexchange.com/users/61613/oliver).
[Try it here.](https://ethproductions.github.io/japt/?v=1.4.5&code=QbPHKi4yOSP9IGYgdQ==&input=)
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 13 bytes
```
Ｅφ§01×·²⁹²⁵³ι
```
[Try it online!](https://tio.run/##S85ILErOT8z5/z@gKDOvRMM3sUDD0MDAQEfBscQzLyW1QkPJwFBJRyEkMze1WEPPyNLI1FhHIVMTCKz///@vW5YDAA "Charcoal – Try It Online") Link is to verbose version of code. Explanation:
```
 φ              Predefined variable 1000
Ｅ               Map over implicit range
            ι   Current value
      ·²⁹²⁵³    Literal constant `0.29253`
     ×          Multiply
   01           Literal string `01`
  §             Cyclically index
                Implicitly print each result on its own line
```
Thanks to @ASCII-only for allowing indexing to accept floats which are cast to integer (and then automatically reduced modulo 2 in this case).
[Answer]
# C, ~~55~~ ~~53~~ 52 bytes
```
f(i,j){for(i=0;j=.29253*i,i++-1e3;)putchar(j%2+48);}
```
Port of Kevin Cruijssen's Java [answer](https://codegolf.stackexchange.com/a/162805/79343). Try it online [here](https://tio.run/##S9ZNT07@/z9NI1MnS7M6Lb9II9PWwDrLVs/I0sjUWCtTJ1NbW9cw1dhas6C0JDkjsUgjS9VI28RC07r2f25iZp4GUJMGiAMA).
Thanks to [vazt](https://codegolf.stackexchange.com/users/78276/vazt) for golfing 2 bytes and to [Jonathan Frech](https://codegolf.stackexchange.com/users/73111/jonathan-frech) for golfing one more.
Ungolfed version:
```
f(i, j) { // function taking two dummy arguments (implicitly int) and implicitly returning an unused int
    for(i = 0; j = .29253*i, i++ - 1e3; ) //  loop 1000 times, multiply i with 0.29253, truncating to an integer
        putchar(j % 2 + 48);  // modulo the truncated integer by 2, yielding 0 or 1, then convert to ASCII (48 is ASCII code for '0') and print
}
```
[Answer]
# [///](https://esolangs.org/wiki////), 63 bytes
```
/b/000111//A/b1b//B/b0b//C/0BA1//X/CACACACA0bCBCBCB/0bXXCBXCAC0
```
[Try it online!](https://tio.run/##JcjBCcBQCATRknYtQW3C618I5JCb/WMM4R0Gpp/T99UzEEiaGeCQCQiImwTD9xbSf1TGB1RVRu3jzAs "/// – Try It Online")
[Answer]
# Deadfish~, 1301 bytes
```
{iiiii}ddccccicccdccccicccdccccicccdccciccccdccciccccdccciccccdcccicccdccccicccdccccicccdccciccccdccciccccdccciccccdcccicccdccccicccdccccicccdccciccccdccciccccdccciccccdcccicccdccccicccdccccicccdccciccccdccciccccdccciccccdcccicccdccccicccdccccicccdccccicccdccciccccdccciccccdcccicccdccccicccdccccicccdccccicccdccciccccdccciccccdcccicccdccccicccdccccicccdccccicccdccciccccdccciccccdcccicccdccccicccdccccicccdccccicccdccciccccdccciccccdccciccccdcccicccdccccicccdccccicccdccciccccdccciccccdccciccccdcccicccdccccicccdccccicccdccciccccdccciccccdccciccccdcccicccdccccicccdccccicccdccciccccdccciccccdccciccccdcccicccdccccicccdccccicccdccccicccdccciccccdccciccccdcccicccdccccicccdccccicccdccccicccdccciccccdccciccccdcccicccdccccicccdccccicccdccccicccdccciccccdccciccccdcccicccdccccicccdccccicccdccccicccdccciccccdccciccccdcccicccdccccicccdccccicccdccccicccdccciccccdccciccccdccciccccdcccicccdccccicccdccccicccdccciccccdccciccccdccciccccdcccicccdccccicccdccccicccdccciccccdccciccccdccciccccdcccicccdccccicccdccccicccdccciccccdccciccccdccciccccdcccicccdccccicccdccccicccdccccicccdccciccccdccciccccdcccicccdccccicccdccccicccdccccicccdccciccccdccciccccdcccicccdccccicccdccccicccdccccicccdccciccccdccciccccdcccicccdccccicccdccccicccdccccicccdccciccccdccciccccdccciccccdcccicccdccccicccdccccicccdccciccccdccciccccdc
```
]


[Question]
      [
Given integers `N , P > 1` , find the largest integer `M` such that `P ^ M ‚â§ N`.
### I/O:
Input is given as 2 integers `N` and `P`. The output will be the integer `M`.
### Examples:
```
4, 5 -> 0
33, 5 -> 2
40, 20 -> 1
242, 3 -> 4
243, 3 -> 5
400, 2 -> 8
1000, 10 -> 3
```
### Notes:
The input will always be valid, i.e. it will always be integers greater than 1.
### Credits:
Credit for the name goes to @cairdcoinheringaahing. The last 3 examples are by @Nitrodon and credit for improving the description goes to @Giuseppe.

[Answer]
# [Brain-Flak](https://github.com/DJMcMayhem/Brain-Flak), 74 bytes
```
(({}<>)[()])({()<(({})<({([{}]()({}))([{}]({}))}{})>){<>({}[()])}{}>}[()])
```
[Try it online!](https://tio.run/##SypKzMzTTctJzP7/X0OjutbGTjNaQzNWU6NaQ9MGJAAkqzWiq2tjNTRBPE0IG8SqBRJ2mtU2dkAeWA9QwA7C@v/fSMHEwAAA "Brain-Flak ‚Äì Try It Online")
This uses the same concept as the standard Brain-Flak positive integer division algorithm.
```
# Push P and P-1 on other stack
(({}<>)[()])
# Count iterations until N reaches zero:
({()<
  # While keeping the current value (P-1)*(P^M) on the stack:
  (({})<
    # Multiply it by P for the next iteration
    ({([{}]()({}))([{}]({}))}{})
  >)
  # Subtract 1 from N and this (P-1)*(P^M) until one of these is zero
  {<>({}[()])}{}
# If (P-1)*(P^M) became zero, there is a nonzero value below it on the stack
>}
# Subtract 1 from number of iterations
[()])
```
[Answer]
# JavaScript (ES6), 22 bytes
*Saved 8 bytes thanks to @Neil*
Takes input in currying syntax `(p)(n)`.
```
p=>g=n=>p<=n&&1+g(n/p)
```
[Try it online!](https://tio.run/##XclBDkAwEADAu1f0JLsRSkviYP2lQRsi2wbx/SJxYa6zmNPswzaHI2c/TtFSDNQ7YupDR5ymVeaAZcA4eN79OhWrd2ChQdAaUQgphUq@p0qEurzzvup/T73Xxgs "JavaScript (Node.js) ‚Äì Try It Online")
[Answer]
# Excel, 18 bytes
```
=TRUNC(LOG(A1,A2))
```
Takes input "n" at A1, and input "p" at A2.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 3 bytes
```
b·∏äL
```
This doesn't use floating-point arithmetic, so there are no precision issues.
[Try it online!](https://tio.run/##y0rNyan8/z/p4Y4un//FRtZKh5cb6bv//29srKNgqqNgYqCjYGQAokEMIDIBEsYg2hhMm4BVGRqApA0NAA "Jelly ‚Äì Try It Online")
### How it works
```
b·∏äL  Main link. Left argument: n. Right argument: p
b    Convert n to base p.
 ·∏ä   Dequeue; remove the first base-p digit.
  L  Take the length.
```
[Answer]
# [Retina 0.8.2](https://github.com/m-ender/retina/wiki/The-Language/a950ad7d925ec9316e3e2fb2cf5d49fd15d23e3d), 35 bytes
```
.+
$*
+r`1*(\2)+¬∂(1+)$
#$#1$*1¬∂$2
#
```
[Try it online!](https://tio.run/##K0otycxL/P9fT5tLRYtLuyjBUEsjxkhT@9A2DUNtTRUuZRVlQxUtw0PbVIy4lP//NzbmMgUA "Retina 0.8.2 ‚Äì Try It Online") Explanation:
```
.+
$*
```
Convert the arguments to unary.
```
+r`1*(\2)+¬∂(1+)$
#$#1$*1¬∂$2
```
If the second argument divides the first, replace the first argument with a `#` plus the integer result, discarding the remainder. Repeat this until the first argument is less than the second.
```
#
```
Count the number of times the loop ran.
[Answer]
# Japt, 8 bytes
```
@<Vp¬∞X}a
```
[Try it](https://ethproductions.github.io/japt/?v=1.4.5&code=QDxWcLBYfWE=&input=NDAwLDI=)
[Answer]
# [Haskell](https://www.haskell.org/), 30 bytes
```
n!p=until((>n).(p^).(1+))(1+)0
```
[Try it online!](https://tio.run/##y0gszk7Nyfn/P0@xwLY0ryQzR0PDLk9TT6MgDkgYamtqggiD/7mJmXm2BUWZeSUqXApVmQXhmSUZGoqa0cbGOiYGQGQQG22qY2SgYxT7HwA "Haskell ‚Äì Try It Online")
[Answer]
# [Perl 6](https://github.com/nxadm/rakudo-pkg), 13 bytes
```
&floor‚àò&log
```
[Try it online!](https://tio.run/##K0gtyjH7n1upoJZq@18tLSc/v@hRxwy1nPz0/9ZcxYkgcQ0TAwMdI00419hYx1TzPwA "Perl 6 ‚Äì Try It Online")
Concatenation composing log and floor, implicitly has 2 arguments because first function log expects 2. Result is a function.
[Answer]
# [C (gcc)](https://gcc.gnu.org/) + `-lm`, 24 bytes
```
f(n,m){n=log(n)/log(m);}
```
[Try it online!](https://tio.run/##S9ZNT07@/z9NI08nV7M6zzYnP10jT1MfROVqWtf@z03MzNPQrC4oyswrSdNQUk1R0knTMDbWMdUEyf5LTstJTC/@r5uTCwA "C (gcc) ‚Äì Try It Online")
[Answer]
# [Haskell](https://www.haskell.org/), 16 bytes
```
(floor.).logBase
```
[Try it online!](https://tio.run/##y0gszk7NyfmfZhvzXyMtJz@/SE9TLyc/3SmxOPV/bmJmnoKtQkFRZl6JgopCmoKpgrHx/3/JaTmJ6cX/dZMLCgA "Haskell ‚Äì Try It Online")
Haskell was designed by mathematicians so it has a nice set of math-related functions in Prelude.
[Answer]
# [R](https://www.r-project.org/), 25 bytes
```
function(p,n)log(p,n)%/%1
```
[Try it online!](https://tio.run/##K/qfpmCjq/A/rTQvuSQzP0@jQCdPMyc/HUyr6qsa/k/TMDEw0DHS/A8A "R ‚Äì Try It Online")
Take the log of `P` base `N` and do integer division with `1`, as it's shorter than `floor()`. This suffers a bit from numerical precision, so I present the below answer as well, which should not, apart from possibly integer overflow.
# [R](https://www.r-project.org/), 31 bytes
```
function(p,n)(x=p:0)[n^x<=p][1]
```
[Try it online!](https://tio.run/##K/qfpmCj@z@tNC@5JDM/T6NAJ09To8K2wMpAMzovrsLGtiA22jD2f5qGiYGBjpHmfwA "R ‚Äì Try It Online")
[Answer]
# [Python 2](https://docs.python.org/2/), 39 bytes
```
lambda a,b:math.log(a,b)//1
import math
```
[Try it online!](https://tio.run/##K6gsycjPM/qfZhvzPycxNyklUSFRJ8kqN7EkQy8nP10DyNHU1zfkyswtyC8qUQCJ/y8oyswr0UjT0MrMKygt0dDU1PxvbKyjYAoA "Python 2 ‚Äì Try It Online")
[Answer]
# [Ruby](https://www.ruby-lang.org/), 31 bytes
OK, so all those log-based approaches are prone to rounding errors, so here is another method that works with integers and is free of those issues:
```
->n,p{(0..n).find{|i|p**i>n}-1}
```
[Try it online!](https://tio.run/##Pcw7CoAwEEXR3lUM2KjEMMlEsNGNiI1IIE0IgoWoa4/5qK888O62L4fXg29Hy9xZIee25trY9bzM5ZrGjPZuxe0d6ImIQTdDWAmyiKKQgcQ5iXglUpY@iVSSAWVRr9AvXX594SCYRGAMidAugfwD "Ruby ‚Äì Try It Online")
But going back to logarithms, although it is unclear up to what precision we must support the input, but I think this little trick would solve the rounding problem for all more or less "realistic" numbers:
# [Ruby](https://www.ruby-lang.org/), 29 bytes
```
->n,p{Math.log(n+0.1,p).to_i}
```
[Try it online!](https://tio.run/##KypNqvyfZvtf1y5Pp6DaN7EkQy8nP10jT9tAz1CnQFOvJD8@s/Z/gUJatLGxjoJprAIQKCsYcYFETAx0FIwMYsEihlARkBBExAIsYmRipKNgDBExgYoYw0VMIbpgBgNFDMAihgYggwyBZisrGP8HAA "Ruby ‚Äì Try It Online")
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 5 bytes
```
√¨V √ä√â
```
[Try it online!](https://tio.run/##y0osKPn///CaMIXDXYc7//83MTDgMgIA)
---
## 8 bytes
```
N¬£MlX√É√§z
```
[Try it online!](https://tio.run/##y0osKPn/3@/QYt@ciMPNh5dU/f9vYmCgYwQA "Japt ‚Äì Try It Online")
[Answer]
# [Emojicode](http://www.emojicode.org/), ~~49~~ 48 bytes
```
üçáiüöÇjüöÇ‚û°Ô∏èüöÇüçé‚ûñüêîüî°i j 1üçâ
```
[Try it online!](https://tio.run/##S83Nz8pMzk9J/f9hfn@jwof5ve1cCiBqWVppXvJ/ED/zw/xZTVkg4tG8he939INYQPG@R/OmfZg/YcqH@VMWZipkKRgCxTr/g/TOaFAACYJMWasAMkbB0MDAAEgAERdYFQA "Emojicode ‚Äì Try It Online")
[Answer]
# [APL (Dyalog Unicode)](https://www.dyalog.com/), 2 bytes
```
‚åä‚çü
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT///P@1R24RHPV2Peuf//2@qkKZgbMxlZACkTQy4jMCUAQA "APL (Dyalog Unicode) ‚Äì Try It Online")
Pretty straightforward.
`‚çü` Log
`‚åä` floor
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 6 bytes
```
Lm¬π‚Ä∫_O
```
[Try it online!](https://tio.run/##MzBNTDJM/f/fJ/fQzkcNu@L9//83NDAw4DI0AAA "05AB1E ‚Äì Try It Online")
[Answer]
# [JavaScript](https://nodejs.org), ~~40~~ 33 bytes
*-3 bytes thanks to DanielIndie*
Takes input in currying syntax.
```
a=>b=>(L=Math.log)(a)/L(b)+.001|0
```
[Try it online!](https://tio.run/##Zc5NCoMwEAXgfU/hcoZSM/kRuokn0ENEq/1BjFTpyrunmYKljW/7wXvv4V5ubp/3aTmN/tKF3gZny8aWUNnaLbd88FcEh6KCBo85kVwptH6c/dCxQQ9aIxSIWYwQmTr8qyEERR@OKnfKvOk5UWUUgt7U7FT/aJE2f0@xUqKSeFjyr6g6vAE)
[Answer]
# Pari/GP, 6 bytes
```
logint
```
(built-in added in version 2.7, Mar 2014. Takes two arguments, with an optional third reference which, if present, is set to the base raised to the result)
[Answer]
# Python 2, 3, 46 bytes
*-1 thanks to jonathan*
```
def A(a,b,i=1):
 while b**i<=a:i+=1
 return~-i
```
## Python 1, 47 bytes
```
def A(a,b,i=1):
 while b**i<=a:i=i+1
 return~-i
```
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), 22 bytes
```
m=>f=n=>n<m?0:f(n/m)+1
```
[Try it online!](https://tio.run/##LY/BDsIgDIbve4oeAVEZjMQZmQ@ycFjmXDTCzLb4@pOWHUj6/f1o4d39uqWfX9/1GKfHsI1uC655uuiaeAt3dX2yeA78UG7rsKwLOGgLgLaSYCUoL6E1hmqNdaVSkU6JoCstITWrDIbAZg09CReEuq7TBbVPKBX2EI2XuEkLYfWxJN/muZhk1tkxQhhycAc5lGTeHSuEJgffSg4lmbUvfFHQD0@h@zLWRglBwuw5uAb6KS7TZzh9ppGNLHAWU@xg5nz7Aw "JavaScript (Node.js) ‚Äì Try It Online")
Curried recursive function. Use as `g(P)(N)`. Less prone to floating-point errors than [using `Math.log`](https://codegolf.stackexchange.com/a/162720/78410), and (I believe) the code gives correct values as long as both inputs are safe integers (under `2**52`).
[Answer]
# [Haskell](https://www.haskell.org/), ~~35~~ 34 bytes
```
n!p=last.fst$span((<=n).(p^))[0..]
```
Thanks @Laikoni for saving 1 byte
[Try it online!](https://tio.run/##DcJBCoAgEADAr6zQQUFEtG75jg5i4KFQsmXJPfV5a5iS@3W0NgYKCi13NmfnqVNGKdeAykjalYrWmDTuXBEC0FORYYK30la5gBQKovd6tn@bIC7aWe3S@AA "Haskell ‚Äì Try It Online")
[Answer]
# [J](http://jsoftware.com/), 5 bytes
```
<.@^.
```
[Try it online!](https://tio.run/##y/qvpKeepmBrpaCuoKNgoGAFxLp6Cs5BPm7/bfQc4vT@a3JxpSZn5CuYKqQpGBtD2EYGQI6JAZQDZhtw/QcA "J ‚Äì Try It Online")
[Answer]
## Wolfram Language (Mathematica) ~~15~~ 10 Bytes
```
Floor@*Log
```
(requires reversed order on input)
Original submission
```
‚åä#2~Log~#‚åã&
```
[Answer]
# [Forth (gforth)](http://www.complang.tuwien.ac.at/forth/gforth/Docs-html/), 35 bytes
```
: f swap s>f flog s>f flog f/ f>s ;
```
[Try it online!](https://tio.run/##TcxBCoAgFIThvaf4L1CJ2qbAu0TwbBEYGnR8s0XZ6s3HDE9iOrcuyHNKmRDytRxkL8geQwsyID4zF2thpA571qScBqObNObrjDPYV1TaRuX4vSk3 "Forth (gforth) ‚Äì Try It Online")
Could save 5 bytes by swapping expected input parameters, but question specifies N must be first (an argument could be made that in a postfix language "First" means top-of-stack, but I'll stick to the letter of the rules for now)
## Explanation
```
swap       \ swap the parameters to put N on top of the stack
s>f flog   \ move N to the floating-point stack and take the log(10) of N
s>f flog   \ move P to the floating-point stack and take the log(10) of P
f/         \ divide log10(N) by log10(P)
f>s        \ move the result back to the main (integer) stack, truncating in the process
```
[Answer]
# Pyth, 6 4 bytes
```
s.lF
```
Saved 2 bytes thanks to Mmenomic
[Try it online](http://pyth.herokuapp.com/?code=s.lhQe&input=400%2C+2&debug=1)
## How it works
`.l` is logB(A)
To be honest, I have no idea how `F` works. But if it works, it works.
`s` truncates a float to an int to give us the highest integer for `M`.
[Answer]
# [Wonder](https://github.com/wonderlang/wonder), 9 bytes
```
|_.sS log
```
Example usage:
```
(|_.sS log)[1000 10]
```
# Explanation
Verbose version:
```
floor . sS log
```
This is written pointfree style. `sS` passes list items as arguments to a function (in this case, `log`).
[Answer]
# [Gforth](https://www.gnu.org/software/gforth/), 31 Bytes
```
SWAP S>F FLOG S>F FLOG F/ F>S .
```
## Usage
```
242 3 SWAP S>F FLOG S>F FLOG F/ F>S . 4 OK
```
[Try it online!](https://tio.run/##S8svKsnQTU8DUf@NTIwUjP8HhzsGKATbuSm4@fi7Ixhu@gpudsEKev@BAAA "Forth (gforth) ‚Äì Try It Online")
## Explanation
Unfortunately FORTH uses a dedicated floating-point-stack. For that i have to `SWAP` (exchange) the input values so they get to the floating point stack in the right order. I also have to move the values to that stack with `S>F`. When moving the floating-point result back to integer (`F>S`) I have the benefit to get the truncation for free.
## Shorter version
Stretching the requirements and provide the input in float-format and the right order, there is a shorter version with 24 bytes.
```
FLOG FSWAP FLOG F/ F>S .
3e0 242e0 FLOG FSWAP FLOG F/ F>S . 4 OK
```
[Try it online!](https://tio.run/##S8svKsnQTU8DUf@NUw0UjEyMUg3@u/n4uyu4BYc7BihAmPoKbnbBCnr/gQAA "Forth (gforth) ‚Äì Try It Online")
[Answer]
# [Husk](https://github.com/barbuz/Husk), ~~8~~ ~~7~~ 4 bytes
```
Lt`B
```
[Try it online!](https://tio.run/##yygtzv6fe2h5arFGsdujpsb/PiUJTv///4/WMDbWMdXU0TAx0DEyANNABpA2MjHSMQbTxmDaBKzK0AAobWigGQsA "Husk ‚Äì Try It Online")
[Answer]
# [C (gcc)](https://gcc.gnu.org/), 61 bytes
```
i(n,t,l,o,g){for(l=g=0;!g++;g=g>n)for(o=++l;o--;g*=t);g=--l;}
```
[Try it online!](https://tio.run/##RczJboMwFAXQdfMVN1RINhjJGNPJcvMTWXYTMViWwKDALsq3U5uhXTw9v2PdW2WmqpbFEsdm1rGBGfpohzvptNFcnU2aKqPNt6MBB52mnRqyTJlEz9T/ZFmnnstr3bTWNbj6FowMPcV4t25uSWRJLGuGWNQUOizoy7pIPNEfFzFsEbtGqc/@vaE1elwQjbdpauoIX4gSN8wJdqDq1N@sI/RxerkSoCgYUPoRdAPJGYQf5BtIHg7h52MDIcMRYvKAYody74DcS/kKOQ8deegpVpD8s9xK8/yAtx3EAe//8Fx@AQ "C (gcc) ‚Äì Try It Online")
]


[Question]
      [
# Challenge :
Your job is to find the given number `N`.
---
# Input :
You will be given a string in the following form:
```
dN ± Y = X
```
Where:
```
d, N, X, Y are all numbers with d , X , Y being integers (not decimals).
```
---
# Output :
Solve the equation and output the value of `N` rounded. Round up if decimal is greater than or equal to `0.5` and round down if less than `0.5`
---
# Examples :
```
Input                  Output
 N + 1 = 3        ---> 2
 N - 1 = 5        ---> 6
2N + 1 = 3        ---> 1
2N + 1 = 4        ---> 2
```
---
# Winning criteria :
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") so the shortest code in each language wins.
---
# Notes :
* Answer must be rounded it cannot be a float
* Whitespace do not matter. You can have every element in the string separated by white space if you want or if you don't want leave it as it is.
* You do not need to check for invalid input. i.e. All inputs will be strings in the given format.
---

[Answer]
# [Python 2](https://docs.python.org/2/), ~~88~~ ~~74~~ 70 bytes
-14 bytes thanks to [Chas Brown](https://codegolf.stackexchange.com/users/69880/chas-brown).
-4 bytes thanks to [Sunny Patel](https://codegolf.stackexchange.com/users/58557/sunny-patel).
```
d,w,Y,_,X=input().split()
print round((int(X)-int(w+Y))/float(d[:-1]))
```
[Try it online!](https://tio.run/##K6gsycjPM/qfnJ@SaqukpPQ/RadcJ1InXifCNjOvoLREQ1OvuCAnE0hzFRRl5pUoFOWX5qVoaACZGhGauiCqXDtSU1M/LSc/sUQjJdpK1zBWU/M/0CgurtSK1GQFkMlaJv@VDP0UtBUMFWwVjJW4QBxdMMcUyDFCloFzTJQA "Python 2 – Try It Online")
[Answer]
under the assumption (according to comments) that we deal only with digits
# [JavaScript (Node.js)](https://nodejs.org), 30 bytes
\*thanks for @Rick Hitchcock for pointing out i can use 1 instead of space (reduces 13 bytes
```
x=>(x[3]+x[5]-x[9])/-x[0]+.5|0
```
[Try it online!](https://tio.run/##y0osSyxOLsosKNHNy09J/Z9m@7/C1k6jIto4Vrsi2jRWtyLaMlZTH0gZxGrrmdYY/E/OzyvOz0nVy8lP10jTUDL0U9BWMFSwVTBW0rS1NdLkwpTXBcubguTNMOSNUPQbairgVGACseA/AA "JavaScript (Node.js) – Try It Online\"e")
[Answer]
# [Python 2](https://docs.python.org/2/), ~~64~~ 63 bytes
Using [`eval`](https://docs.python.org/2/library/functions.html#eval)
```
d,w,Y,_,X=input().split()
print-eval('('+w+Y+'-'+X+')/'+d[:-1])
```
[Try it online!](https://tio.run/##K6gsycjPM/qfnJ@SaqukpPQ/RadcJ1InXifCNjOvoLREQ1OvuCAnE0hzFRRl5pXoppYl5mioa6hrl2tHaqvrqmtHaKtr6qtrp0Rb6RrGav4HmsGVWpGarAAyUcvkv5Khn4K2gqGCrYKxEheIowvmmAI5RsgycI6JEgA "Python 2 – Try It Online")
Saved 1 byte thanks to [Keyu Gan](https://codegolf.stackexchange.com/users/59292/keyu-gan)
[Answer]
# Java 10, ~~111~~ 94 (or 92) bytes
```
s->{var a=s.split("N|=");return(int)((new Float(a[2])-new Float(a[1]))/new Float(a[0])+.5);}
```
Input is in the format `dN±Y=X` (without any spaces) instead of `dN ± Y = X`.
[Try it online.](https://tio.run/##jU@xbsIwEN35ilMmn1DchpYpMiNbszCiDFfjVgbjRPYlFYJ8e@qGDExtpbvhvXt6792ResqPh9OoHcUIb2T9dQFgPZvwQdpA9QMnArTYcbD@EyKWiRzSpolMbDVU4EHBGPPNtacApKKMrbMssuqmMiyD4S54kXxQCG@@YOsaYkH7VY35Iy5qxKdH4rnGpVxjOYzlPbHt3l1KnIP7xh7gnHrP7fY14b3z7hLZnGXTsWzThZ0XXmqRFdWyUC8ZTl/8JssLtf5Ttvqf2yR7nWXDYhi/AQ)
2 more bytes could be saved if the numbers are never outside the `[-128, 127]` range, in which case the last and one of the two first `Float` can be changed to `Byte`.
[Try it online.](https://tio.run/##jU8xbsMwDNzzCsKTiMBqnTaToQ4dutVLxsADq6iBUkU2JNpFkPrtruJ4yJQWIIc7Hu6OB@opP@y@Ru0oRngn688LAOvZhE/SBqoLnAjQYsPB@j1ELBM5pE0TmdhqqMCDgjHmL@eeApCKMrbOssiqH5VhGQx3wYvkg0J48w1vriEWtF3VmF/w64lNgkWN@HCDH2tcyjWWw1he89ruw6W8ObZv7A6OqfXcbVsTXhtvTpHNUTYdyzZd2HnhpRZZUS0L9ZTh9MM9WV6o9Z@y1f/cJtnzLBsWw/gL)
**Explanation:**
```
s->{                             // Method with String parameter and integer return-type
  var a=s.split("N|=");          //  And split by "N" or "=" to a String-array
  return(int)((new Float(a[2])   //  Return the third number (after the equal sign),
               -new Float(a[1])) //   minus the second number (including leading +/-),
              /new Float(a[0])   //   divided by the first number
         +.5);}                  //  Rounded by using `(int)(R + 0.5)`
```
[Answer]
# [Japt](https://github.com/ETHproductions/japt) v2.0a0, 20 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
```
q/N|=/ f
o!-Uo)r!÷ r
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=2.0a0&code=cS9OfD0vIGYKbyEtVW8pciH3IHI&input=IjJOKzE9NCI)
```
q/N|=/ f\no!-Uo)r!÷ r     :Implicit input of string U
                          : e.g. "2N+1=4"  "N+1=4"
q                         :Split on
 /N|=/                    :  "N" or "="
                          > ["2","+1","4"] ["","+1","4"]
       f                  :Filter (removes the first element if the string started with "N")
                          > ["2","+1","4"] ["+1","4"]
        \n                :Reassign to U
             Uo           :Pop last element (X)
                          > "4"            "4"
          o               :Modify last element (Y)
           !-             :X-Y
                          > ["2",3]        [3]
                r         :Reduce by
                 !÷       :  Inverse division
                          > 1.5            3
                    r     :Round
                          > 2              3
```
[Answer]
# [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), ~~54~~ 46 bytes
```
Round[ToExpression[""<>(#/."="->"-")]~Root~1]&
```
[Try it online!](https://tio.run/##y00syUjNTSzJTE78n2b7Pyi/NC8lOiTftaKgKLW4ODM/L1pJycZOQ1lfT8lWSddOSVdJM7YuKD@/pM4wVu1/QFFmXkl0WnS1kpGSjpIfEGsDsSEQ2wKxiVJtbOx/AA "Wolfram Language (Mathematica) – Try It Online")
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), 44 bytes
```
x=>([m,a,r]=x.split(/N|=/),r-a)/(+m||1)+.5|0
```
[Try it online!](https://tio.run/##fc27DoMgGEDhvU/BJoSb0NKl@X0EXqDpQKw2NigGjHHg3enSwaSX/cs5T7e61MZhXvgU7l3poWzQ4OvIHIs32ESa/bBgaTNIwiJ3RGI65qwIFSbXpQ1TCr4TPjxwjytkqYJjRRAAII3I5fABuALzBucvQO8L6hc4/Vmo2lID2uxIeQE "JavaScript (Node.js) – Try It Online")
Or, for only single-digit numbers:
# [JavaScript (Node.js)](https://nodejs.org), 36 bytes
```
([m,,o,a,,r])=>-(o+a-r)/(+m||1)+.5|0
```
[Try it online!](https://tio.run/##y0osSyxOLsosKNHNy09J/Z9m@18jOldHJ18nUUenKFbT1k5XI187UbdIU19DO7emxlBTW8@0xuB/cn5ecX5Oql5OfrpGmoa6gp@2oa2xuqaCra2tgpGCpjUXhgJdQ1tTqAIzLAqMkE0wxKXABMmK/wA "JavaScript (Node.js) – Try It Online")
[Answer]
# [C (clang)](http://clang.llvm.org/), 133 bytes
```
N,d,y,x,a[9],o;f(*s){sscanf(s," %[0-9N] %c %d = %d",a,&o,&y,&x);d=!sscanf(a,"%d",&d)?1:d;N=(x-(o>43?-y:y))*2/d;printf("%d",N/2+N%2);}
```
[Try it online!](https://tio.run/##bY/vboIwFMW/9ynuukBabMcfYYsy9A14AeOHppVJwsBQSCDGZ2eATtDYD@3N75x7ciq5zET@072nucxqdYBvXam0@Dhuupgp1rKGid1qz4owIZamZ62lyBOiGQZj5/BVvAdDgqEg6i/MBDMLZrbMbGioorebWzA8iKaiW3etwjgiDSfFxl9uebtuKbU8W4WnMs2rhIzO2PYWseHR8NJJkWUJkUdRglVJCnBGcLdquB3O@QYAM@gtIYKEXN9TXWmCcT9eEOp34FekOaFDxjUXQwwLcPv2y8E1o3ykwZx6L7136s/p8p@6D@ZgwMEQ4cyx@@Xcs313UFB5qOoyB2esbltoKvrwZw9NXR@ET@S93nBhUvynLMtG3R8 "C (clang) – Try It Online")
This handles all spaces except between `d` and `N`.
[Removed wrong answer that rounds down]
[Answer]
# [Befunge-93 (FBBI)](https://github.com/catseye/FBBI), ~~34~~ 26 bytes
```
&~$~90p0&X&-2*\/-:2%\2/+.@
```
[Try it online!](https://tio.run/##S0pNK81LT9W1NNZNS0rK/P9frU6lztKgwEAtQk3XSCtGX9fKSDXGSF9bz@H/fxM/bQNbYwA "Befunge-93 (FBBI) – Try It Online")
If we didn’t need to bother with rounding correctly, it could be much smaller:
```
&~$~90p0&X&-\/-.@
```
[Try it online!](https://tio.run/##S0pNK81LT9W1NNZNS0rK/P9frU6lztKgwEAtQk03Rl9Xz@H/fzM/bUtbEyMA "Befunge-93 (FBBI) – Try It Online")
`-\/-`
[Answer]
# [Yabasic](http://www.yabasic.de), 142 bytes
An anonymous function that takes input as a string and outputs to the console.
```
Line Input""s$
dim n$(5)
k=token(s$,n$())
n$=n$(1)
If n$="N"n$=("1N")
?Int((Val(n$(5))-Val(n$(2)+"1")*Val(n$(3)))/Val(Left$(n$,Len(n$)-1))+.5)
```
[Try it online!](https://tio.run/##Rc7BCsIwDAbge58ihB4atymd27F4EwajJ/E@tYMy7cRV0KevcQy9hC8/Ccm7O3WTP6f9@ABvQMNhhCq1Pjhowv0ZEScpLv4GQaqaxGDiOLigJplzQCSCNAxNoul5xKBFrgq1RRK7JkSljt1VzctULCwpQ420WtotEW2@bl0fJSd5yxeCpEITZeuaknWvmMBCxv8Z2ApmMbMW5T/9sfoA "Yabasic – Try It Online")
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal), 110 bits1, 13.75 [bytes](https://github.com/Vyxal/Vyncode/blob/main/README.md)
```
‛Nx*\=/ƒ∆qh.1+ṙ
```
[Try it Online!](https://vyxal.pythonanywhere.com/?v=1#WyJ+PSIsIiIsIuKAm054KlxcPS/GkuKIhnFoLjEr4bmZIiwiIiwiISguKikgKy0tLT4gKFxcZCspXG4gTiArIDEgPSAzICAgICAgICAtLS0+IDJcbiBOIC0gMSA9IDUgICAgICAgIC0tLT4gNlxuMk4gKyAxID0gMyAgICAgICAgLS0tPiAxIFxuMk4gKyAxID0gNCAgICAgICAgLS0tPiAyIl0=)
Python rounding is a little goofy hence the `.1+ṙ` at the end.
Could be [9.125 bytes: `‛Nx*\=/ƒ∆q`](https://vyxal.pythonanywhere.com/?v=1#WyJ+PSIsIiIsIuKAm054KlxcPS/GkuKIhnEiLCIiLCIhKC4qKSArLS0tPiAoXFxkKylcbiBOICsgMSA9IDMgICAgICAgIC0tLT4gMlxuIE4gLSAxID0gNSAgICAgICAgLS0tPiA2XG4yTiArIDEgPSAzICAgICAgICAtLS0+IDEgXG4yTiArIDEgPSA0ICAgICAgICAtLS0+IDIiXQ==) if it wasn't for rounding.
## Explained
```
‛Nx*\=/ƒ∆qh.1+ṙ
‛Nx*            # Replace all N with x
    \=/         # split on equal sign
       ƒ∆q      # and solve the equation for x. Yes. There's a built in for it.
          h.1+  # add 0.1 to the result to account for the fact that python seems to round down if <= 0.5 instead of < 0.5
              ṙ # round the answer as required
```
[Answer]
# [Scala 3](https://www.scala-lang.org/), 168 bytes
```
import java.lang._
import scala.util.chaining._
val c:String=>Int=_.split("N|=").pipe(a=>(new Float(a(2))-new Float(a(1)))/new Float(a(0))).pipe(x=>math.round(x).toInt)
```
[Attempt This Online!](https://ato.pxeger.com/run?1=bY5BTsMwEEX3PcUoK49QDGlBQkiOxAapi3bDGlWD61JXrm0lkzZS4SRssgFxBY7CbTBJFxWwGv3358-f1_dak6NJ9xkeN0YzzMh6MC0bv6zhNkY4vDW8yq-_Puw2hophQzuSjvyTXIyOqD8hG7ZO6nXK297ckQN9c89VkqqcelYLWUdnWWTzZ5WhjDYaQaoU3uzhzgViQWKMmJ_qAhHPT8FFAkO0VeWWeC2r0PilaFFySC14_PcBIKZqdl5okRXzs0JNMsTRL5wX6uoPHv-_3ePLH_wylHTdML8B)
[Answer]
# [Matlab], 91 bytes
this is the most resilient version.
assuming that s is the input string.
```
syms N;v=str2double(regexp(s,'(?<!\d)(\d)+(?!\d)','match'));round(solve(v(1)*N+v(2)==v(3)))
```
# [Matlab], 74 bytes
```
syms N;round(solve(str2double(s(1))*N+str2double(s(4))==str2double(s(6))))
```
but doesnt really work if for example Y was 2 digits (ie 10). I'll try to improve it a bit.
# [Matlab], 29 bytes
if the input was just the numbers and not a string
```
sym N;round(solve(d*N+Y==X))
```
[Answer]
# [Convex](https://github.com/GamrCorps/Convex), 19 bytes
```
S-®-?\d+"ô:d~\-\/mo
```
[Try it online!](https://tio.run/##S87PK0ut@P8/WPfQOl37mBRtpcNbrFLqYnRj9HPz////r2Tkp6CtYKhgq2CiBAA "Convex – Try It Online")
[Answer]
# PHP, 45 bytes
```
<?=round((($s=$argn)[3].$s[5]-$s[9])/-$s[0]);
```
Run with `echo '<input>' | php -nF <filename>` or [Try it online](https://tio.run/##K8go@P/fxr4go4BLJbEoPU/BVkHd0E9BW8EQyDJWt1bQ11fwLy0pKC1RMNLjAnKQVemCVZmiqDJDVWWE3SxDHKpM0G20t@Oysbctyi/NS9HQ0FAptgXr0Yw2jtVTKY42jdUFkpaxmvog2iBW05rr/38A).
This requires that `d` always be given, and that the string is the same length each time, e.g.:
* `N + 1 = 3` *won't* work, but `1N + 1 = 3` *will* work.
* `1N +1 =3` *won't* work, but `1N + 1 = 3` *will* work.
[Answer]
# J, 26 Bytes
```
<.({.%~{:-1&{)".>0 2 4{cut
```
Note that the result for N is floored (not rounded), so for the last test case it returns 1 instead of 2. If this is unacceptable I will change the answer.
Input should be of the form `'d N +-Y = X'`
### Explanation:
```
   cut '10 N +2 = 23'  NB. Split on whitespace
┌──┬─┬──┬─┬──┐
│10│N│+2│=│23│
└──┴─┴──┴─┴──┘
   0 2 4{cut '10 N +2 = 23'  NB. Choose relevant portions
┌──┬──┬──┐
│10│+2│23│
└──┴──┴──┘
   ".>0 2 4{cut '10 N +2 = 23'  NB. Eval each
10 2 23
   ({.%~{:-1&{)".>0 2 4{cut'10 N +2 = 23'  NB. Compute (x-y)/d
2.1
   <.({.%~{:-1&{)".>0 2 4{cut'10 N +2 = 23'  NB. Floor
2
```
[Answer]
## C# (149 Bytes)
```
s=>(int)Math.Round(((s=s.Replace(" ",""))[s.Length-1]-48-((s.Contains("-")?-1:1)*(s.Split(new[]{'+','-'})[1][0]-48)))/(decimal)(s[0]=='N'?1:s[0]-48))
```
Craptacular bloated C# solution. Guess I could've ported the Java solution but I try not to look at others' stuff before posting mine, so here we are.
[Try it Online](https://tio.run/##jY4xT8MwEIXn@FecvMSmcSBQJNSQdkBiaivUDqiKMhjHSi0lTpRzQKjqbw9uRQcW4C2ne/fd3VMoVNvrcUBjK9h@otNNSoKTSDe81UaBqiUivPRt1cuGHEjw7aOTzpf31pSwksYyTgI/DZ4Hqx7R9f5gBMa6OewggxGzOfMdX0m3jzftYEvGGGYYb3RXS6UZBRpRynmO8VLbyu1FUojpg/BU/NRa518go4LyhUhmCb/y9rarjWNWf@TFIZyEUSjCI8@TIr85bXLOr1mplWlkzRl6M8vCdbhIZngBxjQgcJb/gG2t49feOL00VrMdo2uYQOLD3/lY6e@gOIP3f4G3P07Cv9DpBT2S4/gF "Try it Online")
[Answer]
# [Ruby](https://www.ruby-lang.org/), 66 bytes
```
->s{a,_,b,_,c=s.split.map &:to_f;((s[?+]?c-b:c+b)/(a+0**a)).round}
```
[Try it online!](https://tio.run/##KypNqvyfZvtf1664OlEnXicJiJNti/WKC3IyS/RyEwsU1KxK8uPTrDU0iqPttWPtk3WTrJK1kzT1NRK1DbS0EjU19YryS/NSav8XKKRFK/kpaCsYKtgqGCvFckEFdMECpjABIwwlcBETpdj/AA "Ruby – Try It Online")
[Answer]
# awk, 48 bytes
```
awk -F'[ N]' '{printf("%.f",($6-$4)/($1?$1:1))}'
```
Use cases:
```
echo "N + 1 = 3" | awk -F'[ N]' '{printf("%.f",($6-$4)/($1?$1:1))}'
echo "N - 1 = 5" | awk -F'[ N]' '{printf("%.f",($6-$4)/($1?$1:1))}'
echo "2N + 1 = 3" | awk -F'[ N]' '{printf("%.f",($6-$4)/($1?$1:1))}'
echo "2N + 1 = 4" | awk -F'[ N]' '{printf("%.f",($6-$4)/($1?$1:1))}'
```
Extra case:
```
echo "3N + 1 = 11" | awk -F'[ N]' '{printf("%.f",($6-$4)/($1?$1:1))}'
```
Output: 3
[Answer]
## PHP, 83 Bytes
[Try it online](https://tio.run/##K8go@G9jX5BRoKCSWJReZqtk5KegrWCoYKtgomRtbweUsy3KL81L0dBQSbZNrSjIyU9J1VBSUNIBK9fUjDaJ1QVKRRvG6gFJo1hNTX0Q1yDW1tbP3tCquDSpuKQIIqJjoKNrqKlp/f8/AA)
[Try it online2](https://tio.run/##K8go@G9jX5BRoKCSWJReZqtk5KegrWCoYKtgomRtbweUsy3KL81L0dDQUEm2Ta0oyMlPSdVQUlDSAavX1Iw2idUFSkUbxuoBSaNYTU19ENcg1tbWz97Qqrg0qbikCCKiY6Cja6ipqWOgaf3/PwA)
For some reason **`round`** does not round to the closest integer on tio run, on this version the solution has some extra bytes **(87 Bytes)**
**Code**
```
<?=round(($c=explode(" ",$argv))[4]-($c[1].$c[2]))/($c[0]==N?1:substr($c[0],0,-1));
```
**Explanation**
```
//ecuation structure xN sign c = m
//array structure like ["xN","sign", "c", "=", "m"]
round(                         //round the result
(                              //first element of the ecuation
   $c=explode(" ",$argv))[4]   //explode the string and get the 4th value
   -                           //substract, php accepts (1-(-1)) so,
                               //it can ve solved like this
   ($c[1].$c[2])               //concat the sign with c
)
/                              //divide by x
($c[0]==N?1:substr($c[0],0,-1) //if the first element xN it's N
                               //divide by 1, else remove N and divide
);
```
**Question**
About negative numbers, my code should work for an equation like `-xN +- c = m`, but when you are considering a `x = -1`, the input will be `-N +- c = m` or `-1N +- c = m`?
[Answer]
# [R](https://www.r-project.org/), 90 bytes
```
-round(eval(parse(t=gsub("=","-",gsub("\\dN","",s<-scan(,"")))))/(gsub("N.*$","",s):1)[1])
```
[Try it online!](https://tio.run/##K/r/X7covzQvRSO1LDFHoyCxqDhVo8Q2vbg0SUPJVklHSVdJB8KJiUnxA/KVdIptdIuTE/M0gGxNENDXgCjw09NSgSjQtDLUjDaM1fyvZOGnoK1gqWCrYKLE9R8A "R – Try It Online")
Assumes `d` is present as per the spec.
Probably not the shortest option - I am sure there are better regex.
[Answer]
`awk` : safe division without branching ternary condition
```
echo 'N + 1 = 3' |
gawk '$__=sprintf("%.f",($5-($2$3))/(_+=$_)^!!_)'
mawk '{printf("%.f",($5-($2$3))/(_+=$_)^!!_)}'
```
---
```
2
```
---
```
echo '2N + 1 = 4' |
nawk '$!NF=sprintf("%.f",($5-($2$3))/(_+=$!_)^!!_)'
```
---
```
2
```
]


[Question]
      [
In this exercise, you have to analyze records of temperature to find the closest to zero.
Write a program that prints the temperature closest to 0 among input data.
## Input
* N, the number of temperatures to analyse (optional). This will be nonzero.
* The N temperatures expressed as integers ranging from *-273 to 5526*.
## Output
Output the temperature closest to 0. If two temperatures are equally close, take the positive one. For instance, if the temperatures are -5 and 5, output 5.
## Example
```
Input
    5
    1 -2 -8 4 5
Output
    1
```
[This challenge is similar to this one on CodinGame, you can view the problem statement source here.](https://github.com/GlenDC/Codingame/blob/master/descriptions/temperatures.md)
Some modifications have been made to the text.

[Answer]
# SmileBASIC, 56 bytes
```
DEF Z N,T
RSORT T
DIM V[N]ARYOP 2,V,T,T
SORT V,T?T[0]END
```
First, the input list is sorted, so the positive temperature will be chosen if there's a tie. Then each temperature is squared and stored in another array. The original array is sorted by this array, and the first item is printed.
[Answer]
# [Octave](https://www.gnu.org/software/octave/), 19 bytes
```
@(x)min(complex(x))
```
[**Try it online!**](https://tio.run/##y08uSSxL/Z9mq6en999Bo0IzNzNPIzk/tyAntQLI0/yfphGta6hgqKBrpKBroWCiYBqr@R8A "Octave – Try It Online")
This exploits the fact that [`min`](https://octave.sourceforge.io/octave/function/min.html) with complex input compares by absolute value, then by angle:
>
> For complex arguments, the magnitude of the elements are used for comparison. If the magnitudes are identical, then the results are ordered by phase angle in the range (-pi, pi].
>
>
>
[Answer]
# C#, 171 bytes
```
using static System.Console;using System.Linq;class s{static void Main()=>Write(ReadLine()=="0"?0:ReadLine().Split(' ').Select(int.Parse).OrderBy(v=>v*(.1-v)).Last());}
```
[Try it online!](https://tio.run/##RcpBC4IwGMbxe5/ixYtbsKGREIkGdTWKPHQe8yUGNmvvGkj02ZeQ0O3h9/w1CT04jPFFxt6AvPJGQzuSx7s8DJaGHsvfN2Nj7LPUvSICes99GEwHR2Us41V9dcYju6DqphQnqZIs2WXbv8j20RvPUkiniT1qz4z18qwcIZcn16HbjyxUdVgymYvAuWwUecZ5@YmxWOQgViA2sIbiCw "C# (.NET Core) – Try It Online")
[Answer]
# [Headass](https://esolangs.org/wiki/Headass), 56 bytes
```
O{ON-)+E:U}.U+OUO[{UO(])P:N(+)+E:}.UO[U-O{UO(])P:N(+)E:}
```
[Try It Online!](https://dso.surge.sh/#@WyJoZWFkYXNzIiwiIiwiT3tPTi0pK0U6VX0uVStPVU9be1VPKF0pUDpOKCspK0U6fS5VT1tVLU97VU8oXSlQOk4oKylFOn0iLCIiLCI1XG40XG4zXG4yXG4tMVxuMSIsIiJd)
Increments / decrements a pair of counters until the value of the counter matches one of the inputs, with the positive counter having the first go (after 0 of course) to prioritize it over negative answers.
Positive counter hereby referred to as `+counter` and negative counter as `-counter`
Code breakdown:
```
O{ON-)+E:U}.  code block 0
O O           initialize both counters to 0
 {ON-)  :U}   put all inputs on the queue
      +E      then move to code block 1
           .  end code block
U+OUO[{UO(])P:N(+)+E:}.  code block 1 (-counter, starting at 0)
U+O                      increment +counter and put back on queue
   UO[                   store 0/-counter to r2 and put back on queue
      {       N(+)  :}   for each input
       UO                  enqueue input
         (])               if input is equal to 0/-counter
            P:               print value and halt
                  +E     then go to code block 2
                      .  end code block
UO[U-O{UO(])P:N(+)E:}    code block 2 (+counter, starting at 1)
UO[                      store +counter to r2 and put back on queue
   U-O                   decrement -counter and put back on queue
      {       N(+) :}    for each input
       UO                  enqueue input
         (])               if input is equal to +counter
            P:               print value and halt
                  E      then go to code block 1
```
I tried doing this with only 2 code blocks, 1 to init and one to handle both counters, but that meant that whichever value came first between positive and negative would win, which is wrong. There might be additional logic that could be added to such a loop which, combined with some more logic-golfing, could be shorter than this version, but i still think its pretty good.
[Answer]
# [J-uby](https://github.com/cyoce/J-uby), 12 bytes
```
:min_by+:abs
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m700K740qXLBIjfbpaUlaboWa6xyM_Pikyq1rRKTiiFCmwoU3KKjDXV0jXR0LXRMdExjYyESCxZAaAA)
[Answer]
# APL (Dyalog Unicode), 16 bytes
```
{⌈/⍵/⍨a=⌊/a←|¨⍵}
```
[Try it on TryAPL.org!](https://tryapl.org/?clear&q=%7B%E2%8C%88%2F%E2%8D%B5%2F%E2%8D%A8a%3D%E2%8C%8A%2Fa%E2%86%90%7C%C2%A8%E2%8D%B5%7D%2011%2044%2051%206%20%C2%AF10%20%C2%AF12%20%C2%AF5&run)
]