text:
It's a yearly task, alright
Given a number 1≤n≤365, output the nth day of the year in "Day-numberth Month" format. For example, given 1, you should output "1st January", without "of".
The Gregorian calendar will be used and the program should not account for leap years, so your program should never output "29th February" in any circumstance. Any method can be used, as long as it follows the "Day-numberth Month" format mentioned before. Your program should also output ordinals correctly, meaning it should always output 1st, 2nd, 3rd, should 1, 2 or 3 respectively be the day numbers for any input. Leading spaces or other indentation are allowed.
This is code golf, so the shortest solution by characters wins.
Test cases:
1 gives 1st January
2 gives 2nd January
3 gives 3rd January
365 gives 31st December
60 gives 1st March
11 gives 11th January

What is "Day-number Month" format? I'm assuming it's "20th March"? Or is it "20 March"? That makes a pretty big difference, if you need ordinals.

Also, do you need to force an error message on numbers > 365? Can the program just assume that's invalid input and it won't need to handle that?

Can we output native Date object that is builtin to our language, without converting it to a string? If we do have to convert it to a string, do we have to output in that exact format?

I believe input validation is not allowed in challenges, at least to a point.

As not everyone is a native English speaker, you may want to add that day numbers 11, 12, and 13 get "th", numbers ending in "1" get "st", "2" get "nd", "3" get "rd", and all other get "th".

So is it March 1st or 1st March?

The latter, I messed up.

Whoa, don't accept answers so quickly. Especially not wrong answers!

Whoops. I guess I'll check every answer and wait for a shorter one.

This is 14 bytes in Dyalog APL 18.0: 'Doo Mmmm'∘⎕DN but it hasn't been released yet ;-(

When it releases, tell me.

You should add at least 11 (11th January) and 21 (21st January) to the test cases.

And while you're editing test cases, maybe specify what exactly your test case format is.  A couple of answerers have thought that 123= was part of the required output. Or simply edit your test cases to read something like: 365 gives 31st December

I'm quite surprised this has not been asked before. Good question.

PHP, 38 40 30 28 bytes
<?=date("jS F",86399*$argn);

Try it online!
Run with php -nF input is from STDIN. Example (above script named y.php):
$ echo 1|php -nF y.php
1st January
$ echo 2| php -nF y.php
2nd January
$ echo 3| php -nF y.php
3rd January
$ echo 11|php -nF y.php
11th January
$ echo 21|php -nF y.php
21st January
$ echo 60|php -nF y.php
1st March
$ echo 365|php -nF y.php
31st December

Explanation
Construct an epoch timestamp for the desired day in 1970 (conveniently not a leap year) by multiplying the day number * number of seconds per day (86400).  However, this would yield one day higher so instead multiply by number of seconds in a day - 1 (86399) which for the range of input numbers (1≤n≤365) will result with the timestamp of the end of each correct day. Then just use PHP's built-in date formatting for output.

why's the -n necessary?

@Ven it might not be in all cases, but just disables any settings in local php.ini that might create inconsistent behavior.

C# (Visual C# Interactive Compiler), 115 113 109 98 bytes
g=>$"{f=(g=p.AddDays(g-1)).Day}{"tsnr"[f=f%30%20<4?f%10:0]}{"htdd"[f]} {g:MMMM}";DateTime p;int f;

Thanks to @someone for saving 9 bytes
Try it online!

@KevinCruijssen I got the modulos out of order, should be fixed now.

.code.tio(2,22): error CS0165: Use of unassigned local variable 'p' It appears that the struct thing doesn't work.

var g=new DateTime().AddDays(n-1) works though

@JAD mistake on my part, fixed

110 bytes I think

@someone Haven't been golfing in a while, but found an even shorter way

100 bytes by rearranging stuff to get rid of return, braces and a semicolon.

@someone Got it down to 98. Just one more till I beat the Jelly answer!

@Embodiment there is a 77-byte Jelly answer there.

@someone My mistake, I didn't see the other one

Jelly,  79 78  77 bytes
-1 fixing a bug :) (shouldn't pre-transpose to find index, should post-reverse, but then we can tail rather than head)
-1 using reflection (⁽©ṅB+30_2¦2 -> ⁽0ṗb4+28m0)
⁽0ṗb4+28m0SRṁRƲœiµṪȮ%30%20«4ị“nḄƲf⁷»s3¤Ṗ,ị“£ṢtẒ⁽ẹ½MḊxɲȧėAṅ ɓaṾ¥D¹ṀẏD8÷ṬØ»Ḳ¤$K

A full program which prints the result
Try it online!
How?
will update this later...
⁽©ṅB+30_2¦2SRṁRƲZœiµḢȮ%30%20«4ị“nḄƲf⁷»s3¤Ṗ,ị“...»Ḳ¤$K - Main Link: integer, n
⁽©ṅB+30_2¦2SRṁRƲZœi - f(n) to get list of integers, [day, month]
⁽©ṅ                 - compressed literal 2741
   B                - to a list of binary digits -> [ 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1]
    +30             - add thirty                    [31,30,31,30,31,30,31,31,30,31,30,31]
         ¦          - sparse application...
        2           - ...to indices: [2]
       _  2         - ...action: subtract two       [31,28,31,30,31,30,31,31,30,31,30,31]
               Ʋ    - last four links as a monad - i.e. f(x):
           S        -   sum x                       365
            R       -   range                       [1..365]
              R     -   range x (vectorises)        [[1..31],[1..28],...]
             ṁ      -   mould like                  [[1..31],[32..59],...]
                Z   - transpose                     [[1,32,...],[2,33,...],...]
                 œi - 1st multi-dimensional index of n  -> [day, month]

µḢȮ%30%20«4ị“nḄƲf⁷»s3¤Ṗ,ị“...»Ḳ¤$K - given [day, month] format and print
µ                                  - start a new monadic chain - i.e. f(x=[day, month])
 Ḣ                                 - head -- get the day leaving x as [month])
  Ȯ                                - print it (with no newline) and yield it
   %30                             - modulo by thirty
      %20                          - modulo by twenty
         «4                        - minimum of that and four
                     ¤             - nilad followed by link(s) as a nilad:
            “nḄƲf⁷»                -   dictionary words "standard"+" the" = "standard the"
                   s3              -   split into threes = ["sta","nda","rd ","the"]
           ị                       - index into
                      Ṗ            - remove rightmost character
                               ¤   - nilad followed by link(s) as a nilad:
                         “...»     -   dictionary words "January"+" February"+...
                              Ḳ    -   split at spaces = ["January","February",...]
                        ị          - index into (vectorises across [month])
                       ,           - pair                  e.g. ["th", ["February"]]
                                K  - join with spaces           ["th ", "February"]
                                   - print (implicitly smashes)   th February

The "standard the" trick is amazing.

I agree with @Ven, great trick! It also saved a byte in my 05AB1E answer in comparison to the compressed string "thstndrd" split into parts of size 2 (.•oθ2(w•2ô), so thanks. :)

This has to be one of the longest Jelly programs I have ever seen.

Python 3.8 (pre-release), 112 bytes
lambda x:str(d:=(t:=gmtime(x*86399)).tm_mday)+'tsnrhtdd'[d%5*(d%30%20<4)::4]+strftime(' %B',t)
from time import*

Try it online!
Weirdly enough, I don't have to parenthesize d:=(t:=gmtime(~-x*86400), probably because the interpreter only checks if there are () characters around the assignment expression and not that the expression itself is parenthesized.
-2 thanks to gwaugh.
-5 thanks to xnor.

Perl 6, 166 161 bytes
{~(.day~(<th st nd rd>[.day%30%20]||'th'),<January February March April May June July August September October November December>[.month-1])}o*+Date.new(1,1,1)-1

Try it online!
Hardcodes all the month names, which takes up most of the space. Man, Perl 6 really needs a proper date formatter.

JavaScript (ES6),  117  113 bytes
Saved 4 bytes thanks to @tsh
d=>(n=(d=new Date(1,0,d)).getDate())+([,'st','nd','rd'][n%30%20]||'th')+' '+d.toLocaleString('en',{month:'long'})

Try it online!
Commented
d =>                     // d = input day
  ( n =                  //
    ( d =                // convert d to
      new Date(1, 0, d)  //   a Date object for the non leap year 1901
    ).getDate()          // save the corresponding day of month into n
  ) + (                  //
    [, 'st', 'nd', 'rd'] // ordinal suffixes
    [n % 30 % 20]        // map { 1, 2, 3, 21, 22, 23, 31 } to { 'st', 'nd', 'rd' }
    || 'th'              // or use 'th' for everything else
  ) + ' ' +              // append a space
  d.toLocaleString(      // convert d to ...
    'en',                // ... the English ...
    { month: 'long' }    // ... month name
  )                      //

Without date built-ins, 188 bytes
f=(d,m=0)=>d>(k=31-(1115212>>m*2&3))?f(d-k,m+1):d+([,'st','nd','rd'][d%30%20]||'th')+' '+`JanuaryFebruaryMarchAprilMayJuneJulyAugustSeptemberOctoberNovemberDecember`.match(/.[a-z]*/g)[m]

Try it online!

Fails for 11th,12th,13th of each month

@ExpiredData Thanks for reporting this. Fixed now.

Ignore my comment, I made an ID10T error.

I'm not sure how nodejs handle language tags, but it seems using 0 would work as using "en". And changing to toLocaleString would save 4 bytes. 110 bytes

@tsh It seems that toLocaleString is using the system default settings when it's passed an unrecognized string or a numeric value. So, it can be anything. This parameter is basically ineffective on a TIO instance, because only English locales are installed anyway.

Hack, 115 59 39 bytes
$x==>date("jS F",mktime(0,0,0,1,$x));

Since @gwaugh got to the same solution as mine while I was golfing, I'm posting this in Hack instead :).

Wow, great minds think alike. :) +1 to you sir!

@gwaugh haha, I didn't know I could just have a top-level program. I'll edit mine to make it top-level too, and find a way to get a better scor e;-)

@gwaugh Made mine Hack instead.

You'll probably want to specify a non-leap year parameter to your mktime() call otherwise it will return the wrong output if run on a leap year. (had to do to my answer).

Smalltalk, 126 bytes
d:=Date year:1day:n.k:=m:=d dayOfMonth.10<k&(k<14)and:[k:=0].o:={#st.#nd.#rd}at:k\\10ifAbsent:#th.m asString,o,' ',d monthName

I don't know Smalltalk, but is this correct for 11th,12th,13th? If I read correctly you integer-divide the day by 10, but that would mean it would result in 11st,12nd,13rd, unless something else in the code fixes this while I'm unaware of it.

@KevinCruijssen You are right. Thanks for calling my attention on this. I'll need to spend some more bytes to fix this.

@KevinCruijssen, Done. Thanks again.

C# (Visual C# Interactive Compiler), 141 139 133 124  122 bytes
a=>{var d=s.AddDays(a-1);int x=d.Day,m=x%30%20;return x+"thstndrd".Substring(m<4?m*2:0,2)+d.ToString(" MMMM");};DateTime s

Thanks to Arnauld for faster method of removing 11,12,13th saving 4 bytes
Try it online!

Using C# 8, this can be reduced to:
a=>{var d=s.AddDays(a-1);int x=d.Day,m=x%30%20;return x+"thstndrd"[(m<4?m*2:0)..2]+$" {d:MMMM}";};DateTime s
The interactive compiler doesn't seem to support changing its language level to "preview" at this time, though.

116 bytes

I'm pretty sure you have to add a semi-colon after the DataTime s

R, 158 134 bytes
-24 bytes @Nick Kennedy for golfing the 'st', 'nd', 'rd', & 'th'. Thanks!
f=format;paste0(a<-as.double(f(d<-as.Date(scan(,''),'%j'),'%e')),`if`((a-1)%%10>2|a%/%10==1,'th',c("st","nd","rd")[a%%10]),f(d,' %B'))

Try it online!

How about https://tio.run/##HYxBCsIwEEWvIoEwMzDVRldi40K8hQgdmwQV20oSd949xm4e/8PjxVKCDXMcJR/ekrJvUbpG0trNn9vLY0C33LNkj2mQCRmAGPRzoQci7h@hR5TGkNamPW6/ojd1WGsY8h14QJWyYjW5iugUXeQvXolrnWGlT7VS9rvyAw for 134 bytes

Yes, I need to learn \if`` better. Thanks.

05AB1E, 81 79 78 76 75 74 73 71 70 69 bytes
•ΘÏF•ºS₂+.¥-D0›©ÏθDT‰ć≠*4šß„—ÃŠØ3ôsè¨ð”……‚æ‡‰…ä†ï€¿…Ë…ê†Ä…æ…Ì…Í”#®OèJ

-9 bytes thanks to @Grimy.
-1 byte thanks to @JonathanAllan's standard the trick for th,st,nd,rd, which he used in his Jelly answer.
Try it online or verify all possible test cases.
Explanation:
•ΘÏF•        # Push compressed integer 5254545
     º       # Mirror it vertically: 52545455454525
      S      # Converted to a list of digits: [5,2,5,4,5,4,5,5,4,5,4,5,2,5]
       ₂+    # And 26 to each: [31,28,31,30,31,30,31,31,30,31,30,31,28,31]
             # (the additional trailing 28,31 won't cause any issues)
.¥           # Undelta this list (with automatic leading 0):
             #  [0,31,59,90,120,151,181,212,243,273,304,334,365,393,424]
  -          # Subtract each from the (implicit) input-integer
   D0›       # Duplicate the list, and check for each if it's positive (> 0)
      ©      # Store the resulting list in the register (without popping)
       Ï     # Only leave the values at those truthy indices
        θ    # And get the last value from the list, which is our day
D            # Duplicate this day
 T‰          # Take the divmod-10 of this day: [day//10, day%10]
   ć         # Extract the head; pop and push the remainder-list and head: [day%10], day//10
    ≠        # Check whether the day//10 is NOT 1 (0 if day//10 == 1; 1 otherwise)
     *       # Multiply that by the [day%10] value
      4š     # Prepend a 4 to this list
        ß    # Pop and push the minimum of the two (so the result is one of [0,1,2,3,4],
             # where the values are mapped like this: 1..3→1..3; 4..9→4; 10..19→0; 20..23→0..3; 24..29→4; 30,31→0,1)
 …thŠØ       # Push dictionary string "th standards"
      3ô     # Split it into parts of size 3: ["th ","sta","nda","rds"]
        sè   # Swap and index the integer into this list (4 wraps around to index 0)
          ¨  # And remove the trailing character from this string
ð            # Push a space " "
”……‚æ‡‰…ä†ï€¿…Ë…ê†Ä…æ…Ì…Í”
             # Push dictionary string "December January February March April May June July August September October November"
 #           # Split on spaces
  ®          # Push the list of truthy/falsey values from the register again
   O         # Get the amount of truthy values by taking the sum
    è        # Use that to index into the string-list of months (12 wraps around to index 0)
J            # Join everything on the stack together to a single string
             # (and output the result implicitly)

See this 05AB1E tip of mine to understand why:

(section How to use the dictionary?) ”……‚æ‡‰…ä†ï€¿…Ë…ê†Ä…æ…Ì…Í” is "December January February March April May June July August September October November"
(section How to use the dictionary?) …thŠØ is "th standards"
(section How to compress large integers?) •ΘÏF• is 5254545

-2 bytes by using 5в28+ for compression: TIO

@Grimy Thanks! Too bad •!₆%ζ3•S and •CoAc•5в are the same amount of bytes. Almost thought I could save another byte by using a compressed integer instead of integer list. :)

Using S is a good idea, -1 byte again: TIO

Further -3 bytes by using T‰`s<Ā* for the ordinal suffix: TIO

@Grimy Thanks for the -1 byte for •EË7Óæ•S₂+, but your -3 golf doesn't work unfortunately. Indexing automatically wraps around in 05AB1E, so the 5st,6nd,7rd,25st,26nd,27rd,29st will be wrong. PS: if it would have worked, <Ā could have been ≠ for an additional -1. :)

-1

-1 again (using "th standards" instead of "standard the" removes the need for Á).

@Grimy Ah, standards instead of standard. Dangit, why didn't I think of that myself.. I had tried …th†¥ for "th standard", but it of course gave a problem removing the last character of the rd. Can't believe I haven't thought of checking if standards is in the dictionary.. And hmm, didn't even knew th was in the dictionary either..

-2. Turns out undelta is a built-in (.¥), which saves some work.

-1 (•C.ñÒā• to •ΘÏF•º, the extra digits don't matter)

@Grimy Oh, that's a nice one. And you just keep on golfing, don't you? :D

30%20%4‚ -> T‰ć≠*4š for -1.

@Grimmy Of course he's still not done. ;p Thanks! Nice alternative for the mapping to 0..4.

MySQL, 47 45 42 bytes
SELECT DATE_FORMAT(MAKEDATE(1,n),"%D %M")

1901 can be replaced with any year that was/is not a leap year.
Edit: saved two bytes by removing spaces and another three bytes by changing the year to 1, thanks to @Embodyment of Ignorance.

Can you remove the spaces between 1901, n and the string?

@EmbodimentofIgnorance yes I can, thanks!

Also, why not replace 1901 with a year like 1? 1 isn't a leap year, and it's 3 bytes shorter

@EmbodimentofIgnorance done and done :-)

Jelly, 115 114 101 97 bytes
%30%20¹0<?4Ḥ+Ø½ị“thstndrd”ṭ
“5<Ḟ’b4+28ÄŻ_@µ>0T,>0$ƇZṪµ1ịị“£ṢtẒ⁽ẹ½MḊxɲȧėAṅ ɓaṾ¥D¹ṀẏD8÷ṬØ»Ḳ¤,2ịÇƊṚK

Try it online!
Long by Jelly standards, but done from first principles.
Thanks to @JonathanAllan for saving 13 bytes through better understanding of string compression.

“£ṢtẒ⁽ẹ½MḊxɲȧėAṅ ɓaṾ¥D¹ṀẏD8÷ṬØ»Ḳ¤ would save 13 (Compress.dictionary looks for a leading space and has special handling for it).

Shell + coreutils, 112 90 bytes
date -d0-12-31\ $1day +%-dth\ %B|sed 's/1th/1st/;s/2th/2nd/;s/3th/3rd/;s/\(1.\).. /\1th /'

Try it online! Link includes test cases. Edit: Saved 22 bytes thanks to @NahuelFouilleul. Explanation:
date -d0-12-31\ $1day

Calculate the number of day(s) after the first day preceding a non-leap year. (Sadly you can't do relative date calculations from @-1.)
+%-dth\ %B|sed

Output the day of month (without leading zero), th, and the full month name.
's/1th/1st/;s/2th/2nd/;s/3th/3rd/;

Fix up 1st, 2nd, 3rd, 21st, 22nd, 23rd and 31st.
s/\(1.\).. /\1th /'

Restore 11th to 13th.

i saw this answer after mine, could save 18bytes using one sed command, also s in days can be removed, and 19 in 1969

@NahuelFouilleul That last one uses a Bash-ism so should be posted as a separate answer, but thanks for the other tips!

bash, 82 80 bytes
-2 bytes thanks to @ASCII-only
a=(th st nd rd);set `printf "%(%e %B)T" $[$1*86399]`;echo $1${a[$1%30%20]-th} $2

TIO
bash +GNU date, 77 bytes
a=(th st nd rd);set `date -d@$[$1*86399] +%e\ %B`;echo $1${a[$1%30%20]-th} $2

80?

@ASCII-only, yes subtracting 100s for each day, 100*365 = 36500s which is less than one day (86400), works also with 86399 (subtract 1s by day)

:/ still looks really long but haven't found a better way yet

Google Sheets, 118 103 86 bytes
=day(A1+1)&mid("stndrdth",min(7,1+2*mod(mod(day(A1+1)-1,30),20)),2)&text(A1+1," mmmm")

I can't edit my comment so, here's a working version of the Google Sheets code.
Try it Online!

APL(NARS), 235 chars, 470 bytes
{k←↑⍸0<w←+\v←(1-⍵),(12⍴28)+13561787⊤⍨12⍴4⋄k<2:¯1⋄d←1+v[k]-w[k]⋄(⍕d),({d∊11..13:'th'⋄1=10∣d:'st'⋄2=10∣d:'nd'⋄3=10∣d:'rd'⋄'th'}),' ',(k-1)⊃(m≠' ')⊂m←'January February March April May June July August September October November December'}

13561787 is the number that in base 4 can be summed to (12⍴28) for obtain the lenght of each month...
test:
  f←{k←↑⍸0<w←+\v←(1-⍵),(12⍴28)+13561787⊤⍨12⍴4⋄k<2:¯1⋄d←1+v[k]-w[k]⋄(⍕d),({d∊11..13:'th'⋄1=10∣d:'st'⋄2=10∣d:'nd'⋄3=10∣d:'rd'⋄'th'}),' ',(k-1)⊃(m≠' ')⊂m←'January February March April May June July August September October November December'}
  ⊃f¨1 2 3 365 60 11
1st January
2nd January
3rd January
31st December
1st March
11th January

Red, 124 bytes
func[n][d: 1-1-1 + n - 1[rejoin[d/4 either 5 > t: d/4 % 30 % 20[pick[th st nd rd]t + 1]['th]]pick system/locale/months d/3]]

Try it online!
Adds n - 1 days to 1-1-1 (1-Jan-2001) to form a date, than uses Arnauld's method to index into month suffixes. Too bad Red is 1-indexed, this requires additional tweaking. The good thing is that Red knows the names of the months :)

C (gcc), 174 155 bytes
i;char a[99],*b="thstndrd";f(long x){x--;x*=86400;strftime(a,98,"%d   %B\0",gmtime(&x));i=*a==49?0:a[1]-48;a[2]=b[i=i>3?0:i*2];a[3]=b[++i];x=*a==48?a+1:a;}

Try it online!

Vyxal ṡ, 81 bytes
kṁ¦Ṫ0p-'0>;:L`ƛǓ ⟇∩ ∨₄ ∨⋏ λ√ ∨ɾ ∨∑ ⟇τ ∨₆ ∨Þ ∨∞ ⟑√`⌈$i$t:t:4<[` ∨ǐ`3/vḢȮ‹i|‛th]$_+

Try it Online!
What a mess.
kṁ                                                # List of month lengths
  ¦                                               # Cumulative sums
   Ṫ0p                                            # Pop off the last and prepend a 0
      -                                           # Subtract from input
       '0>;                                       # Filter by positive
           :L                                     # Duplicate and get length
             `...`⌈$i                             # Index into list of month names
                     $t:t                         # Get the last digit
                         :4<[                     # If it's less than 4 then...
                             `...`                # Push ' standard'
                                  3/              # Split into 3
                                    vḢ            # Lop off the first char of each
                                      Ȯ‹i         # Index the number into this
                                         |   ]    # Else
                                          ‛th     # Push 'th'
                                              $_+ # Swap, pop and concatenate
                                                  # (ṡ flag) join stack by spaces


text:
A poly-moly-holy quine. (Well, it's not, but the title's cool.)
This is an answer chaining puzzle, where each answer must add on to the last.
The \$n\$th submission must output its own source code in the \$n\$th language and the \$n−1\$ languages before it.
A language can be either a dialect or a major version of a language, so Python version 2.121 is only counted as version 2 and Common Lisp and Clojure are considered different languages. This excludes compiler flags.
You can post 2 answers in a row, but have to use different languages.
The winner of this puzzle is the person to submit the second-to-last quine if there have been no new quines for a week. The aim of this puzzle is to go on as long as it can, so if you want the green tick, you'll have to respect that.
Have fun.

But other than that, creative and cool challenge! (Just a note, don't be offended by the downvotes, they are just indicating whether it would be good for the site in it's current form). Also, "output its own source code in n different languages" may seem a little bit too hard for an answer-chaining questions, so you may want to change that to the current language instead of all the previous languages.

Well actually re: scoring, one thing you can do is copy the other polyglot-chaining problem, which has a scoring metric based on both number of languages and code size

Let us continue this discussion in chat.

Are there any rules on one person posting two answers in a row?

><>, 187 bytes
var s=1
<0?"":"var s=1{0}<0?{1}{1}:{1}{3}{1};Write(s,(char)10,(char)34,(char)39,s)//.1+d*fao;!?l{1}var s=1{1}ar*3dr{2}";Write(s,(char)10,(char)34,(char)39,s)//.1+d*fao;!?l"var s=1"ar*3dr'

Try it online!
Try C# Online
Let's add a 2D language, why not?

Just for your info: if you plan to submit again, the quine must only work properly for this lang and another one of your choice, while still including the C# code.

No. You have to use other people's languages, leave all the previous stuff intact, while adding on your thing. However, the result only needs to work like a quine for whatever lang you choose next and the one in the last submission. If I added something as the third last submission, the quine could work like mud in my language but work perfectly in yours and in the last one.

I'm reverting it to the polyquine challenge.

I get 1 What do you want 0/0 to be? What do you want 0/0 to be?  when I try running this in Befunge, lol

@MilkyWay90 Yeah, if you're going to add Befunge-98 to this, then you're either going to have to get rid of the "s in the C# code, or have to use nk', e.g. like this quine

@JoKing Was just seeing if I could implement a quine in Befunge with still maintaining compatibility with the previous languages easily; I probably could not solve a hard solution to this problem

C# (Visual C# Interactive Compiler), 63 bytes
var s="var s={0}{1}{0};Write(s,(char)34,s)";Write(s,(char)34,s)

Just to start it off.
Try it online!

I've written a polyglot with ><> (Try it online!), but I can't post it since it breaks the 50+ chars rule :(

@JoKing It also seems to break the no STDERR rule ("something smells fishy...")

@JoKing it isn't impossible, see here. Granted, the two languages are basically the same, but you know, it's the implementation that counts

@JoKing and we can make it work for all 5 c# compilers if we wrap the whole thing into a lambda, since all 5 basically are the same language

Okay, but try making a polyquine with a language that isn't C# and see how far you get. (P.S. I've always been annoyed with the implementation vs languages ruling when it comes to polyglots. You wouldn't post a program and say "This is a polyglot with all 16 implementations of the language, because all of them work exactly the same". It's only really a polyglot if none of the languages do the exact same thing with the program)

An example of a bullshit polyglot is your previous answer here which "scored" infinity, because the "languages" had literally no difference between them

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
Pólya urn flip and roll
Problem statement
Pólya is playing about with his urn again and he wants you to help him calculate some probabilities.
In this urn experiment Pólya has an urn which initially contains 1 red and 1 blue bead.
For every iteration, he reaches in and retrieves a bead, then inspects the colour and places the bead back in the urn.
He then flips a fair coin, if the coin lands heads he will insert a fair 6 sided die roll amount of the same coloured bead into the urn, if it lands tails he will remove half the number of the same colored bead from the urn (Using integer division - so if the number of beads of the selected colour is odd he will remove (c-1)/2 where c is the number of beads of that colour)
Given an integer n ≥ 0 and a decimal r > 0, give the probability to 2 decimal places that the ratio between the colours of beads after n iterations is greater than or equal to r in the shortest number of bytes.
An example set of iterations:
Let (x, y) define the urn such that it contains x red beads and y blue beads.
Iteration    Urn       Ratio
0            (1,1)     1
1            (5,1)     5        //Red bead retrieved, coin flip heads, die roll 4
2            (5,1)     5        //Blue bead retrieved, coin flip tails
3            (3,1)     3        //Red bead retrieved, coin flip tails
4            (3,4)     1.333... //Blue bead retrieved, coin flip heads, die roll 3

As can be seen the Ratio r is always ≥ 1 (so it's the greater of red or blue divided by the lesser)
Test cases:
Let F(n, r) define application of the function for n iterations and a ratio of r
F(0,5) = 0.00
F(1,2) = 0.50
F(1,3) = 0.42
F(5,5) = 0.28
F(10,4) = 0.31
F(40,6.25) = 0.14

This is code golf, so the shortest solution in bytes wins.

I feel like there is a formula for this...

Something to do with beta binomials maybe, but it might be longer to write that out

depends on the language; R and Mathematica might be able to do it efficiently.

JavaScript (ES7),  145 ... 129 124  123 bytes
Takes input as (r)(n). This is a naive solution that actually performs the entire simulation.
r=>g=(n,B=s=0,R=0,h=d=>++d<7?h(d,[0,d].map(b=>g(n,B/-~!!b,R/-~!b)&g(n,B+b,R+d-b))):s/24**-~n)=>n--?h``:s+=~B<=r*~R|~R<=r*~B

Try it online!
Too slow for the last 2 test cases.
Commented
r =>                    // r = target ratio
g = (                   // g is a recursive function taking:
  n,                    //   n = number of iterations
  B =                   //   B = number of blue beads, minus 1
  s = 0,                //   s = number of times the target ratio was reached
  R = 0,                //   R = number of red beads, minus 1
  h = d =>              //   h = recursive function taking d = 6-sided die value
    ++d < 7 ?           // increment d; if d is less than or equal to 6:
      h(                //   do a recursive call to h:
        d,              //     using the new value of d
        [0, d].map(b => //     for b = 0 and b = d:
          g(            //       do a first recursive call to g:
            n,          //         leave n unchanged
            B / -~!!b,  //         divide B by 2 if b is not equal to 0
            R / -~!b    //         divide R by 2 if b is equal to 0
          ) & g(        //       do a second recursive call to g:
            n,          //         leave n unchanged
            B + b,      //         add b blue beads
            R + d - b   //         add d - b red beads
          )             //       end of recursive calls to g
        )               //     end of map()
      )                 //   end of recursive call to h
    :                   // else (d > 6):
      s / 24 ** -~n     //   stop recursion and return s / (24 ** (n + 1))
) =>                    // body of g:
  n-- ?                 //   decrement n; if n was not equal to 0:
    h``                 //     invoke h with d = [''] (coerced to 0)
  :                     //   else:
    s +=                //     increment s if:
      ~B <= r * ~R |    //       either (-B-1) <= r*(-R-1), i.e. (B+1)/(R+1) >= r
      ~R <= r * ~B      //       or     (-R-1) <= r*(-B-1), i.e. (R+1)/(B+1) >= r

I really like this answer, I found that in order to solve the later test cases I needed to add code to merge the same ratio probabilities. So I'm not surprised it's too slow

Wolfram Language (Mathematica), 133 bytes
Length@Select[#2/#&@@@(r=Nest[Sort/@Flatten[Table[{{k,0}+#,⌈#/{1,2}⌉},{k,6}]&/@Join[#,Reverse/@#],2]&,{{1,1}},x]),#>=y&]/Length@r

By using N[F,2],the output should print 2 decimal digits but TIO prints more...
Try it online!

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
ASCII Maze Compression
Challenge
Design a compression algorithm specialized for compressing ASCII mazes. You will need to create both a compression algorithm and a decompression algorithm. Your score will be based on the size of your compressed mazes.
Mazes
These mazes are made primarily of the characters  (floors), +, -, |, and # (walls), and exactly one each of ^ (start) and $ (end). They may also contain ASCII letters, which count as floor tiles. For the purposes of this challenge, mazes do not have to be solvable and the actual meaning of maze contents is irrelevant.

+ will be used for wall cells where there is at least one horizontally adjacent wall cell and at least one vertically adjacent wall cell.
| will be used for wall cells where there is at least one vertically adjacent wall cell, but no horizontally adjacent wall cells.
- will be used for wall cells where there is at least one horizontally adjacent wall cell, but no vertically adjacent wall cells
# will only be used for wall cells that are not orthogonally adjacent to other wall cells.

All mazes are rectangular, but do not necessarily have a regular grid/wall alignment.
Mazes To Compress
Maze 1
+----+----
|  o |    |
| -- | o--+
|    | |  $
 --^-+-+---

Maze 2
+-----+---+
|  a  |   |
^ +-+-+ # |
| | |  B  |
| | | --+ |
|   c   | $
+-------+--

Maze 3
----------+-+-+-----+-+
^         | | |     | |
+-- --+R #  | |p| | | |
|     | |       | |   |
+---+ +-+-+-- +-+ | | |
|  m| | | |   |   | | |
| +-+ | | | | | --+ | |
| | |    h  | |   | | |
| | | | | |  #  --+-+ |
|     | | | | |  S|   $
+-----+-+-+-+-+---+----

Maze 4
+-----+---+-+---+-------^-----+
|     |x  | |   |     tsrq    |
+-+-- +-- | +--  #  --+---- --+
| |   |           |   |       |
| | | | | +-+-+---+ | +-- | +-+
| | | u | | | |     | |   | | |
| +-+ | | | | +---- +-+---+ | |
| |   | |   |    y  |       w |
| | --+ | --+ +-- | +---- | | |
|     | |   | |   | |     | | |
+-- --+ +-+ | | | | +-- | +-+-+
|     | | |   | | | |   |     |
$ | --+-+ | --+-+ | +-+-+-- --+
| |   |      z|   |   |    v  |
+-+---+-------+---+---+-------+

Maze 5
++ -----------+
++-       Beep|
$  ----+---+--+
+-+boop|   |  |
| +--- | | | ++
|      | |  +++
+------+-+--+ ^

Maze 6
+-$---------------+-+--
|                 | |j
| |l ---- # ---+ |  |
| | |       m  | +--+ |
| | | +-+---- #       |
| | | | |      +----+ |
|o| | | | +----+    | |
|       | |    | -- | |
| | | | | | -+ |    | |
| | | | |  | | +--- | |
| | | | +- | | |   | ++
+-+ |n| |  | ++ +--+ |
    | |   -+- | |  | +-
+---+ +---    |  | |  ^
|    |     --+ --+ | |
| -- | |  k  |     | ++
|    | |      +--- | ++
|    |      | |    |  |
+-- -+----  | +----+--+

Maze 7
+---+-+-------------+-+^+-----+-------+---+-+---+-+---+-+---+
|   |c|             | | |  c  |       |   | |   | |   |c|   |
+-- | | +-- +-- # | | | +-- --+ +---- +-- | +-+ | | +-+ | --+
|       |   |     | |           |         |   | |c| |       |
| | +-- | +-+-- +-+ +-- # +- # -+-- +-- | | --+ | | | | --+C|
|c| |   | | c   |         |         |c  |             |   | |
+-+-+---+-+-----+---------+---------+---+-------------+---+$|

Maze 8
------+-+-+---+-+---+-----------+---+-----+---------------+-+
^     | | |   | |   |           |   |     |      r        | |
+-- | | | t | | +-- +----- # ---+-- +-- --+-- ----+-+ --+ | |
|   |   | | |   |   |         r |   |             | |   |   |
| | | | | +-+ --+ --+-- --------+-- | ----+ --+ | | | --+ | |
| |r| |            rotation               |   | |   |   | | $
+-+-+-+-----------------------------------+---+-+---+---+-+--

Maze 9
|$|^--+-+---+-----+-+---+-+-+---+---+-+---+-----+
| |   | |   |     | |   | | | f |   | |   |     |
| +-+ | | # +-+ --+ +-+ | | | # | +-+ +-- | ----+
|   |       | |    f| |           | | |   |   f |
| |F+-+ | | | | +---+ | | | ----+-+ | | --+ --+-+
| |   | | |     |     | | |   f |   |         | |
| | | | +-+-+---+-- | | | +-+-+-+ +-+ +--- # -+ |
| | | |     |   |   |   | | | |   | | |         |
+-+-+ | +---+ --+ | +---+-+ | | --+ f | | | | --+
|     | |         |                 | | | | |   |
| --+f| | | +-- --+--f--+ --+ | ----+ | +-+ +---+
|   |     | |     |     |   | |           |     |
+---+-----+-+-----+-----+---+-+-----------+-----+

Maze 10
+-----+-+-----------+
|  q  | |         q |
|Q+-+ | +-+-+-+---- |
$ | |     | | |  q  |
+-+ | | | | | +-- +-+
| |   | |     |   | |
| +-- +-+ |q| +-+ | |
|    q|   | |   |   |
| | | +-- | +-+ | --+
| | | |   | | |     |
+-+-+-+ +-+-+ +-- | |
|       |         | |
+--- # -+ | | +-- | |
|  q      | | |   | ^
+-+ +-- | | +-+ | +-+
| | |   | |q|   |   |
| +-+-+ | +-+-- | | |
|     | | |     | | |
| | | +-+-+-- +-+ +-+
| | |         | q   |
+-+-+---------+-----+

Rules, Assumptions, Scoring

Standard loopholes are banned

Write a general program, not one that only works for the ten test cases. It must be able to handle any arbitrary maze.

You may assume there will be exactly one entrance and one exit. Entrances and exits will always be on the border of the maze.
You may assume that all inputs use walls that follow the rules enumerated above. Your compression algorithm does not have to work for mazes containing walls that violate those rules.
Input mazes may or may not be solvable.
You may assume the maze will be no larger than 100 characters in either direction.
You may assume that letters will not appear on the edge of the maze. (since this is the case for the examples provided)
Your score is the total size, in bytes (octets), of all of the compressed mazes.

You may use hex, base64, binary strings, or any similar format as a representation for your compressed maze if you find that more convenient. You should still count the result in whole octets, rounded up for each maze (e.g. 4 base64 digits is 3 bytes, 2 hex digits is 1 byte, 8 binary digits is 1 byte, etc...)
Lowest score wins!

Is there a size limit to a maze?

@EmbodimentofIgnorance 100x100

@Arnauld actually that was a copy-pasting issue, but I think SE formatting strips spaces at the end of the line anyway. Yes, it's supposed to be space-padded.

@ChasBrown, that counts as a standard loophole, which means it's banned by default.

I think it's rather sad that mazes aren't guaranteed to have exactly one solution. I'd love to see someone find a way to take advantage of such a restriction.

@Arnauld good catch. corrected.

Is it valid to assume that there are no ASCII letters on the border of the maze?

@schnaader, that seems reasonable given the example test cases.

JavaScript (Node.js), score =  586 541 503 492  479 bytes
The walls are stored as a Huffman-encoded stream of bits describing whether a prediction function is returning the correct guess or not.
The special characters are stored as \$(d, c)\$, where \$d\$ is the distance from the previous special character and \$c\$ is the ASCII code.
Try it online!
Common
const HUFFMAN = [
  '00',       // 0000
  '010',      // 0001
  '1001',     // 0010
  '11100',    // 0011
  '011',      // 0100
  '101',      // 0101
  '11110',    // 0110
  '100010',   // 0111
  '110',      // 1000
  '11101',    // 1001
  '1111100',  // 1010
  '1111101',  // 1011
  '10000',    // 1100
  '1111110',  // 1101
  '100011',   // 1110
  '1111111'   // 1111
];

let bin = (n, w) => n.toString(2).padStart(w, '0');

let wallShape = (row, x, y) => {
  let vWall = (row[y - 1] || [])[x] | (row[y + 1] || [])[x],
      hWall = row[y][x - 1] | row[y][x + 1];

  return ' -|+'[row[y][x] ? vWall * 2 | hWall : 0];
}

let predictWall = (row, x, y, w, h) => {
  let prvRow = row[y - 1] || [];
  return !x | !y | x == w - 1 | y == h - 1 | (prvRow[x] | row[y][x - 1]) & !prvRow[x - 1];
}

Compression
let pack = str => {
  let row = str.split('\n').map(r => [...r]),
      w = row[0].length,
      h = row.length;

  let wall = row.map((r, y) => r.map((c, x) => +/[-+|]/.test(c)));

  if(row.some((r, y) => r.some((c, x) => wall[y][x] && wallShape(wall, x, y) != c))) {
    throw "invalid maze";
  }

  row = wall.map((r, y) => r.map((v, x) => predictWall(wall, x, y, w, h) ^ v));
  row = row.map(r => r.join('')).join('');
  row = row.replace(/.{1,4}/g, s => HUFFMAN[parseInt(s.padEnd(4, '0'), 2)]);

  str =
    str.replace(/[\n|+-]/g, '').replace(/ *(\S)/g, (s, c) => {
      let n = c.charCodeAt(),
          i = '^$#'.indexOf(c);

      return (
        bin(s.length > 63 ? 0xFC000 | s.length - 1 : s.length - 1, 6) +
        bin(~i ? i : n < 91 ? (n > 80 ? 0x1F0 : 0x1E0) | ~-n & 15 : n - 94, 5)
      );
    }).trim();

  return (
    Buffer.from(
      (bin(w, 7) + bin(h, 7) + row + str)
      .match(/.{1,8}/g).map(s => parseInt(s.padEnd(8, '0'), 2))
    ).toString('binary')
  );
}

Decompression
let unpack = str => {
  str = [...str].map(c => bin(c.charCodeAt(), 8)).join('');

  let x, y, n, i, s,
      ptr = 0,
      read = n => parseInt(str.slice(ptr, ptr += n), 2),
      w = read(7),
      h = read(7),
      row = [];

  for(x = s = ''; s.length < w * h;) {
    ~(i = HUFFMAN.indexOf(x += read(1))) && (s += bin(i, 4), x = '');
  }
  for(i = y = 0; y < h; y++) {
    for(row[y] = [], x = 0; x < w; x++) {
      row[y][x] = predictWall(row, x, y, w, h) ^ s[i++];
    }
  }

  row = row.map((r, y) => r.map((c, x) => wallShape(row, x, y)));

  for(i = 0; str[ptr + 10];) {
    for(
      n = (n = read(6)) == 0x3F ? read(14) + 1 : n + 1;
      n -= row[i / w | 0][i % w] == ' ';
      i++
    ) {}

    row[i / w | 0][i % w] = String.fromCharCode(
      (n = read(5)) >= 0x1E ? read(4) + (n == 0x1F ? 81 : 65) : [94, 36, 35][n] || n + 94
    );
  }
  return row.map(r => r.join('')).join('\n');
}

How?
A maze is encoded as a bit stream which is eventually converted to a string.
Header
The header consists of:

the width \$w\$ on 7 bits
the height \$h\$ on 7 bits

Wall data
We walk through the entire maze and attempt to predict if the next cell is a wall or not, based on the previously encountered cells. We emit a \$0\$ if we are correct, or a \$1\$ if we are wrong.
This results in a sequence of correction bits with (hopefully) significantly more \$0\$'s than \$1\$'s. This sequence is split into nibbles and stored using hard-coded Huffman codes:

00 → 0000
010 → 0001
1001 → 0010
11100 → 0011
011 → 0100
etc.

To decode the wall \$W_n\$, the decompression routine computes the same prediction \$P_n\$ and toggles the result if needed, using the correction bit \$C_n\$:
$$W_n=P_n\oplus C_n$$
The final wall shapes are deduced in a way that is similar to Nick Kennedy's answer.
Special characters
Each special characters is encoded as:

The distance minus \$1\$ from the last special character (ignoring the walls):

on 6 bits if it's less than \$63\$
or as \$111111\$ + 14 bits otherwise (never used in the test cases, but required in theory)

The code of the character:

on 5 bits if it's ^, $, # or [a-z]
or \$11110\$ + 4 bits for [A-O]
or \$11111\$ + 4 bits for [P-Z]

Have you tried compression algorithms other than deflate? There are an awful lot on the shelf!

There's no rule that says it has to work in TIO!

O_o nice, wonder if decimal compression would help at all (basically the opposite of huffman, the space is 0 to 1, divided up into sections with arbitrary size (<1 of course), and the encoding is the shortest binary number that falls within the correct slice of the space

@ASCII-only Decimal coding (aka arithmetic coding) definitely should improve the compression ratio, but probably by a small margin on such a short data stream. I'm sure it's possible to improve the Huffman coding and/or the prediction function before switching to arithmetic coding, though (both of them being really basic right now).

@ASCII-only For instance, I should probably try longer codes (using nibbles is arbitrary). I could also add a 1-bit flag in the header telling if the data should be unpacked with the default static Huffman codes or with dynamic codes (if it turns out to improve the compression of some mazes). One thing that I did try was to rotate the maze by 90° and see if was compressing better. But that was just saving 1 byte overall.

R, score 668 bytes
This takes advantage of the fact that the wall character is determined by its surroundings. As such, wall characters can be encoded as bits. The remaining info that needs to be stored are the dimensions of the maze, the positions of the start and finish and the positions of any other non-wall characters. Since the non-wall characters are ASCII, I've used the most significant bit of each byte to indicate whether there is another character that follows so that some of the words in the mazes don't have to have the location of each character stored separately. Note also that for mazes less than or equal to 256 characters (e.g. up to 16x16 or equivalent rectangular mazes), the positions can be stored in one byte, whereas for larger mazes the positions need two bytes.
Utility functions
r <- as.raw

int_as_raw <- function(int, bytes = 2) {
  if (bytes == 1) {
    r(int)
  } else {
    do.call(c, lapply(int, function(.x) r(c(.x %/% 256, .x %% 256))))
  }
}

raw_as_int <- function(raw, bytes = 2) {
  if (bytes == 1) {
    as.integer(raw)
  } else {
    sapply(
      seq(1, length(raw) - 1, 2),
      function(.x) as.integer(as.integer(raw[.x + 0:1]) %*% c(256, 1))
    )
  }
}

Compression algorithm
compress_maze <- function(maze) {
  maze_array <- do.call(rbind, strsplit(maze, ""))
  simple_maze <- r(maze_array %in% c("+", "#", "-", "|"))
  simple_maze <- packBits(c(simple_maze, rep(r(0), (8 - length(simple_maze)) %% 8)))
  maze_dim <- int_as_raw(dim(maze_array), 1)
  bytes_needed <- 1 + (length(maze_array) > 256)
  start_finish <- int_as_raw(sapply(c("^", "$"), function(.x) which(maze_array == .x)) - 1, bytes = bytes_needed)
  other_ascii_locs_rle <- rle(!(maze_array %in% c(" ", "+", "#", "-", "|", "$", "^")))
  other_ascii_locs <- cumsum(
    c(1, other_ascii_locs_rle$lengths[-length(other_ascii_locs_rle$lengths)])
  )[other_ascii_locs_rle$values]
  other_ascii_locs_length <- other_ascii_locs_rle$lengths[other_ascii_locs_rle$values]

  encode_ascii <- function(loc, len) {
    text <- charToRaw(paste(maze_array[loc:(loc + len - 1)], collapse = ""))
    if (len > 1) {
      text[1:(len - 1)] <- text[1:(len - 1)] | r(128)
    }
    c(int_as_raw(loc - 1, bytes = bytes_needed), text)
  }

  other_ascii_encoded <- Map(encode_ascii,
    other_ascii_locs,
    other_ascii_locs_length
    )
  other_ascii_encoded <- do.call(c, other_ascii_encoded)
  c(maze_dim, simple_maze, start_finish, other_ascii_encoded)
}

Decompression algorithm
decompress_maze <- function(c_maze) {
  dim_maze <- as.integer(c_maze[1:2])
  len_maze <- prod(dim_maze)
  len_maze_b <- ceiling(len_maze / 8)
  bit_maze <- rawToBits(c_maze[-(1:2)])[1:len_maze]
  dim(bit_maze) <- dim_maze
  bit_maze[-1, ] <- bit_maze[-1, ] | rawShift(bit_maze[-nrow(bit_maze), ] & r(1), 1)
  bit_maze[-nrow(bit_maze), ] <- bit_maze[-nrow(bit_maze), ] | rawShift(bit_maze[-1, ] & r(1), 1)
  bit_maze[, -1] <- bit_maze[, -1] | rawShift(bit_maze[, -ncol(bit_maze)] & r(1), 2)
  bit_maze[, -ncol(bit_maze)] <- bit_maze[, -ncol(bit_maze)] | rawShift(bit_maze[, -1] & r(1), 2)
  bit_maze[(bit_maze & r(1)) == r(0)] <- r(0)
  array_maze <- c(" ", "#", "|", "-", "+")[(as.integer(bit_maze) + 1) %/% 2 + 1]
  dim(array_maze) <- dim_maze
  bytes_needed <- 1 + (len_maze > 256)
  start_finish <- raw_as_int(c_maze[2 + len_maze_b + 1:(bytes_needed * 2)], bytes_needed) + 1
  array_maze[start_finish] <- c("^", "$")
  i <- 3 + len_maze_b + 2 * bytes_needed
  while (i < length(c_maze)) {
    loc <- raw_as_int(c_maze[i + 1:bytes_needed - 1], bytes_needed) + 1
    i <- i + bytes_needed
    text <- character(0)
    while (c_maze[i] & r(128)) {
      text <- c(text, rawToChar(c_maze[i] & r(127)))
      i <- i + 1
    }
    text <- c(text, rawToChar(c_maze[i]))
    array_maze[loc:(loc + length(text) - 1)] <- text
    i <- i + 1
  }
  apply(array_maze, 1, paste, collapse = "")
}

Try it online!

I knew you'd be able to store the walls as bits but I like your approach for compressing the non-wall character position data. +1


text:
Print a physical multiplication table
Rectangles have this nice property - an \$n \times m\$ rectangle consists of exactly \$n \times m\$ characters!
A.. more interesting property is that the rectangles can be aligned nicely in a multiplication table - for example, a \$3 \times 3\$ table:
# ## ###

# ## ###
# ## ###

# ## ###
# ## ###
# ## ###

Your challenge is to, given a number \$n\$ (\$ n > 1\$), output a formatted \$n \times n\$ multiplication table.
Rules

You can take the input one above or below \$n\$
Default I/O rules apply
You can choose any non-whitespace character to represent the blocks; every other character (though newlines are special) is considered whitespace. The chosen character can be different for different inputs, but must be the same throughout the input
The result can have unneeded characters, as long as the table aligns up and there are no occurrences of the chosen character that aren't part of the required output
The separators must be 1 character wide/tall, and the rectangles must be packed (i.e. no separators between their characters)
The empty lines can be empty, padding isn't required
The result can be a string, matrix, vector of lines, array of character arrays, or anything 2Dish
You may alternatively output a matrix/vector-of-vectors/anything 2Dish of numbers, but the background & foreground must be 2 distinct numbers (which can vary input to input, but not throughout an output) and no other numbers can be present. Extra surrounding characters are allowed with this format too (though they must match the background number)
This is code-golf, shortest answer in bytes, per-language, wins!

Examples
For the input 2, a valid ascii-art output, with the character ∙, is:
        ∙ ∙∙

Result: ∙ ∙∙.
        ∙ ∙∙

yes the period is there just to confuse you
Another valid answer as a number matrix, with 2 being the background number and 9 the foreground:
[[9,2,9,9,2,2],
 [2,2,2,2,2,2],
 [9,2,9,9,2,2],
 [9,2,9,9,2,2]]

An invalid output example would be
#  # #

#  # #

#  # #

as the rectangles have separators in between them.
Example outputs for \$4 \times 4\$:
# ## ### ####

# ## ### ####
# ## ### ####

# ## ### ####
# ## ### ####
# ## ### ####

# ## ### ####
# ## ### ####
# ## ### ####
# ## ### ####

1 0 1 1 0 1 1 1 0 1 1 1 1
0 0 0 0 0 0 0 0 0 0 0 0 0
1 0 1 1 0 1 1 1 0 1 1 1 1
1 0 1 1 0 1 1 1 0 1 1 1 1
0 0 0 0 0 0 0 0 0 0 0 0 0
1 0 1 1 0 1 1 1 0 1 1 1 1
1 0 1 1 0 1 1 1 0 1 1 1 1
1 0 1 1 0 1 1 1 0 1 1 1 1
0 0 0 0 0 0 0 0 0 0 0 0 0
1 0 1 1 0 1 1 1 0 1 1 1 1
1 0 1 1 0 1 1 1 0 1 1 1 1
1 0 1 1 0 1 1 1 0 1 1 1 1
1 0 1 1 0 1 1 1 0 1 1 1 1

Can we have extra row/columns of background characters in front, rather than at the end of the table?

@KirillL. sure, as long as the rows line up

Nitpick: ∙ (U+2219: BULLET OPERATOR) isn't present in the ASCII character set.  Nor is • (U+2022: BULLET) or ⋅ (U+22C5: DOT OPERATOR) or · (U+00B7: MIDDLE DOT). :)

R, 56 54 43 36 30 bytes
x=!!sequence(2:scan())-1;x%o%x

Try it online!
Takes input one above \$n\$ (so returns 3x3 matrix for \$n = 4\$).
Returns a matrix of  \$1s\$ (foreground), and \$0s\$ (background) with an extra row/column of zeroes in front.
Thanks to digEmAll for -7 bytes.

Thanks, BTW it can probably even be 30, if the extra blank row can be in front, rather than at the end.

Oh, can they? I missed that !

Haskell, 43 bytes
f n=map=<<flip(map.max)$show.(10^)=<<[1..n]

Try it online!
A clever approach by Ørjan Johansen outputting with 0's and 1's, generating each 10...00 part as the string representation of a power of 10.
111111111
101001000
111111111
101001000
101001000
111111111
101001000
101001000
101001000

Haskell, 49 bytes
f n=map=<<flip(map.max)$[0^i|x<-[1..n],i<-[0..x]]

Try it online!
Generates a pattern like [1,0,1,0,0,1,0,0,0,...], then makes a 2D by taking the min of pairs. The pointfree weirdness saves 2 bytes over the more readable:
f n|l<-do x<-[1..n];0:(1<$[1..x])=[[a*b|a<-l]|b<-l]

Try it online!

This can be shortened with my old triangular number trick: 43 bytes

Just realized, flip(map.max)=mapM max.

@ØrjanJohansen Whoa, how does that work? I think you could do with posting an answer of your own :-)

Set the monad to (->) b, then mapM :: (a -> b -> c) -> [a] -> b -> [c].

@xnor you forgot to change flip(map.max) to mapM max

JavaScript (ES6),  73 72  69 bytes
Returns a string made of 1's, spaces and line feeds.
n=>(g=s=>n-->0?g(s+`${p+=1} `):s[~n]?(+s[~n]?s:'')+`
`+g(s):'')(p='')

Try it online!

JavaScript (ES7),  87 83  82 bytes
Saved 3 bytes thanks to @dzaima
Returns a binary matrix, which is built cell by cell.
n=>[...Array(n*(n+3)/2)].map((_,y,a)=>a.map(h=(z,x)=>(17+8*x)**.5%1&&(z||h(1,y))))

Try it online!
How?
The width \$w\$ of the matrix is given by:
$$w=T_n+n-1={n+1\choose 2}+n-1=\frac{n(n + 3)}{2}-1$$
(NB: As allowed by the challenge rules, we output a matrix of width \$w+1\$ instead.)
Similarly, the cell located at \$(X,Y)\$ is empty if the following quadratic admits an integer root for either \$k=X\$ or \$k=Y\$:
$$\frac{x(x+3)}{2}-1-k=0\\
x^2+3x-2-2k=0
$$
whose determinant is:
$$\Delta=9-4(-2-2k)=17+8k$$

Not sure if it can save bytes, but the solution of that quadratic would be $\frac{-3\pm\sqrt{17+8k}}2$, so there would be an integer root if $\sqrt\Delta$ is odd, that is, $\Delta$ is an odd perfect square.

MATL, 14 10 bytes
:"@:Fv]g&*

This answer uses 1 for the blocks and 0 for the background
Try it at MATL Online
Explanation
     % Implicitly grab the input as an integer, N
     %   STACK: { 3 }
:    % Create an array from 1...N
     %   STACK: { [1, 2, 3] }
"    % For each element M in this array
  @: % Create an array from 1...M
     %   STACK (for 1st iteration): { [1] }
     %   STACK (for 2nd iteration): { [1; 0], [1, 2] }
     %   STACK (for 3rd iteration): { [1; 0; 1; 2; 0], [1, 2, 3] }
  F  % Push a zero to the stack
     %   STACK (for 1st iteration): { [1], 0 }
     %   STACK (for 2nd iteration): { [1; 0], [1, 2], 0 }
     %   STACK (for 3rd iteration): { [1; 0; 1; 2; 0], [1, 2, 3], 0 }
  v  % Vertically concatenate everything on the stack
     %   STACK (for 1st iteration): { [1; 0] }
     %   STACK (for 2nd iteration): { [1; 0; 1; 2; 0] }
     %   STACK (for 3rd iteration): { [1; 0; 1; 2; 0; 1; 2; 3; 0] }
]
g    % Convert everything to be boolean (turns all non-zeros to 1)
     %   STACK: { [1; 0; 1; 1; 0; 1; 1; 1; 0] }
&*   % Perform element-wise multiplication to expand this array out into the 2D grid
     % Implicitly display the result

C# (Visual C# Interactive Compiler), 96 95 bytes
-1 byte thanks to Embodiment of Ignorance
n=>{var l="";for(;n>0;)l=new string('#',n--)+' '+l;for(;n<l.Length;)WriteLine(l[n++]>32?l:"");}

Try it online!

not sure if input via argument but output via stdout is allowed

Mixing IO formats is fine

Why not add the n-- in the new string section?

Functions terminating with an exception aren't allowed unless REPL are allowed.

Jelly, 8 bytes
1ẋⱮj0ȧþ`

Try it online!

APL (Dyalog Unicode), 12 10 12 bytesSBCS
∘.×⍨∊,\0,⎕⍴1

Try it online!
Edit: -2 bytes from ngn. +2 bytes because the previous answers were invalid (with idea thanks to ngn and dzaima).
Explanation
∘.×⍨∊,\0,⎕⍴1

         ⎕    Take input.
           ⍴1  An array of 1s of length our input. Example: 1 1 1
       0,      Prepend a 0. Example: 0 1 1 1
     ,\        Take all the prefixes and concatenate them. Example: 0  0 1  0 1 1  0 1 1 1
    ∊          Flatten the list. Example: 0 0 1 0 1 1 0 1 1 1
∘.×⍨           Turn the above list into a multiplication table of 0s and 1s
               by multiplying the list with itself.

The output should look like:
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 1 0 1 1 0 1 1 1
0 0 0 0 0 0 0 0 0 0
0 0 1 0 1 1 0 1 1 1
0 0 1 0 1 1 0 1 1 1
0 0 0 0 0 0 0 0 0 0
0 0 1 0 1 1 0 1 1 1
0 0 1 0 1 1 0 1 1 1
0 0 1 0 1 1 0 1 1 1

you could take input as ⎕ to avoid the { }

Jelly, 7 bytes
‘RÄṬ|þ`

Try it online!
Outputs a digit matrix, using \$0\$ for the rectangles and \$1\$ for the padding between them. The TIO link contains a footer which formats a digit matrix in a human-readable way by lining up the rows and columns.
Explanation
‘RÄṬ|þ`
 R       Take a range from 1 to
‘          {the input} plus 1
  Ä      Cumulative sum; produces the first {input}+1 triangular numbers
   Ṭ     Produce an array with 1s at those indexes, 0s at other indexes
     þ   Create a table of {the array}
      `    with itself
    |      using bitwise OR

The number at cell \$(x,y)\$ of the resulting table will be \$1\$ if either \$x\$ or \$y\$ is a triangular number, or \$0\$ otherwise (because bitwise OR works like logical OR on 0 and 1). (We use R, range from 1, because Jelly uses 1-based indexing, so we don't have to worry about column 0 being incorrectly full of 0s; we have to add 1 to the input because the array produced by Ṭ stops at the largest element given in the input, so we need to draw a line on the right-hand side and the bottom.) The gaps between triangular numbers are the consecutive integers, so the rectangular blocks formed by the gaps between the lines end up as the sizes requested by the question; and the use of an OR operation (in this case, bitwise) allows the lines to cross each other correctly.

Why is this a community wiki?! If you want to waive rep you could just give it to Erik the Outgolfer

I CW all my answers (unless I think they might get a bounty, in which case I use a temporary account for them). Aiming for a high reputation normally means aiming to make the site worse (I once repcapped every day for a week to prove that it was possible; it wasn't particularly difficult, and yet it involved a lot of shallow questions/answers that didn't really contribute to the site much). Additionally, gaining reputation is mostly a negative on the account because it makes the site nag you into doing moderation work; and gaining privileges increases the risk of accidentally gaining badges.

Also, I mostly disagree with the concept of ownership of posts on SE (although mostly with questions rather than answers, but you can't CW a question without moderator help). A CW marker very clearly says "if something is wrong here, feel free to edit it"; so I'd be applying a CW marker to everything even if it didn't waive reputation. SE is meant to be part wiki, after all, but people don't always use it as that.

RE "aiming for a high reputation" if you don't want that then just post when you think it is meaningful and avoid what you term "shallow" q&a. Either you feel this answer does add something to the site, in which case post it without CW, or you think it is "shallow", in which case just don't post it. RE "I mostly disagree with the concept of ownership of posts on SE" - well you're simply on the wrong site then.

I think the answer adds something to the site, but if it's not CW, I feel compelled to post in a way that would gain me reputation rather than posting what I think would be interesting; back when I was a 20k user, I ended up really hating the site and almost got turned away from code golf in general because of it, so I deleted my account as a result. When I returned, I used to delete my account with every answer I posted (creating a new one for the next answer), but someone else pointed out that CWing every answer would have a similar effect, so nowadays I do that instead.

05AB1E, 9 bytes
Defines a program \$f\texttt{: }\color{purple}{\texttt{Nat}} →\color{purple}{\texttt{List}}\texttt{[}\color{purple}{\texttt{List}}\texttt{[}\color{purple}{\texttt{Nat}}\texttt{]]}\$.
Code:
$L×0ýSDδ*

Uses the 05AB1E-encoding. Try it online! or use the pretty-printed version.

Explanation:

$              # Push the number 1 and the input n
 L             # Create the list [1, 2, 3, ..., n]
  ×            # Vectorized string multiplication: 1 × [1, 2, 3, ..., n]
                 This would result in ["1", "11", "111", ..., "1" × n]
   0ý          # Join the resulting list with '0', resulting in "10110111011110111110..."
     S         # Split into single digits: [1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, ...]
      Dδ*      # Multiplication table with itself

C# (.NET Core), 208 155 bytes
class M{static void Main(string[]a){int i=int.Parse(a[0]);var l="";for(;i>0;)l=new string('#',i--)+' '+l;for(;;)System.Console.WriteLine(l[i++]>32?l:"");}}

Try it online!
A much revised version thanks to various helpful people (see the comments).

202?

166, indexing fixed

also *square not rectangular

Squares are rectangles!

also you should post this as your own answer, you did most of the work on it @ASCII-only.

150 bytes: https://tio.run/##JctPC8IgGIDxryJ2UDHH6A9EsnXo2k4dOowdxFy8YAq@soixz27B4Dn@HovKxuRKsd4gkm7GbDJYMkV4ks5A4JgThFc/GDFDyAQa09fDP3U46ckk4htK9RgT19DWWvgmuA9ZJ842bAtKCckIk35VWty/mN27usaA0bvqkSC7GwTHfQ9SDu1@d/FnSoVellLK8Qc

...good...use of crashing...

@EmbodimentofIgnorance invalid, does not work for n >= 10...

Is crashing the program like that even valid?

@ASCII-only this works: https://tio.run/##JcuxCsIwFEDRXwlxSEJsqboZWgdXC4KDQ@kQ4lMexATyQkVKvz0KXe50rqPKxQSlOG@JWD9TthkdmyI@WG8xSMoJw2sYrZoxZIbtv/XVJgJph2ZUZrKJ@ZZz84xJGuwao3wb4MPWU4qN2GJVKS2Y0H5VRt2@lOFdn2Og6KG@J8xwwQDSD6j12B32J3/kXJllKaXsmh8

@Stackstuck Yes. A program is allowed to terminate by crashing

Java 11, 109 bytes
n->{var l="";for(;n>0;)l="x".repeat(n--)+" "+l;for(;n<l.length();)System.out.println(l.charAt(n++)>32?l:"");}

Port of @ASCII-only's C# .NET answer.
Try it online.
n->{                       // Method with integer parameter and no return-type
  var l="";                //  Line-String, starting empty
  for(;n>0;)               //  Loop until `n` is 0:
    l=...+l;               //   Prepend to `l`:
       "x".repeat(n--)+" " //    Repeat "x" `n` amount of times, appended with a space
                           //    And decrease `n` by 1 afterwards with `n--`
    for(;n<l.length();)    //   Inner loop as long as `n` is smaller than the length of `l`:
      System.out.println(  //    Print with trailing newline:
        l.charAt(n++)>32?  //     If the `n`'th character of the line-String is NOT a space:
                           //     And increase `n` by 1 afterwards with `n++`
         l                 //      Print the line-String
        :                  //     Else:
         "");}             //      Print nothing (so only the newlines)

It's Java 11, not 8, because of the repeat method.

@OlivierGrégoire Oops.. Fixed

Though, is it acceptable to have a lambda that throws an exception? I thought it was ok for a full program, but not for function/exceptions

@OlivierGrégoire As long as it still outputs the expected result, I don't see why not tbh.

This is linked to this discussion. The answer seems to be if REPL are accepted (which they aren't by default), then it's fine to print on stderr or throw an exception, but if REPL isn't accepted then no std / exception are allowed.

@OlivierGrégoire Hmm, seems you're indeed right. I've fixed my answer.

Python 2, 67 bytes
s='';n=input()
while n:s='#'*n+' '+s;n-=1
for c in s:print(c>' ')*s

Try it online!
Prints blank lines for empty lines, which the challenge allows.
Same length (with input one above n):
r=range(input())
for n in r:print(' '.join(i*'#'for i in r)+'\n')*n

Try it online!

Wolfram Language (Mathematica), 41 bytes
a#&/@(a=Flatten@Array[{0,1~Table~#}&,#])&

Try it online!

Charcoal, 18 bytes
≔⪫ＥＮ×#⊕ι θＥθ⭆θ⌊⟦ιλ

Try it online! Link is to verbose version of code. Explanation:
   Ｎ                Input number
  Ｅ                 Map over implicit range
       ι            Current value
      ⊕             Incremented
    ×               Repetitions of
     #              Literal `#`
 ⪫                  Join with spaces
≔        θ          Assign to variable
           θ        Retrieve variable
          Ｅ         Map over characters
             θ      Retrieve variable
            ⭆      Replace characters with
              ⌊     Minimum of
               ⟦    List of
                ι   Row character
                 λ  Column character
                    Implicitly print each row on its own line

Mouse-2002, 79 bytes
Abusing Mouse's macros to repeat functionality.
?1+n:#P,n,j,k,b#P,j,y,k,#P,n,i,' ,#P,i,x,35;;;;$P0 2%:(1%.2%.-^4%3%!'2%.1+2%:)@

Try it online!

Brain-Flak, 170 bytes
(({})<>){(({})<{({}[()]<(<>({})<>){(({})<{({}[(())])}>[()])}{}{}(([(()()()()())(){}]){})>)}{}(({}))>[()])}{}{}{}([]){{}({}<>((((()()){}){}){}){})<>([])}{}<>{({}<>)<>}<>{}

Try it online!

PowerShell, 42 40 bytes
-2 bytes thanks to mazzy.
($r=1.."$args")|%{"$($r|%{'#'*$_})
"*$_}

Try it online!

40 bytes :)

@mazzy, cleverly :)

Ruby, 55 bytes
->n{(s=(1..n).map{|x|?#*x}*' ').chars.map{|c|c<?!?c:s}}

Try it online!
How?
First, create the first line, then iterate through its chars. Print the whole line if the character is '#', otherwise print the single character (which is a space)

APL+WIN, 29 bytes
m/⍉(m←¯1↓∊(⍳n),¨¯1)/(n,n←⎕)⍴1

Explanation:
(n,n←⎕)⍴1 prompt for integer n and create a nxn matrix of 1s

(m←¯1↓∊(⍳n) replicate the columns by 1,2,.....n and insert 0s between each replication

m/⍉ repeat replication and 0 insertion for the rows from above

Example:
⎕:
3
1 0 1 1 0 1 1 1
0 0 0 0 0 0 0 0
1 0 1 1 0 1 1 1
1 0 1 1 0 1 1 1
0 0 0 0 0 0 0 0
1 0 1 1 0 1 1 1
1 0 1 1 0 1 1 1
1 0 1 1 0 1 1 1

J, 17 bytes
[:*/~2=/\[:I.2+i.

Try it online!

did not know about this I. trick!

@Jonah I was waiting for an opportunity to use it :)

Perl 6, 35 33 bytes
{((\*Xx$_+1)~"
"Xx$_+1)>>.say}o^*

Try it online!
Anonymous Callable that takes a number and prints the multiplication table with *s with a trailing newline.
Explanation:
{                             }o^* # Change the input to the range 0..n-1
  (\*Xx$_+1)    # Cross string multiply '*' by all of range 1..n
                # This creates the string "* ** *** ****" etc.
            ~"\n"                 # Append a newline
                 Xx$_+1           # Cross string multiply again
 (                     )>>.say    # And print all the lines

Stax, 7 bytes
é╫▐§╘←╘

Run and debug it
The chosen character is backtick.  (How do you code format that in markdown?)
That means a and b are considered extraneous whitespace.

Ink, 151 152 151 bytes
VAR k=0
=t(n)
~k=n
-(u)
~n--
{n+1:->s(k-n)->u}->->
=r(c)
->g(c)->
{k-c:<>->r(c+1)}->->
=g(n)
{n>1:@<>->g(n-1)}@->->
=s(n)
{n:
->r(1)->
->s(n-1)
}
.->->

Try it online!
Good thing the rules allow excess characters.
Edit: +1: Fixed spacing. Also, display using @ (which doesn't need escaping) instead of # (which does)
Edit: -1: Apparently that fix also meant I no longer needed a trailing period to force a newline on the non-empty lines. Neat.

Ohh, I actually didn't even notice those spaces. I'll see if I can do something about them...

C++, 170 156 bytes
Thanks to dzaima
#include<string>
using v=std::string;v f(int a){v s;for(int i=1;i<=a;++i,s+='\n')for(int k=0;k<i;++k,s+='\n')for(int j=1;j<=a;++j)s+=v(j,'#')+' ';return s;}

138 bytes

MathGolf, 20 bytes
╒ÉÄ10;]h\■mÆε*╣¡§y╠n

Try it online!
MathGolf really needs to get some more functionality for splitting lists and creating 2D lists.
Explanation
╒                      range(1,n+1)
 É                     start block of length 3
  Ä                    start block of length 1
   1                   push 1
    0                  push 0
     ;                 discard TOS
      ]                end array / wrap stack in array
                       the stack now contains the list [1, 0, 1, 1, 0, 1, 1, 1, 0, 1, ...]
       h               length of array/string without popping (used for splitting string)
        \              swap top elements
         ■             cartesian product with itself for lists, next collatz item for numbers
          m            explicit map
           Æ           start block of length 5
            ε*         reduce list by multiplication (logical AND)
              ╣¡       push the string " #"
                §      get character at index 0 or 1 based on logical AND value
                       block ends here, stack is now ['#',' ','#','#',' ','#',...]
                 y     join array without separator to string
                  ╠    pop a, b, push b/a (divides the string using the length of a single line)
                   n   join array of strings with newlines

Haskell, 69 68 bytes
(a#b)0=[]
(a#b)n=(a#b)(n-1)++b:(a<$[1..n])
f n=((1#0)n#(0<$(1#0)n))n

Returns a matrix of numbers.
Try it online!
Variants of f with the same byte count:
f n=((#)<*>(0<$)$(1#0)n)n
f n|l<-(1#0)n=(l#(0<$l))n

Do the 0 row and column help?

@dfeuer: yes, they save a byte. See the first version of my answer.

Julia 1.0, 40 bytes
\ =join
!N=('#'.^(r=1:N)\' '*'\n').^r\'\n'

Try it online!
outputs a string with # and spaces:
julia> print(!3)
# ## ###

# ## ###
# ## ###

# ## ###
# ## ###
# ## ###

20 bytes with less strict output format, by returning a matrix of matrices:
!N=ones.(1:N,(1:N)')

SmileBASIC, 83 77 bytes
Graphical output.
Input is N-1
INPUT N
FOR J=0TO N
X=0FOR I=0TO N
GFILL X,Y,X+I,Y+J
X=X+I+2NEXT
Y=Y+J+2NEXT

C (gcc), 108 104 bytes
-4 bytes thanks to ceilingcat
f(n,j){char*s,u[n*n],*t=s=u,i=0;for(;i++<n;*s++=32)for(j=i;j--;)*s++=35;for(s=t;*t;)puts(*t++>32?s:"");}

Try it online!

Perl 6, 63 bytes
{(1..$_).map(((1..$_).map("#"x*).join(" ")~"\n")x*).join("\n")}

.join(' ') does nothing, '#' can be \* instead, the newline strings can use literal newlines, both l.map(str x*) can be (str Xx l) instead. 38 bytes

Python 3, 88 83 bytes
-5 bytes from Jo King
n,l=range(int(input())),''
for i in n:l+='#'*-~i+' '
for j in n:print((l+'\n')*-~j)

Try it online!

You can save bytes by declaring l outside the loop. Try it online!

@JonathanFrech There's an extra space in the newline string

Pyth, 19 bytes
VSQjb*]jdm*\#dSQNpb

Try it online!