text:
History homework helper
Doing my history reading and note-taking, I can't help but get tired of writing out all these long dates –– 1784 is six entire pencil lifts! jǝǝz!
As you can see, I –– like most challenge posters on this site –– am lazy when it comes to writing stuff. Thus, I ask you to please help me shorten some dates. Of course, your solution must be as short as possible since my hand is already tired from writing typing out the test cases.
How do I shorten a date?
Well funny you should ask. It's fairly simple:

Take two integers as input in whatever order you want ((smallest, biggest) or (biggest, smallest)).
Take the larger of the two numbers, and take only the part not in the smaller number.
 For example, given 2010, 2017, shorten 2017 to -7 because 201_ is in both at the same digit-places.
Print or return the smaller number, followed by a dash and then the shortened larger number.

For example:
Bonus brownies for you if you figure out these dates' significance :)
1505, 1516 -> 1505-16
1989, 1991 -> 1989-91
1914, 1918 -> 1914-8
1833, 1871 -> 1833-71
1000, 2000 -> 1000-2000
1776, 2017 -> 1776-2017
2016, 2016 -> 2016-

These dates lack significance :(
1234567890, 1234567891 -> 1234567890-1
600, 1600 -> 600-1600
1235, 1424 -> 1235-424
600, 6000 -> 600-6000

There was a challenge that did this with addresses recently but I'm on mobile so I can't find it to check how dupey this might be.

1914-18 or 1914-8?

600, 6000 -> 600-6000?

@Anders Yeah, you are right

No negative examples like -347, -341 -> -347--1, or -52, 25 -> -52-25, so I suppose the input is restricted to non-negative integers?

@JonathanAllan, yes that’s right. Input is only nonnegative integers

@Qwertiy, indeed.

1914-8 is WWI. Now gimme my brownies!

Let's see: 1505 - 1516 I have no idea; 1989-1991 the Persian Gulf War; 1914-1918 World War I; 1833 - 1871 I do not know; 1000-2000 the 2nd millennium C.E.; 1776-2017 the promulgation of the U.S.A.'s Declaration of Independence to the present; 2016-2016 last year. Well, I got 5 out of 7. Cool.

1505–1516 were the dates that Germaine of Foix was queen consort of Aragon, and 1833–1871 was the lifetime of clarinetist Luigi Bassi, among other things…

@R.Kap, for 2016-2016, I was thinking more along the lines of the US-UK-Australia clown craze (thank god that's over), but yours works too :p

@EriktheOutgolfer, enjoy your brownies!!

05AB1E, 16 bytes
`R¹íζ€Ë1Üg£R‚'-ý

Try it online!
Uses Jonathan Allan's algorithm.

Jelly,  17   16 bytes
DUµn/TṪṁ@Ṫ,j”-FṚ

A full program taking a list of years from, to and printing the result.
Try it online! or see the test suite.
How?
DUµn/TṪṁ@Ṫ,j”-FṚ - Main link: list of years [from, to]    e.g [1833,1871]
D                - convert to decimals                        [[1,8,3,3],[1,8,7,1]]
 U               - upend (to cater for differing lengths)     [[3,3,8,1],[1,7,8,1]]
  µ              - monadic chain separation, call that V
    /            - reduce V with:
   n             -   not equal?                               [1,1,0,0]
     T           - truthy indices                             [1, 2]
      Ṫ          - tail                                       2
         Ṫ       - tail V (pop from & modify V)               [1,7,8,1]
       ṁ@        - mould (swap @rguments) V like that length  [1,7]
          ,      - pair that with (the modified) V            [[1,7],[[3,3,8,1]]
            ”-   - literal '-' character
           j     - join                                       [1,7,'-',[3,3,8,1]]
              F  - flatten                                    [1,7,'-',3,3,8,1]
               Ṛ - reverse                                    [1,8,3,3,'-',7,1]
                 - implicit print                             1833-71

At first I thought I outgolfed this...then damn [600, 6000] appeared. And it seems this has been undervoted.

Javascript ES6, 59 57 chars
(x,y)=>(x+'-'+y).replace(x*10>y?/^((.*).*-)\2/:/()/,"$1")

Test:

f=(x,y)=>(x+'-'+y).replace(x*10>y?/^((.*).*-)\2/:/()/,"$1")

console.log(`1505, 1516 -> 1505-16
1989, 1991 -> 1989-91
1914, 1918 -> 1914-8
1833, 1871 -> 1833-71
1000, 2000 -> 1000-2000
1776, 2017 -> 1776-2017
2016, 2016 -> 2016-
1234567890, 1234567891 -> 1234567890-1
600, 1600 -> 600-1600
1235, 1424 -> 1235-424`.split`
`.map(t => t.match(/(\d+), (\d+) -> (.*)/)).every(([m,x,y,key]) => f(x,y)===key || console.log(x,y,key,f(x,y))))
console.log(f(600,6000))

Just try (x+'-'+y) ?

f(180, 1600) -> ?

Use currying (x=>y=>) to save a byte.

Dyalog APL, 29 bytes
{⍺,'-',x/⍨⌈\~((-⍴x)↑⍕⍺)=x←⍕⍵}

Try it online!
How?
⍺,'-' - the first year + , -
    =x←⍕⍵ - compare the second year formatted
    ((-⍴x)↑⍕⍺) - to the first year padded with spaces from left
    ⌈\~ - negate the result and mark all 1s after the first
x/⍨ - take the second year in all marked position

Retina, 34 bytes
(.*)((.)*),\1((?<-3>.)*)\b
$1$2-$4

Try it online! Link includes test cases. The balancing group and the word boundary ensure that both numbers are the same length before the prefix is matched. If not, then the word boundary matches at the start of the second year, so all that happens is that the comma changes to a dash.

Python 2, 102 bytes
lambda s,n:`s`+'-'+[[`n`[i:]for i in range(len(`s`)+1)if `n`[:i]==`s`[:i]][-1],`n`][len(`n`)>len(`s`)]

Try it online!
I feel like there has to be a better way to do this since it seems really verbose.  Extreme abuse of the `` evaluation of variables for this to work since we can't take strings as input.

a=100,b=199 returns "100-199" instead of "100-99".

@ChasBrown Dang, you're right. I rolled back my code to the previous iteration, which takes care of this case.

Haskell, 92 bytes
f=q.map show;q[a,b]=a++"-"++if(1<$a)<(1<$b)then b else snd<$>(snd$span(uncurry(==))$zip a b)

Takes input as a list of two integers [earlier date, later date].
Try it online!

Very nice! Since it's not recursive you don't need the f=, then you can do a bit of rearranging to get down to 88.

Python 2, 127 bytes
I am still new to this, so I don't know if it is okay to place another answer in the same language. Since I can't comment on other peoples posts yet I take my chances here.

Is it allowed to change the input from Integer to String? Cause that would save me around 10 bytes.
Arnlod Parmers answer has a mistake on 1989, 1991. (during the time I am posting this). Thank you tho for the `` evaluation trick tho (it saved me a byte)!

def f(s,b):
 s=`s`+'-'
 if len(`b`)>=len(s):return s+`b`
 for i in range(len(`b`)):
    if s[i]!=`b`[i]:return s+`b`[i:]
 return s

Try it online!
What I do is, I compare each single digit from both times and if the bigger one varies I print the smaller number plus the rest of the bigger one.
If someone could help me golf out the third line I would save like 30+ bytes. I only implemented it to handle the case of 600,6000 where the digits are equal but not the same length.

Yeah, it's ok to answer the same question in multiple languages, and you are allowed to take the input as String.

Haskell, 143 bytes
g x y=h(show x)(show y)
h x y=x++"-"++if length x<length y then y else foldl(\a(c,d)->if a==[]then if c==d then[]else[d]else a++[d])[](zip x y)

Try it online!
smallest biggest input (integers).
if length x<length y then y means that if x has less digits than y then the common part is void. Else, we store the digits of y from the first different digit.

C++, 285 271 bytes
-14 bytes thanks to Zacharý
#include<iostream>
#include<string>
#define S s.size()
#define R r.size()
using namespace std;void h(int a,int b){auto r=to_string(a),s=to_string(b);if(R>S)s=string(R-S,' ')+s;if(S>R)r=string(S-R,' ')+r;int i=0;for(;i<R;++i)if(r[i]!=s[i])break;cout<<a<<'-'<<s.substr(i);}

Code for testing :
std::vector<std::pair<int, int>> test = {
    {1505,1516},
    {1989,1991}, //End of the cold war
    {1914,1918}, //First world war start and end
    {1833,1871},
    {1000,2000}, //2000 = Y2K bug, 1000 is... well... Y1K bug ? :)
    {1776,2017}, //US constitution signed the 4th july, French elections & year of the C++ 17 standard
    {2016,2016}, //US elections
    {1234567890,1234567891},
    {600,1600},
    {1235,1424},
    {600,6000}
};

for (auto&a : test) {
    h(a.first, a.second);
    std::cout << '\n';
}

You can save a few bytes by using namespace std; and removing the T macro.

Python 2, 89 88 bytes
lambda a,b:`a`+'-'+`b`[map(lambda c,d:(len(`a`)==len(`b`))*(c==d),`a`,`b*10`).index(0):]

Try it online!

Common Lisp, 120 bytes
(lambda(s b &aux(d(#1=format()"~a"b)))(#1#()"~a-~a"s(if(<=(* s 10)b)b(subseq d(or(mismatch d(#1#()"~a"s))(length d))))))

Try it online!
Smallest, Biggest.
Ungolfed:
(defun f(s b &aux (d (format () "~a" b)))   ; s and b parameters, d string from s
  (format () "~a-~a" s                     ; print first number, then -, then abbreviation
      (if (<= (* s 10) b)                  ; if b is too large do not abbreviate
          b
          (subseq d (or (mismatch d (format () "~a" s)) ; else find first mismatch
                        (length d))))))    ; then extract the last part from mismatch
                                           ; or nothing if they are equal


text:
Are these identifiers equivalent?
In the language Nim, the rules for differentiating identifiers are slightly more relaxed than most other languages. Two identifiers are equivalent or address the same variable if they follow these rules:

the first character of both are the same (case sensitive)
both strings are the same (case insensitive) after removing all instances of the characters - and _

Challenge
Write a program/function that takes two strings that represent Nim identifiers and output a truthy or falsey value based on whether or not they are equivalent by the rules above.
Specifications

Standard I/O rules apply.
Standard loopholes are forbidden.
The strings will only contain ASCII printables. You do not need to check if it's a valid identifier.
The strings may be taken as two separate inputs, list of strings, etc. (you know the drill)
Empty strings need not be handled.
The output must be consistent for both truthy and falsey values.
This challenge is not about finding the shortest approach in all languages, rather, it is about finding the shortest approach in each language.
Your code will be scored in bytes, usually in the encoding UTF-8, unless specified otherwise.
Built-in functions that perform this task are allowed but including a solution that doesn't rely on a built-in is encouraged.
Explanations, even for "practical" languages, are encouraged.

Test cases
Input                                    Output

count, Count                             falsey
lookMaNoSeparator, answer                falsey
_test, test                              falsey
test, tset                               falsey
aVariableName, a_variable_name           truthy
numbers_are_cool123, numbersAreCool123   truthy
symbolsAre_too>_>, symbols_areTOO>>      truthy

Ungolfed reference implementation
This is written in Nim, itself.
import strutils, re

proc sameIdentifier(a, b: string): bool =
  a[0] == b[0] and
    a.replace(re"_|–", "").toLower == b.replace(re"_|–", "").toLower

I suggest a test case of f("_test", "test").

@Doorknob Added.

I suggest adding f("test", "tset"), as I think one answer gives an unexpected result for it.

@ØrjanJohansen Done.

Wait, so input is strings that "represent Nim identifiers", and we "do not need to check if it's a valid identifier", but then one of the examples contains >?

It looks like if we can assume actual Nim identifiers, even - is disallowed.

To be honest, I don't know Nim much. To be fair, I didn't say they were valid Nim identifiers. :P However much they might be wrong, the challenge is still the same. Nim is just an inspiration. ;)

JavaScript (ES6), 62 61 bytes
Saved 1 byte thanks to @JohanKarlsson
Takes input in currying syntax (a)(b). Returns a boolean.
a=>b=>(r=s=>s[0]+s.replace(/-|_/g,'').toUpperCase())(b)==r(a)

Test cases

let f =

a=>b=>(r=s=>s[0]+s.replace(/-|_/g,'').toUpperCase())(b)==r(a)

console.log(f("count")("Count"))                           // falsey
console.log(f("lookMaNoSeparator")("answer"))              // falsey
console.log(f("_test")("test"))                            // falsey
console.log(f("aVariableName")("a_variable_name"))         // truthy
console.log(f("numbers_are_cool123")("numbersAreCool123")) // truthy

/-|_/g saves a byte

Python 3, 76 bytes
lambda a,b:f(*a)==f(*b)
f=lambda f,*r:[f+k.lower()for k in r if~-(k in'-_')]

Try it online!
-1 byte thanks to notjagan
-3 bytes thanks to Wheat Wizard

-1 byte.

@notjagan Neat trick; thanks!

@notjagan I did not know you could do that, but I guess it makes sense, cool

-14 bytes!

@notjagan That only checks if the sets of characters are equal, not the strings themselves.

@xnor I overlooked the fact that this requires order preservation. I guess -6 bytes will have to suffice.

You may need str.isalnum()

slightly shorter

even shorter

@WheatWizard Thanks!

Actually, 15 bytes
⌠p"-_"(-Σùo⌡M═Y

Try it online!
Fun fact: this works with any number of inputs (it always returns truthy for less than 2 inputs).
Explanation:
⌠p"-_"(-Σùo⌡M═Y
⌠p"-_"(-Σùo⌡M    for each input:
 p                 separate the first character
  "-_"(-           remove all dashes and underscores from the rest of the string
        Σù         concatenate the list from the last operation and lowercase the string
          o        append it to the first character
             ═Y  are none of the elements unique?

C++, 288 248 bytes
-5 bytes thanks to Zacharý
#include<string>
#include<algorithm>
#define E(a,v)a.erase(std::remove(a.begin(),a.end(),v),a.end());
#define F(a)for(auto&c:a)c=toupper(c);
int e(std::string&a,std::string&b){if(a[0]!=b[0])return 0;E(a,45)E(b,45)E(a,95)E(b,95)F(a)F(b)return a==b;}

Thanks you, Preprocessor.
Also, this code takes advantage of the fact that in C++ the rule to cast int to bool is int_var!=0

Add a ; after the definition of F. Then, change the first return statement to return 0;E(a,45)E(b,45)E(a,95)E(b,95)F(a)F(b).

Pyth, 13 bytes
qFm[hd-r0d"-_

Try it online!
Explanation
qFm[hd-r0d"-_
  m              For each value in the input (which is a list of two strings):
   [             Create a list consisting of
    hd               the first character of each value
      -r0d"-_        and the lowercase version of the value without "-" or "_"
qF               Fold over equivalence; checks to see if both lists are the same

Ruby, 86 64 63 61 51 bytes
f=->x{x[0]+x.upcase.delete("-_")}
->x,y{f[x]==f[y]}

Try it online!
This feels really long still feels a bit long.  I would appreciate the help of any Ruby gurus out there in making this at least a bit shorter.

Not a guru, but I got inspired to check out the String method list. .delete("_-") is shorter.

f[x] is always a valid substitution for f.call(x) when stabby lambdas are involved.

@ValueInk Thanks! I've been trying to figure out how to golf in Ruby based on Stack Overflow answers, so I didn't know that was an option.

05AB1E, 12 bytes
εćs„-_SKl«}Ë

Try it online!
-1 thanks to Adnan.
Theoretically, εćs„-_-«}Ë should've worked for 10 bytes, but unfortunately this behavior is deprecated for now.

Oh yeah lol, I still need to fix that. You can save a byte by using „-_SK instead of '-K'_K.

@Adnan And I knew there was a way. Thanks!

11 bytes if you change SK to м.

@KevinCruijssen Hm, I'll update this answer. I don't think м existed back then. :P

Jelly, 11 bytes
ḟ⁾-_Œl,Ḣµ€E

Try it online!
-2 bytes thanks to Erik the Outgolfer
-1 byte thanks to Jonathan Allan

Take a list of two strings like ["symbolsAre_too>_>", "symbols_areTOO>>"] and use Ḣ;ḟ⁾-_Œl$µ€E instead for -2. Beat that Pyth!

...or even just ḟ⁾-_Œl,Ḣµ€E for 11 bytes.

No problem, maybe credit Erik for 2 and me for 1 :)

@JonathanAllan Ah. Good idea; I'll do that :)

CJam, 20 bytes
{_"-_"f-:el:=\:c:=*}

Takes input in the form of ["string1","string2"].
Try it Online (testing version)
{
_      e# make copy of input
"-_"f- e# remove all "-" and "_" from both words in copy
:el    e# convert words in copy to lowercase
:=     e# 1 if both words in copy are equal, 0 if not
\      e# move original version of input to top of stack
:c     e# convert each word in original input to only 1st character
:=     e# 1 if both characters from original input are equal, 0 if not
*      e# multply the two numbers we obtained. If and only if both are 1 (true) we return 1 (true)
}

Haskell, 85 78 76 71 68 bytes
2 bytes saved thanks to Ørjan Johansen
import Data.Char
s(a:x)=a:[toLower a|a<-x,all(/=a)"-_"]
x!y=s x==s y

Try it online!
Errors on the empty string.

all(/=a)"-_". Also after your latest edit, f needs to become an operator.

@ØrjanJohansen Ah thanks.  I thought there was a shorter way to do notElem but I couldn't remember it for the life of me.

Python 2, 72 bytes
lambda x,y:r(x)==r(y)
r=lambda x:x[0]+x[1:].lower().translate(None,"-_")

Try it online!
Won't work with Python 3 because of the new translate syntax.

Excel, 105 bytes
=AND(CODE(A1)=CODE(B1),SUBSTITUTE(SUBSTITUTE(A1,"_",""),"-","")=SUBSTITUTE(SUBSTITUTE(B1,"_",""),"-",""))

CODE() returns numeric code of first character.
String comparison in Excel is case insensitive.

Husk, 13 bytes
¤=§,←(m_ω-"-_

Try it online!
Builds for each string a pair consisting of the first character of the string and the whole string lowercased and with all occurrences of -/_ removed. Then checks if the two pairs are equal.
A particularity is that - in Husk is set difference (i.e. it removes only the first occurrence found): in order to remove all occurrences, the fixed point of -"-_ is found with ω-"-_.

Japt, 14 25 bytes
g ¥Vg ©Uu k"_-" ¥Vu k"_-"

Checks case-insensitive string equality by removing all characters in word 2 from word 1, and removing the -_ characters; that results in an empty string ("") if the words are equal.
Thanks Ørjan Johansen for pointing out the problem with this.
Checks first-char equality and if the uppercased inputs are equal after removing _-.
Try it online!
Explanation
Implicit input: U and V are input strings
g ¥Vg

Check if first letter of U (implicit) equals (¥) the first char of V.
©Uu k"_-" ¥Vu k"_-"

And (©) check if U, uppercased (u) and with _- removed (k), equals (¥) the same for V.
Implicitly return the boolean result.

I cannot get the link to work, but that explanation sounds like it does the wrong thing. What does it give for test vs. tset?

@ØrjanJohansen Good point... it'll fail for that case. As for the link, I've tested it and it works fine.

Yeah the link is my own fault - one of these days I need to change to a modern browser. I had better luck with Try it online!

@ØrjanJohansen Could I ask what browser you're using? I'm in the process of improving that CodePen and would like to make it as compatible as TIO.

cough still using Internet Explorer.

R, 76 bytes
function(l)(g=substr(l,1,1))[1]==g[2]&(h=tolower(gsub('-|_','',l)))[1]==h[2]

Anonymous function that takes input as a list of two strings. Takes advantage of the fact that R's string operations, while quite long in # of characters, are vectorized. Additionally wrapping an assignment in parentheses will bind the variable, so (g=substr(l,1,1)) retains a variable to be reused later in the line and similarly for h.
R returns the last evaluated expression as function output.
Ungolfed:
function(l){
  g <- substr(l,1,1)
  h <- tolower(gsub("_|-","",l))
  (g[1]==g[2])&(h[1]==h[2])
}

Try it online! (all test cases)

Vyxal 3, 10 bytes
…≈¿ᶴ-_½-ʀ≈

Try it Online!

Perl 5, 67 bytes
s/.//,push@a,$&,y/_-//dr for<>;say($a[0]eq$a[2]&&lc$a[3]eq lc$a[1])

Try it online!
Takes the identifiers as input on separate lines.
Explanation:
s/.//,             # remove the first character
push@a,            # storage space, even positions are first character
                   # odd positions are remainder
$&,                # implicit variable holding last matched pattern (first char)
y/_-//dr           # Remove _ and - from remainder of input
for<>;             # iterate over all input lines
say                # output
($a[0]eq$a[2]&&    # check that first character is identical and
lc$a[3]eq lc$a[1]) # so is the lowercase version of the rest

Python 2, 79 73 bytes
-6 bytes thanks to @notjagan: check the length of set of all reduced names is 1 or not.
lambda*l:len({x[0]+re.sub('-|_','',x[1:].lower())for x in l})<2
import re

Try it online!

-6 bytes.

Of course, set, I forgot its existence!! Thanks a lot!!

Retina, 28 bytes
T`L\_-`l_`(?<=.).+
^(.*)¶\1$

Try it online!

Charcoal, 29 bytes
∧⁼§θ⁰§η⁰⁼↧⪫⪪⪫⪪θ_ω-ω↧⪫⪪⪫⪪η_ω-ω

Try it online!
This prints a - for truthy and nothing for falsey.
Link to the verbose version. It first compares the first character of both input strings (⁼§θ⁰§η⁰) and then compares the rest of both strings after removing the underscores and the hyphens (⪫⪪⪫⪪θ_ω-ω) and converting to lowercase (↧).

C#, 101 89 bytes
string g(string s)=>string.Concat(s.ToUpper().Split('-','_'));f=>s=>f[0]==s[0]&g(f)==g(s)

Saved 12 bytes thanks to @kusi581.

if you use a local function for string.Concat(...) you can save 2 bytes ;)

@kusi581 Thanks, saved 12 bytes.

Java (OpenJDK 8), 95 bytes
a->b->a.charAt(0)==b.charAt(0)&&a.replaceAll("_|-","").equalsIgnoreCase(b.replaceAll("_|-",""))

Try it online!
Pretty straight forward.

Pyke, 13 bytes
F'hl1"-_"-)Xq

Try it online!
F         )   -  for i in input():
 'hl1         -   i[0], i.lower()
     "-_"-    -         ^.remove("-_")
           Xq - equal(^)

C (gcc), 126 114 bytes
#define p(s)do++s;while(*s==45||*s==95);*s>95?*s-=32:0;
f(char*a,char*b){while(*a&&*a==*b){p(a)p(b)}return*a==*b;}

Try it online!
With whitespace and comments:
#define p(s)                   // Define helper macro p           \
    do ++s;                    // Increment pointer at least once \
    while (*s==45 | *s==95);   // and past any '-' or '_'         \
    *s>95 ? *s -= 32 : 0;      // If lowercase letter, convert to upper

f(char* a, char* b) {          // Define main function f
    while (*a && *a == *b) {   // Loop until end of either string
                               // or a difference found
        p(a)                   // Transform pointer and one char
        p(b)                   // via helper p above
    }
    return *a==*b;             // Test chars equal (on success, both '\0')
}

The question specifies ASCII printables, so (1) The first while test can be shortened to *s%50==45. (2) However, the lowercasing is wrong, e.g. it fails on t~ vs. t^.

@ØrjanJohansen I thought we could assume the inputs were both valid identifiers.  But then that example with > was added, hmm.

Huh. I was going by that example too. Looking now in the Nim manual, even - isn't actually allowed, but the algorithm still includes it...

@ØrjanJohansen Yeah, I noticed - isn't in the grammar description of identifier - but then other parts of that document imply it is allowed.

Dyalog APL, 47 32 28 27 26 22 bytes
-4 bytes thanks to Kritixi Lithos
{(=/⊃¨⍵)∧≡/819⌶⍵~'-_'}

Takes input as a list of the strings.
Try it online!
How?
{(=/⊃¨⍵)∧≡/819⌶⍵~'-_'}
               ⍵~'-_'   Remove '-' and '_'
           819⌶         Lowercase
         ≡/             Equality between elements
        ∧               And
 (=/⊃¨⍵)                The first element of each element is equal

I think you can do ⊃⍺=⍵ instead instead of ⍺[1]=⍵[1]

No, because the arguments could be of a different length!

In that case, ⊃⍵ instead of ⍵[1] should work

Maybe even ⊃⍺=⊃⍵ instead of ⍺[1]=⍵[1]

Common Lisp, 98 bytes
(lambda(x y)(and(eql(elt x 0)(elt y 0))(string-equal(#1=remove #\-(#1##\_ y))(#1##\-(#1##\_ x)))))

Try it online!
Ungolfed (super straightforward!) version:
(defun f(x y)
  (and (eql (elt x 0) (elt y 0))         ; check if initial characters are identical
       (string-equal                     ; string comparison (case insensitive)
         (remove #\- (remove #\_ y))     ; remove from both strings the unwanted chars
         (remove #\- (remove #\_ x)))))

Brachylog, 17 bytes
hᵛ&{{¬∈"_-"&ụ}ˢ}ᵛ

Try it online!
Outputs through predicate success/failure.
h                    The first element
 ᵛ                   is the same for each element of the input,
  &                  and
   {           }ᵛ    for each element of the input the following are the same:
    {      &ụ}ˢ      every element uppercased which satisfies the condition that
     ¬∈              it is not an element of
       "_-"          the string "_-".

Erlang 113 bytes
A=fun(L)->string:to_lower(lists:flatten(string:tokens(L,"-_")))end,fun([C|D],[C|E])->A(D)==A(E);(_,_)->a==b end.

a pair of anonymous functions that compare the two lists. meant to be pasted in the erlang shell.
more readable:
A=fun(L) ->
    string:to_lower( % case insensitive
        lists:flatten( % squash all characters back into one list
            string:tokens(L,"-_") % return a list of list of characters
        )
    )
end.
fun([C|D],[C|E]) -> % are the first characters exactly the same?
    A(D)==A(E); % does the rest compare correctly?
   (_,_) -> % first chars not the same
    a==b % shorter than 'false'
end.

Clip, 25 bytes
&=(x(y=AxAy[Aa--m.L`a'-'_

Explanation:
x, y and z may be referenced in a Clip program to implicitly take up to three inputs. Since this program only references x and y, it takes two inputs which are assigned to x and y.
 =(x(y                    First characters of x and y are equal
&                         And
      =AxAy               A(x) == A(y)
           [Aa            Function A, takes parameter a
                m.L`a     Map all elements of a to lower case
              --     '-'_ Remove all occurrences of '-' and '_'

Takes two strings from standard input, outputs 1 and 0 for true and false respectively.

source: Stack Exchange

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

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

sort: votes


text:
Compute the Matrix-Vector
Given an integer array of at least two elements, output the Matrix-Vector (defined below) of the array.
To compute the Matrix-Vector, first rotate through the size-n input array to create a matrix of size n x n, with the first element of the array following the main diagonal. This forms the matrix portion. For the vector, flip the input array vertically. Then perform normal matrix multiplication. The output vector is the result.
For example,
a = [1, 2, 3]

First, rotate the array two times to the right, to obtain [3, 1, 2] and [2, 3, 1], then stack them to form a 3x3 matrix
[[1, 2, 3]
 [3, 1, 2]
 [2, 3, 1]]

Next, flip the array vertically to form the vector
[[1, 2, 3]    [[1]
 [3, 1, 2]  x  [2]
 [2, 3, 1]]    [3]]

Perform usual matrix multiplication
[[1, 2, 3]    [[1]    [[1+4+9]    [[14]
 [3, 1, 2]  x  [2]  =  [3+2+6]  =  [11]
 [2, 3, 1]]    [3]]    [2+6+3]]    [11]]

And the output is [14, 11, 11] or [[14], [11], [11]] (your choice of whether it's flattened or not).
Example #2
a = [2, 5, 8, 3]

[[2, 5, 8, 3]    [[2]    [[4+25+64+9]     [[102]
 [3, 2, 5, 8]  x  [5]  =  [6+10+40+24]  =  [80]
 [8, 3, 2, 5]     [8]     [16+15+16+15]    [62]
 [5, 8, 3, 2]]    [3]]    [10+40+24+6]]    [80]]

[102, 80, 62, 80]

Rules

The input and output can be assumed to fit in your language's native integer type.
The input and output can be given in any convenient format.
Either a full program or a function are acceptable. If a function, you can return the output rather than printing it.
If possible, please include a link to an online testing environment so other people can try out your code!
Standard loopholes are forbidden.
This is code-golf so all usual golfing rules apply, and the shortest code (in bytes) wins.

Jelly, 5 bytes
ṙJṚæ.

Try it online!
Explanation
Firstly:
$$\left[\begin{matrix}
\vec{v}_1 \\
\vec{v}_2 \\
\vec{v}_3 \\
\vec{v}_4 \\
\end{matrix}\right] \vec{x} =
\left[\begin{matrix}
\vec{v}_1 \cdot \vec{x} \\
\vec{v}_2 \cdot \vec{x} \\
\vec{v}_3 \cdot \vec{x} \\
\vec{v}_4 \cdot \vec{x} \\
\end{matrix}\right]$$
where \$\vec{v}_k\$ are row vectors and \$x\$ is a column vector.
This demonstrates that matrix multiplication is just dot product between rows and columns.
Then, \$\vec{v}_1\$ is actually \$\vec{v}\$ rotated \$0\$ to the right, and \$\vec{v}_k\$ is \$\vec{v}\$ rotated \$k-1\$ to the right, etc.
From another angle, \$\vec{v}_1\$ is \$\vec{v}\$ rotated \$n\$ to the left, and \$\vec{v}_n\$ is \$\vec{v}\$ rotated \$1\$ to the left, etc.
How it works
ṙJṚæ.   input: z (a list of length n)
ṙJ      [rot(z,1), rot(z,2), ..., rot(z,n)] (to the left)
  Ṛ     [rot(z,n), ..., rot(z,2), rot(z,1)]
   æ.   [rot(z,n).z , ..., rot(z,2).z , rot(z,1).z] (dot product)

Python 2, 68 bytes
lambda x:[sum(map(int.__mul__,x,x[i:]+x[:i]))for i in range(len(x))]

Try it online!

Python 2, 73 bytes
def f(v):r=range(len(v));return[sum(v[i]*(v*2)[i+j]for i in r)for j in r]

Try it online!

(v*2)[i+j] nice trick

Pyth, 10 bytes
ms*VQ.>QdU

Test suite.

Jelly, 9 bytes
LḶN⁸ṙæ×W€

Try it online!
A function that returns a vertical array. As a full program it appears as if it returns a horizontal array. To return a horizontal array you'd do LḶN⁸ṙ×⁸S€ instead.

05AB1E, 11 bytes
DgGDÁ})ε*}O

Try it online!

Mathematica, 35 bytes
Most@FoldList[RotateRight,#,1^#].#&

Try it online!
-9 bytes from @Not a tree

It's shorter to use Mathematica's own matrix multiplication than to recreate it yourself: Most@FoldList[RotateRight,#,1^#].#&. (But nice trick using Fold instead of Nest!)

R, 66 62 bytes
sapply(length(n<-scan()):1,function(i)c(n[-(1:i)],n[1:i])%*%n)

Try it online!

using Map(function(i)c(n[-(1:i)],n[1:i])%*%n,length(n<-scan()):1) is 3 bytes shorter; it just returns a list of matrices.

and a for loop for(i in seq(n<-scan()))F=c(c(n[-(1:i)],n[1:i])%*%n,F);F[1:i] is 61 bytes without returning a weird output format.

Haskell, 49 bytes
f v=sum.zipWith(*)v.fst<$>zip(iterate tail$v++v)v

Try it online!
For an input v=[1,2]

iterate tail$v++v yields the list [[1,2,1,2],[2,1,2],[1,2],[2],[],...]
fst<$>zip l v is the same as take(length v)l and yields [[1,2,1,2],[2,1,2]]
sum.zipWith(*)v is mapped on each element and to yield the vector-matrix row product.

A lot smarter than my answer! I like fst<$>zip l v very much.

CJam, 17 bytes
{__,,\fm>\f.*::+}

Try it online!

GolfScript, 37 bytes
{..,({.)\+}[*]{[1$\]zip{~*}%{+}*}%\;}

Try it online!

Python 3 + numpy, 68 bytes
lambda v:dot([roll(v,i)for i in range(len(v))],v)
from numpy import*

Try it online!

J, 14 bytes
+/ .*~#\.1&|.]

Try it online!
Explanation
+/ .*~#\.1&|.]  Input: array M
      #\.       Length of each suffix, forms the range [len(M), ..., 2, 1]
             ]  Identity, get M
         1&|.   For each 'x' in the suffix lengths, rotate left M  by 'x'
+/ .*~          Dot product with M

This is quite nice.  One question.  When you do 1&|. aren't you bonding 1 to |., creating a monad?  but then you use that monad with both a left and right arg, with the left one determining how many times it's applied.  What's going on here?

@Jonah It's a special form for &. When used as u n&f v, it is performing (n&f)^:u v. See the bottom of bond to see more parses of it.

ah, TIL.  is that something you use often?

@Jonah It's useful for golfing in many cases. In this case, it could have been done in an equal number of bytes using rank #\.|."{], but I posted the shortest that I came up with first before trying alternatives.

Haskell, 56 55 52 bytes
f l=[sum$zipWith(*)l$drop i$l++l|i<-[0..length l-1]]

Try it online!
Saved one byte thanks to @Laikoni
Saved three bytes: l++l instead of cycle l

You can save a byte with zipWith(*)l$drop i$cycle l.

APL, 17 bytes
(↑¯1⌽(⍳≢)⌽¨⊂)+.×⍪

Explanation:
(↑¯1⌽(⍳≢)⌽¨⊂)+.×⍪

 ↑                      matrix format of
  ¯1⌽                   right rotate by 1 of
     (⍳≢)               the 1..[length N]
         ⌽¨             rotations of
           ⊂            the enclosed input
             +.×        inner product with
                ⍪       1-column matrix of input

Octave - 67 48 bytes
Thanks to Luis Mendo for shaving this code down by 19 bytes!
Note: This code can only run in Octave.  MATLAB does not support expressions inside functions that can create variables while simultaneously evaluating the expressions that create them.
n=numel(a=input(''));a(mod((x=0:n-1)-x',n)+1)*a'

The original code in MATLAB can be found here, but can be run in any version of MATLAB.  This code is 67 bytes:
a=input('');n=numel(a)-1;a(mod(bsxfun(@minus,0:n,(0:n)'),n+1)+1)*a'

Explanation

a=input(''); - Receives a (row) vector from the user through standard input.  You must enter the vector in Octave form (i.e. [1,2,3]).
n=numel(...); - Obtains the total number of elements in the input vector.
x=0:n-1- Creates a row vector that increases from 0 up to n-1 in steps of 1.
(x=0:n-1)-x' - Performs broadcasting so that we have a n x n matrix so that each row i are elements from 0 up to n-1 with each element in row i subtracted by i.
mod(..., n)+1 - Ensures that any values that are negative wrap around to n so that each row i contains the vector from 0 up to n-1 circularly shifted to the left by i elements.  We add 1 as MATLAB / Octave starts indexing vectors or matrices with 1.
a(...) - Creates a n x n matrix where using (4), we access the correct indices of the input vector dictated by each value from (4) thus achieving the matrix we need.
(...)*a' - Performs matrix vector multiplication by transposing / flipping a to become a column vector prior to doing the multiplication.

Example Runs
>> n=numel(a=input(''));a(mod((x=0:n-1)-x',n)+1)*a'
[1,2,3]

ans =

         14.00
         11.00
         11.00

>> n=numel(a=input(''));a(mod((x=0:n-1)-x',n)+1)*a'
[2,5,8,3]

ans =

        102.00
         80.00
         62.00
         80.00

Try it online!

You can use implicit expansion instead of bsxfun. Defining n without -1 saves a few bytes too. And if you restrict to Octave you can assign a and 0:n to variables on the fly and save some more. Also, come here more often!! :-D

@LuisMendo ah yes. I forget Octave has implicit expansion already supported. Also saving the variable inside the input function is a great trick. I didn't think it could support that. I've seen it only in C or C++ from my own experience. Thanks!

@LuisMendo I'll place your suggested changes as an edit soon. I have been busy, but I haven't made this a priority as this entry will surely never win in byte count.

@LuisMendo Changed. Thank you very much :) Got to understand the code as I was changing my explanation above.

Glad I could help :-)

Octave, 34 bytes
@(a)a*toeplitz(a,shift(flip(a),1))

Try it online!

Husk, 11 bytes
mΣ§‡*´ṀKoṫ¢

Try it online!
Explanation
mΣ§‡*´ṀKoṫ¢  Implicit input, e.g. [1,2,3]
          ¢  Cycle: [1,2,3,1,2,3,...
        oṫ   Tails: [[1,2,3,1,2,3...],[2,3,1,2,3...],[3,1,2,3...]...
     ´ṀK     Replace each element of input with input: [[1,2,3],[1,2,3],[1,2,3]]
   ‡*        Vectorized multiplication (truncated with respect to shortest list)
  §          applied to the last two results: [[1,4,9],[2,6,3],[3,2,6]]
mΣ           Sum of each row: [14,11,11]

Javascript 79 bytes
Takes in an input array and outputs an array of the matrix vector
a=>(b=[...a],a.map(x=>([...b].reduce((m,n,i)=>m+=n*a[i],0,b.push(b.shift())))))

Explanation
a=>(
    b=[...a],                    // copy the input into b
    a.map(x=>(                   // transform a into a new array
        [...b].reduce(           // copy b into a new array and reduce
            (m,n,i)=>m+=n*a[i],  // memo += the element in the array * the ith
                                 // element in a
            0,                   // start memo at 0
            b.push(b.shift())    // shift the first element in b to the end
                                 // not used by reduce, but performing this op
                                 // here saves a few bytes
        )
    ))
)

Clojure, 80 bytes
#(map(fn[_ c](apply +(map * c %)))%(iterate(fn[c](into[(last c)](butlast c)))%))

iterate produces an infinite sequence, but instead of using (take (count %) (iterate ...)) to stop it I use % as an extra argument to map.

Perl 5, 65 + 1 (-a) = 66 bytes
@o=@F;for(@o){$r=0;$r+=$_*$F[$i++%@F]for@o;say$r;unshift@F,pop@F}

Try it online!
Takes the input vector as space separated numbers.  Outputs linefeed separated numbers representing the result vector.

C (gcc), 126 bytes
i,j;int*f(int*a,int n){int*r=malloc(n*sizeof(int));for(i=0;i<n;i++){r[i]=0;for(j=0;j<n;j++)r[i]+=a[j]*a[(j-i+n)%n];}return r;}

Try it online!
An array may be represented in input as a pointer and length.

Common Lisp, 78 bytes
(lambda(x)(loop as i on(append x x)as y in x collect(reduce'+(mapcar'* i x))))

Try it online!
Double the array (in this case a Lisp list) and iterate over the sublists with i (using x, through y, to stop the iteration). Then calculate the next element of the result by summing the result of multiplying each element of x with each element of i (again stopping when the shorter list is terminated).

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


text:
Solve the Trolley Problem
Philosophers have long pondered the Trolley problem. Unfortunately, no human has solved this problem yet. Luckily, as programmers we can use computers to solve the problem for us!

Input
Your program will take as input a (finite) directed graph (with at most one edge from x to y, for any x and y), with a designated node, and a nonnegative integer attached to each edge (representing the number of people tied to that track). In addition, every node has at least one exit edge.
The trolley starts at the designated node. Each turn, if the trolley is at node x, the utilitarian selects an edge (x,y). The people on that edge die, and trolley is now at edge y. This process continues forever.
Note that people can only die once, so if the edge (x,y) has n people tied to it, and the trolley runs over them, say, 100 times, it will still only result in n deaths.
Output
The utilitarian makes his choices in such a way as to minimize the number of people that die (which is guaranteed to be finite, since there are only finite people). Your program will output this number.
Input format
You may take the input graph in any reasonable way you like. For example, you could take it as a matrix, and count the designated node as the one labeled 0. Or you could use something like x1,y1,n1;x2,y2,n2;.... For example 0,a,0;a,b,5;a,c,1;b,b,0;c,c,0 to represent the standard trolley problem (with loops at the end).
Testcases

0,a,0;a,b,5;a,c,1;b,b,0;c,c,0 -> 1 (Go from 0 to a, a to c (killing one person), and then keep looping the trolley from c to c).
0,0,1;0,a,5;a,a,0 -> 1 (Keep going from 0 to 0, running over 1 person for all eternity),
0,a,5;0,b,1;a,a,1;b,b,6 -> 6 (0 -> a -> a -> a -> a -> ... (note that the greedy solution of going to b would be incorrect))
0,a,1;0,b,5;a,b,1;b,a,1 -> 3 (0 -> a -> b -> a -> b -> ...)
0,a,1;0,b,1;a,a,0;b,b,0 -> 1 (Note that there are two different options that the utilitarian might take that both kill only one person)

This is code-golf, so the shortest answer wins! Good luck.
Notes: There will be no sick loop de loops and multitrack drifting is banned. Also, although I prefer to think of this problem in terms of Asimov's three laws (/s) Peter Taylor has noted in the sandbox that this problem is mathematically equivalent to that of finding the rho (path the loops back on itself) of lowest weight.

Are there any fat men?

@BetaDecay yes, but due to upgrades to the trolley, they behave the same as regular people for the purpose of this question.

Jelly, 27 23 bytes
ṗL$µṭ0FIm2ASµÐḟµQ⁴ySµ€Ṃ

Try it online! (last test case)
Cruel Version (Mutilate the most people)
Takes input as numbers. For the last example, 1 is a and 2 is b. 0 is the starting node. The first argument is the list of edges (e.g. [0,1],[0,2],[1,1],[2,2]), and the second argument is a list of the edges and the number of people on them (e.g.[[0,1],[0,2],[1,1],[2,2]],[1,1,0,0]).
How it Works
ṗL$µṭ0FIm2ASµÐḟµQ⁴ySµ€Ṃ
ṗL$                       - on the first argument, get the Cartesian power of it to its length.
                            this gives all paths of the length of the input. Cycles are implicit
   µ        µÐḟ           - get valid paths starting with 0 -- filter by:
    ṭ0                      - prepend 0
      F                     - flatten
       I                    - get the difference between elements
        m2                  - every second difference: 0 for each edge that starts at the node the previous edge ended at, nonzero otherwise.
          AS                - 0 iff all elements are 0
               µ    µ€    - on each path:
                Q           - remove repeat edges.
                 ⁴y         - translate according to the mapping in the second program argument
                   S        - Sum
                      Ṃ   - get the minimum of these.

@Shaggy Umm, not sure what you mean? Does Jelly hurt your eyes or something?

@EriktheOutgolfer he's referring to the version of the program which tries to mutilate the most people.

@Shaggy That would be an interesting challenge.

Python 3, 80 bytes
y=lambda d,s=0,p=[],f=0:f in p and s or min(y(d,s+d[f][t],p+[f],t)for t in d[f])

Try it online!
Takes input as a dictionary keyed by node id.  The entries are a dictionary of neighbors and the number of people on the track between a node and the neighbor.  E.g., for the first test case:
{0: {1: 0}, 1: {2: 5, 3: 1}, 2: {2: 0}, 3: {3: 0}}

0 is the start node, 1 is node 'a', 2 is node 'b', etc.

Perl 6, 90 74 bytes
Thanks to Jo King for -16 bytes.
my&g=->\a,\b=0,\c=@,\d=0 {a{d}&&b||min map {g a,b+$^f,(|c,d),$^e},a{d}.kv}

Port of RootTwo's Python solution.
Try it online!

Perl has default parameters too! This can be 74 bytes


text:
Build a Semi-Zigzag
You will be given a positive integer N as input. Your task is to build a Semi-Zigzag, of N sides, each of length N. Since it is relatively hard to clearly describe the task, here are some examples:

N = 1:

O

N = 2:

O
 O O

N = 3:

O       O
 O     O
  O O O

N = 4:

O           O O O O
 O         O
  O       O
   O O O O

N = 5:

O               O O O O O
 O             O         O
  O           O           O
   O         O             O
    O O O O O               O

N = 6:

O                   O O O O O O
 O                 O           O
  O               O             O
   O             O               O
    O           O                 O
     O O O O O O                   O O O O O O

N = 7:

O                       O O O O O O O                       O
 O                     O             O                     O
  O                   O               O                   O
   O                 O                 O                 O
    O               O                   O               O
     O             O                     O             O
      O O O O O O O                       O O O O O O O

A larger test case with N = 9

As you can see, a Semi-Zigzag is made of alternating diagonal and horizontal lines, and it always begins with a top-left to bottom right diagonal line. Take note that the characters on the horizontal lines are separated by a space.
Rules

You may choose any non-whitespace character instead of O, it may even be inconsistent.
You may output / return the result as a String or as a list of Strings, each representing one line.
You may have a trailing or leading newline.
Default Loopholes apply.
You can take input and provide output by any standard mean.
If possible, please add a testing link to your submission. I will upvote any answer that shows golfing efforts and has an explanation.
This is code-golf, so the shortest code in bytes in every language wins!

Sandbox Post.

Do we have to put spaces between O that are horizontal ?

@HatsuPointerKun Take note that the characters on the horizontal lines are separated by a space. – Yes, you do have to put spaces.

Ah, yes. I should learn to read. Thanks

What is the highest number test case? Haven't tried all the answers but they seem to get borked at anything that a screen can't take from one side to the other. (i.e. 15)

@JohnHamilton The answers should theoretically work for any number given as input. They must not worry about what a screen can hold.

Charcoal, 24 bytes
ＦＮ«↶§7117ι×⁺#× ﹪ι²⁻Ｉθ¹»#

Try it online!
-5 thanks to Neil.
AST:
Program
├Ｆ: For
│├Ｎ: Input number
│└Program
│ ├↶: Pivot Left
│ │└§: At index
│ │ ├'7117': String '7117'
│ │ └ι: Identifier ι
│ └Print
│  └×: Product
│   ├⁺: Sum
│   │├'#': String '#'
│   │└×: Product
│   │ ├' ': String ' '
│   │ └﹪: Modulo
│   │  ├ι: Identifier ι
│   │  └2: Number 2
│   └⁻: Difference
│    ├Ｉ: Cast
│    │└θ: Identifier θ
│    └1: Number 1
└Print
 └'#': String '#'

It was too easy for Charcoal :)

@Mr.Xcoder This feels really ungolfed actually...not sure how to golf it.

The OP said that the character can be any and does not need to be consistent, so I was going for something along the lines of ＦＮ§⟦↘→↗→⟧ι⁻Ｉθ¹→ (15 bytes only), but lists of directions do not seem to work right in Charcoal. A pity.

@CarlosAlejo Tried that too but unfortunately it doesn't work.

At first I tried ¿﹪﹪ι⁴¦³↶¹↷¹ but then I found ↶Ｉ§7117ι which saves you 4 bytes.

§ works on numbers? Wait; ohhhhh right it's a string. BTW it actually saves me 5 bytes.

@CarlosAlejo Yeah directions aren't a datatype which makes it golfier on other areas

@ASCII-only Idea: maybe actually implement dls.

dls? That's a thing just it isn't actually a list, it's just syntax that makes it look like that. There's a good (ish?) reason why directions aren't a datatype

@ASCII-only I don't think there's a reason at all is there? I'd like to iterate over a dls with ι for example...right?

@EriktheOutgolfer Well yeah but IIRC in the early stages we didn't add it because it would have caused a ton of ambiguities (plus it's ambiguous here, Charcoal doesn't have a print statement that matches two variables and really it'd just make so many other things less golfy)

Let us continue this discussion in chat.

Oh, PivotLeft casts its parameter to an int, I hadn't realised that.

@Neil Umm, it doesn't? It doesn't seem to work without Ｉ.

Oh, sorry, I was just confused as to where the extra byte saving was coming from; I guess I must have just miscounted your original pivoting code. (Although, ASCII-only has recently changed Pivot to make the cast, it's just not live on TIO yet.)

@Neil You certainly miscounted...when it goes live on TIO I'll change it (benefits of no non-competing).

@CarlosAlejo ＦＮ✳§⟦↘→↗→⟧ι⁻θ¹O will work after Dennis pulls, ✳ being cast to direction

@ASCII-only You actually implemented that? wow

@ASCII-only ＧＨ✳✳ＥＮ§⟦↘→↗→⟧ιθO also works, nice! (Not quite what this question wants though, but never mind.)

@EriktheOutgolfer not exactly, that was meant to almost work, I just realized the way to make it work was to say to the parser you know it's a direction (btw they can be cast from strings and numbers too, cast atindex 7010 should work too

Python 2, 157 153 bytes
n=input()
o,s=q='O '
def p(k,t=q*n+s*(4*n-6)):print(t*n)[k*~-n:][:n*3/2*~-n+1]
p(2)
for i in range(n-2):p(0,i*s+s+o+s*(4*n-7-2*i)+o+s*(2*n+i-2))
n>1>p(5)

Try it online!

n*3/2*~-n+1 is the width of each line: ⌊3n/2⌋ · (n−1) + 1 characters.
The string q*n+s*(4*n-6) represents the top and bottom rows. If we repeat it and slice [2*(n-1):] we get the top row; if we slice [5*(n-1):] we get the bottom row. Hence the definition of p and the calls to p(2) and p(5). But since we need the repetition and line-length slicing for all other lines anyway, we reuse p in the loop.
The i*s+s+o+… is just a boring expression for the middle rows.
n>1>p(5) will short-circuit if n≯1, causing p(5) to not get evaluated. Hence, it’s shorthand for if n>1:p(5).

Wow, awesome solution, so clever. You earned my upvote

Wow, never knew Python had short circuiting on comparisons like that, +1.

Mathematica, 126 125 121 112 104 89 86 bytes
(m=" "&~Array~{#,#^2-#+1};Do[m[[1[i,#,-i][[j~Mod~4]],j#-#+i+1-j]]="X",{j,#},{i,#}];m)&

# is the input number for an anonymous function (ended by the final &).
m=" "&~Array~{#,#^2-#+1}; makes a matrix of space characters of the right size by filling an array of given dimensions #,#^2-#+1 with the outputs of the constant anonymous function "output a space" " "&.
Do[foo,{j,#},{i,#}] is a pair of nested do loops, where j ranges from 1 to # and inside of that i ranges from 1 to #.
m[[1[i,#,-i][[j~Mod~4]],j#-#+i+1-j]]="X" sets the the corresponding part of the matrix to be the character X based on j and i. The -i uses negative indexing to save bytes from #-i+1. (I forgot to write Mod[j,4] as j~Mod~4 in the original version of this code.) Jenny_mathy pointed out that we can use the modular residue to index into the list directly (rather than using Switch) to save 9 bytes, and JungHwan Min pointed out that we didn't need to use ReplacePart since we can set a part of an array and that 1[i,#,-i][[j~Mod~4]] uses the odd behavior and generality of [[foo]] to save bytes over {1,i,#,-i}[[j~Mod~4+1]]
Since meta established that a list of characters is a string (as JungHwan Min pointed out) we don't need to map any function across the rows of the matrix of characters since it's already a list of "string"s.

You can test this out in the Wolfram Cloud sandbox by pasting code like the following and hitting Shift+Enter or the numpad Enter:
(m=" "&~Array~{#,#^2-#+1};Do[m[[1[i,#,-i][[j~Mod~4]],j#-#+i+1-j]]="X",{j,#},{i,#}];m)&@9//MatrixForm

Very nice! you can replace StringJoin with   ""<>#&    to  save 4 bytes

@Jenny_mathy Thanks for the tip! That seems pretty useful.

You can also replace   Switch[...]   with   {1,i,#,-i}[[j~Mod~4+1]]  and save 9 bytes!

@Jenny_mathy excellent! That's a great technique and seems so natural in hindsight. I'd love to use an offset or alter the Do ranges to avoid the unsightly +1, but those methods wouldn't save bytes.

You don't actually need ReplacePart here. m=ReplacePart[...] can be m[[{1,i,#,-i}[[j~Mod~4+1]],j#-#+i+1-j]]="X" -- You can Set a Part of a list. That gets rid of 15 bytes.

@JungHwanMin Wow, thanks!

{1,i,#,-i}[[j~Mod~4+1]] can also be 1[i,#,-i][[j~Mod~4]]. This trick works because [[0]] returns the Head of an expression.

Mathematica, 179 bytes
Rotate[(c=Column)@(t=Table)[{c@(a=Array)[" "~t~#<>(v="o")&,z,0],c@t[t[" ",z-1]<>v,z-1],c@a[t[" ",z-2-#]<>v&,z-1,0],c@t[v,z-Boole[!#~Mod~4<1]-1]}[[i~Mod~4+1]],{i,0,(z=#)-1}],Pi/2]&

edit for @JungHwanMin

I didn't expect it to be that short, well done!

Just a question: Can Mod[z,4]==0 be replaced with Mod[z,4]<1?

yes, I can golf some things down...

I don't really know Mathematica, but can you replace Mod[#,4] with #~Mod~4 for -1 bytes?

@Mr.Xcoder The same can be done with Mod[i,4] and t[" ", #] but not the other instances of t since you'd need parentheses for either the subtraction or the grouping with c@, so the total saving from that infix notation is 3 bytes.

yes, of course! fixed

Oops... accidentally downvoted. Could you edit the answer so I can flip that upside down?

-Boole[!#~Mod~4<1]-1 can be reduced to -Boole[#~Mod~4>0]-1

C++, 321 234 bytes
-87 bytes thanks to Zacharý
#include<vector>
#include<string>
auto z(int n){std::vector<std::string>l;l.resize(n,std::string(n*n+n/2*(n-1),32));l[0][0]=79;int i=0,j,o=0;for(;i<n;++i)for(j=1;j<n;++j)l[i%4?i%4-1?i%4-2?0:n-j-1:n-1:j][i*n+j-i+(o+=i%2)]=79;return l;}

Returns a vector of strings

I got it down to 318 bytes: https://repl.it/JpJ2

Correction, I got it down to 239 bytes: https://repl.it/JpJ2/1

Sorry for the spam, 234 bytes: https://repl.it/JpJ2/3

What can I say except you're welcome!

@Zacharý thanks you very much sir

Yeah, I don't have the will power to create huge golfs like this, so my mind focuses on small elements of other golfs, allowing me to golf 87 bytes off of someone's code and still not have a flippin' clue how it works.

05AB1E, 21 20 19 bytes
Code
Uses the new canvas mode:
Fx<)Nè'ONÉúR3212NèΛ

Uses the 05AB1E encoding. Try it online!
Explanation:
F                      # For N in range(0, input)
 x<)                   #   Push the array [input, 2 × input - 1]
    Nè                 #   Retrieve the Nth element
      'ONÉúR           #   Push "O" if N is odd, else "O "
            3212Nè     #   Retrieve the Nth element of 3212
                  Λ    #   Write to canvas

For input 6, this gives the following arguments (in the same order) for the canvas:
[<num>, <fill>, <patt>]
[6,     'O',     3]
[11,    'O ',    2]
[6,     'O',     1]
[11,    'O ',    2]
[6,     'O',     3]
[11,    'O ',    2]

To explain what the canvas does, we pick the first set of arguments from the list above.
The number 6 determines the length of the string that will be written into the canvas. The filler is used to write on the canvas, which in this case is O. It cyclically runs through the filler string. The direction of the string is determined by the final argument, the direction. The directions are:
7  0  1
 \ | /
6- X -2
 / | \
5  4  3

This means that the 3 sets the direction to south-east, which can also be tried online.

also note that canvas mode is in development and very unstable

:O 05AB1E is mutating into Charcoal (also this is beating Charcoal O_o)

@ASCII-only Yeah, I saw the rise of all the ASCII-based languages (Charcoal, SOGL, V, etc.) and saw 05AB1E sink into the background, so I had to do something about it :p

so you copied charcoal? :P 05ab1e even has a canvas and directional printing (although charcoal only supports this style of printing with length via python)

SOGL V0.12, 36 bytes
╝.H∫2\?.╝}F2%?№@.┌Ο};1w⁄Hh1ž}.4%1>?№

Try it Here!
The basic idea is to for each number of the input range choose either adding a diagonal or the horizontal dotted part, in which case it will turn the array around for easier adding on.
Explanation:
╝                                     get a diagonal from the bottom-left corner with the length of the input - the starting canvas
 .H∫                        }         for each number in the range [1,inp-1] do, pushing counter
    2\?  }                              if it divides by 2, then
       .╝                                 create another diagonal of the input
          F2%                           push counter % 2
             ?     }                    if that [is not 0]
              №                           reverse the current canvas upside down
               @.┌Ο                       get an alternation of spaces and dashes with the dash amount of the input length
                    ;                   get the canvas on top of the stack
                     1w⁄                get its 1st element length
                        H               decrease it
                         h              swap the bottom 2 items - the canvas is now at the bottom and the current addition ontop
                          1             push 1
                           ž            at 1-indexed coordinates [canvasWidth-1, 1] in the canvas insert the current part made by the Ifs
                             .4%1>?   if input%4 > 1
                                   №    reverse the array vertically

If the input of 1 wasn't allowed, then ο.∫2%?.╝}F2\?№@.┌Ο};1w⁄Hh1ž}.4%1>?№ would work too. If random numbers floating around were allowed .∫2%?.╝}F2\?№@.┌Ο};1w⁄Hh1ž}.4%1>?№ would work too. If I were not lazy and implemented ‼, }F2%? could be replaced with ‼ for -4 bytes

Python 3, 228 226 224 215 197 195 bytes
-11 bytes Thanks to @Mr. Xcoder
-2 bytes Thanks to @Mr. Xcoder
def f(n,s=range):
 x=y=t=c=0;z=[]
 for i in s(n*n-n+2):c+=i%(n-(2<=n))<1;z+=[[x,y]];t=max(t,x);x+=2-c%2;y+=[-1,1][c%4<3]*(c%2)
 return'\n'.join(''.join(' O'[[k,j]in z]for k in s(t))for j in s(n))

Try it online!
Explanation and less-golfed code:
def f(n):
 x=y=t=c=0;z=[]                       #initialize everything
 for i in range(n*n-n+2):             #loop n*n-n+2 times which is the numberr of 'o's expected
    c+=i%[~-n,n]<n-1                  #if one cycle has been completed, increase c by 1, if n>1.
    z+=[[x,y]]                        #add [x,y] to z(record the positions of 'o')
    t=max(t,x)                        #trap maximum value of x-coordinate(to be used later while calculatng whole string)
    r=[[2,0],[1,1],[2,0],[1,-1]][c%4] #r gives direction for x and y to move, adjust it as per c i.e. cycles
    x+=r[0];y+=r[1]                   #yield newer values of x and y
 return '\n'.join(''.join(' o'[[k,j]in z]for k in range(t))for j in range(n)) #place space or 'o' accordingly as per the recorded posititons in z

Very nice work. Congratulations!

@Mr.Xcoder Thank you. I must say this one was tough, especially had problems identifying the correct range.

Replace c+=i%(n-1)<1 with c+=i%~-n<1 for -2 bytes

215 bytes, if 2>n:return'o' is quite redundant. I made a work-around with c+=i%[~-n,n][2>n]<1 instead of c+=i%~-n<1.

BTW, I am a great fan of this solution and want to contribute to its golfing. Very, very nice!

Sorry for the very late improvement, 195 bytes

@Mr.Xcoder Thanks, and it's never late... :)

Mathematica, 106 87 bytes
SparseArray[j=i=1;k=#-1;Array[{j+=Im@i;k∣#&&(i*=I);j,#+1}->"o"&,l=k#+1,0],{#,l}," "]&

Returns a SparseArray object of Strings. To visualize the output, you can append Grid@. Throws an error for case 1, but it's safe to ignore.
Explanation
j=i=1

Set i and j to 1.
k=#-1

Set k to input - 1.
l=k#+1

Set l to k*input + 1
Array[ ..., l= ...,0]

Iterate l times, starting from 0, incrementing by 1 each time...

j+=Im@i

Add the imaginary component of i to j...
k∣#&&(i*=I)

If the current iteration is divisible by k, multiply i by the imaginary unit...
{... j,#+1}->"o"

Create a Rule object that changes element at position {j, current iteration + 1} to "o"

SparseArray[ ...,{#,l}," "]

Create a SparseArray object using the generated Rule objects, with dimension {input, l}, using " " as blank.
Try it on Wolfram Sandbox!

there is something wrong with case n=3

n=2, 4,5,6 also have correctness problems, but I think this works for 7 and above.   I'm curious: is there precedent as to whether a SparseArray counts as an array? It can be visualized using Grid or MatrixForm, but I wouldn't normally count it as "a list of strings" here. If a 2D array of characters suffices, that cuts 8 bytes off of my solution (12 before Jenny_mathy's help), for instance.

@Jenny_mathy I don't see anything wrong... you may have pre-existing definition of PlusMinus, as this function never clears it. Running ClearAll[PlusMinus] gives a correct result.

@MarkS. read comment above?

Apparently, it's not okay to have the user manually reset the global variable as stated here. Fixed by sacrificing 8 bytes.

@MarkS. Also, an array of string is okay per meta consensus. If something is unclear, please ask the OP (as he/she makes the rules, not us). A simple search of "SparseArray" in this site gives an abundance of SparseArray responses, so I presume it's fine.

Thanks for the clarification; I'm new to the site and wasn't aware of that meta consensus. That will make a lot of things with strings easier in Mathematica!

@MarkS. Also, this page has a lot of tricks on golfing Mathematica.

@JungHwanMin I edited my answer as you asked

Haskell, 197 bytes
a n c=take(2*n)$cycle$c:" "
r i n x y=take(div(3*n)2*(n-1)+1)$(' '<$[1..i])++(cycle$"O "++(a(2*n-i-3)y)++"O "++(a(n+i-2)x))
z n=take n$(r 0 n 'O' ' '):[r i n ' ' ' '|i<-[1..n-2]]++[r(n-1)n ' ' 'O']

Try it online!
Thanks to @Lynn : fixed the spaces between Os on horizontal segments of the zigzag, but it costed a lot of bytes!
Some explanations:

r is a row of the output: it has the 0 y y y y y 0 x x x 0 y ... format, the number of xand y depending on the row and the initial n
for the top row, x='0'and y=' '
for the middle rows, x=' 'and y=' '
for the bottom row, x=' 'and y='0'
take(div(3*n)2*(n-1)+1) cuts an infinite row at the right place
every output has one top row and one bottom row except when n=1: take n handles this case.

Nicely golfed! You can drop a couple of those spaces, I think. And replicate n x can be replaced by x<$[1..n]. Also, your answer lacks the spaces between Os on horizontal segments of the zigzag.

@Lynn thanks! with the spaces on horizontal segments, my method becomes cumbersome, but i wanted to fix the code anyway...

You can save quite a bit by using operators and removing unneeded spaces, see here.

Python 2, 155 151 146 137 bytes
m=input()
n=m-1
r=range(n+2)
for L in zip(*[' '*i+'O'+n*' 'for i in(r+[n,m]*~-n+r[-2::-1]+([m,0]*n)[:-1])*m][:1+3*m/2*n]):print''.join(L)

Try it online!

@Mr.Xcoder Ahh. I see now.

@Mr.Xcoder Fixed now.

I am one year late to the golfing party, but \L`[2::5]saves a byte over''.join(L)`


text:
Output a text that doesn't output any of the characters used in the instructions to output the text
Main objective
The main objective is to output a text, it doesn't mind which text or where the text gets its output (it can be on a browser window, the default console etc).
It just requires the condition that what is output must be indeed "real chars" (the ones in UNICODE for example), it's not considered valid to display graphics that simulate chars.
Condition to program
Now into the conditions to program:
None of the characters that appear in the code must appear in the output.
The created string cannot be infinite (continuosly being created in a loop without end)
Test cases
So let's say that you code  is
abcdef

If that displayed
ghijk

The code would be valid, but if this displayed:
chiij

Then it would not be valid
Obviously something like
print("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
That displays
 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

would be invalid.
Challenge
Write a code that displays a text as defined.
Scoring
In this code-challenge, your answer is scored by the ratio between string length and number of bytes in code (string length / code length), where the highest score wins.
Good luck!

@StepHen How would this be a dupe of that?

@Mr.Xcoder anyone can just copy the top answers there and destroy any answer currently on here?

@StepHen Yeah, you're right. The first one has > 100E score here.

Fwiw I voted to close as too broad.

The empty program in Japt prints undefined, would that give it a score of 9/0 = infinity?

Yes, @ETHproductions. I think you have won.

Jelly, 0 bytes, score: 1/0 = ∞

Try it online!
That's right, the empty program in Jelly prints 0.
Jelly, 5 bytes, score: 1000.6
⁶³ȷ³x

Try it online!
Jelly, 2 bytes, score: 95 / 2 = 47.5
ØṖ

Try it online!
This yields the set of all printable ASCII: !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ and a space (95 bytes)

The same score, ∞ can be achieved in 0 bytes in Stuck, in which the empty program prints Hello, World!

Pyth, 1 byte, score: 26
G

Try it online
This outputs: abcdefghijklmnopqrstuvwxyz (26 bytes).

Python 2, 14 bytes, score 27672892.1429
print"\n"*9**9

Prints 387420490 newlines. Output truncated on TIO.
Try it online!

print"\n"*19**19 would have a score of 1,236512285E23 :)

@Mr.Xcoder I could not find an interpreter where larger numbers would work. Slightly larger numbers throw either MemoryError or IOError. Your number gives OverflowError: cannot fit 'long' into an index-sized integer

cQuents, score: 1.8530202E33 / 9 bytes = 2.0589113E32
#9^8e9::n

Score is based on math, not runs of the program.
Prints 43046721000000000 copies of 43046721000000000 joined on ,.
Explanation
 #9^8e9      n = (9^8) * 10^9
       ::    Print the sequence from 1 to n
         n   Each item in the sequence equals n

Try it online! (truncated)

The score is 3,87420489E17

@Mr.Xcoder made it bigger, so the score's bigger

Python 3, 91 bytes, score = 67067/91 = 737
s="s=forinage(35,127):chtp*0"
for f in range(35,127):
 if chr(f)not in s:print(chr(f)*1000)

Try it online!


text:
Products that equal a sum and vice versa
A fun pair of equivalences is 1 + 5 = 2 · 3 and 1 · 5 = 2 + 3. There are many like these, another one is 1 + 1 + 8 = 1 · 2 · 5 and 1 · 1 · 8 = 1 + 2 + 5. In general a product of n positive integers equals a sum of n positive integers, and vice versa.
In this challenge you must generate all such combinations of positive integers for an input n > 1, excluding permutations. You can output these in any reasonable format. For example, all the possible solutions for n = 3 are:
(2, 2, 2) (1, 1, 6)
(1, 2, 3) (1, 2, 3)
(1, 3, 3) (1, 1, 7)
(1, 2, 5) (1, 1, 8)

The program that can generate the most combinations for the highest n in one minute on my 2GB RAM, 64-bit Intel Ubuntu laptop wins. If your answer uses more than 2GB of RAM or is written in a language I can not test with freely available software, I will not score your answer. I will test the answers in two weeks time from now and choose the winner. Later non-competing answers can still be posted of course.
Since it's not known what the full sets of solutions for all n are, you are allowed to post answers that generate incomplete solutions. However if another answer generates a (more) complete solution, even if their maximum n is smaller, that answer wins.

To clarify, here's the scoring process to decide the winner:

I will test your program with n=2, n=3,  etc... I store all your outputs and stop when your program takes more than a minute or more than 2GB RAM. Each time the program is run for a given input n, it will be terminated if it takes more than 1 minute.
I look at all the results for all programs for n = 2. If a program produced less valid solutions than another, that program is eliminated.
Repeat step 2 for n=3, n=4, etc... The last program standing wins.

So no answers in windows-exclusive languages?

Personally, I dislike the scoring criteria. It's impossible to know whether our solutions will work and where to set the thresholds until we have results from the tests on your computer. I think a simple [tag:code-golf] would make a better question.

I assume hardcoding is not allowed. But then that restriction is close to being unobservable

How do you define "more complete solution" with different n? It is even not known whether number_of_solution(n) is monotonically increasing.

@user202729 I don't, I have to try each program for each n to see which program generates more solutions.

So the program with the largest number of solution will win regardless of n? I still don't understand how you test. BTW if a solution hardcode the value of n (the only answer now) is that allowed?

@user202729 Hardcoding is not allowed in any fastest-code challenge. The idea is that the winning entry will generate complete solutions for all n, except the last, where it will run out of time. I don't know why people believe that generating incomplete solutions will give them any reasonable shot at winning.

So if I can find 13 solution (which is incomplete) for n=6 I will win the existing answer, where if I find 11 solution (which is complete) for n=5 I will lose? So n is indeed irrelevant.

@user202729 No, you misunderstand the rules and I'm tired of explaining this. I asked a moderator to delete this challenge.

Another question: do you mean one minute for a single value, or a minute for all possible values up to n?

@GB I hope that the clarifications made it clear your program gets up to one minute per n.

I think the approach of not requiring proof of completeness is particularly elegant, as it gives people the opportunity to attack other answers by posting more complete ones, and for other answers to use imperfect heuristics until such attacks arrive.

Is Mathematica a freely available software? The trial version is available here.

"Two weeks time from now" is 3 days ago.

Two weeks are passed for me too...

I no longer like this challenge now that the announced scoring process doesn't happen, but I can't undo my upvote!

@ChristianSievers and everyone else, I will score this challenge, but it will take me some time. I had underestimated how much work it would be, and I've been very much not in the mood for it in the past couple weeks and been postponing it. Currently I am sick as well. I apologize. I won't make another challenge where I have to install multiple languages to score answers again to prevent this in the future.

Good to hear you will still score it. I understand it is a lot of work. I really like fastest-code challenges, and this one was more interesting than it seemed at first. Hope you get well again soon!

But who had to say is not ok installing different programming languages... I like too fastcode tag, but for try all solution in different programing languages: one has to run below one minute and use some extern site... For here I think GB wins. I hope you all are in good health

C (gcc), n = 50000000 with 6499 results in 59 s
To avoid producing over a terabyte of output consisting almost entirely of 1s, a sequence of (say) 49999995 1s is abbreviated as 1x49999995.
#include <stdio.h>
#include <stdlib.h>

static int n, *a1, k1 = 0, *a2, k2 = 0, s1, p1, *factor;

static void out() {
  if (s1 == p1) {
    for (int i = 0; i < k1 && i < k2; i++) {
      if (a1[i] < a2[i])
        return;
      else if (a1[i] > a2[i])
        break;
    }
  }

  for (int i = 0; i < k1; i++)
    printf("%d ", a1[i]);
  printf("1x%d | ", n - k1);
  for (int i = 0; i < k2; i++)
    printf("%d ", a2[i]);
  printf("1x%d\n", n - k2);
}

static void gen2(int p, int s, int m);

static void gen3(int p, int s, int m, int x, int q) {
  int r = s - n + k2 + 2;
  int d = factor[q];
  do {
    if (x * d <= m)
      x *= d;
    q /= d;
  } while (q % d == 0);
  do {
    if (q == 1) {
      a2[k2++] = x;
      gen2(p / x, s - x, x);
      k2--;
    } else {
      gen3(p, s, m, x, q);
    }
    if (x % d != 0)
      break;
    x /= d;
  } while (p / (x * q) >= r - x * q);
}

static void gen2(int p, int s, int m) {
  int n2 = n - k2;
  if (p == 1) {
    if (s == n2)
      out();
  } else if (n2 >= 1 && m > 1) {
    int r = s - n2 + 1;
    if (r < 2 || p < r)
      return;
    if (m > r)
      m = r;
    if (factor[p] <= m)
      gen3(p, s, m, 1, p);
  }
}

static void gen1(int p, int s, int m) {
  int n1 = n - k1;
  p1 = p;
  s1 = s + n1;
  gen2(s1, p1, s + n1 + 1 - n);
  if (n1 != 0) {
    int *p1 = &a1[k1++];
    for (int x = 2; x <= m && p * x <= s + x + n1 - 1; x++) {
      *p1 = x;
      gen1(p * x, s + x, x);
    }
    k1--;
  }
}

int main(int argc, char **argv) {
  if (argc < 2)
    return 1;
  n = atoi(argv[1]);
  if (n < 2)
    return 1;
  a1 = malloc(n * sizeof(int));
  a2 = malloc(n * sizeof(int));
  factor = calloc(4 * n - 1, sizeof(int));
  for (int p = 2; p < 4 * n - 1; p++)
    if (factor[p] == 0) {
      factor[p] = p;
      for (int i = p; i <= (4 * n - 2) / p; i++)
        factor[p * i] = p;
    } else if (factor[p] < factor[p / factor[p]]) {
      factor[p] = factor[p / factor[p]];
    }
  gen1(1, 0, 3 * n - 1);
  return 0;
}

Try it online!

Mathematica, n=293 with 12 solutions
OP changed the challenge and asks for input
Here is the new code that takes any n as input
For n=293 you get the 12 solutions
If[#<5,Union[Sort/@Select[Tuples[{1,2,3,4,5,6,7,8,9},{#}],Tr@#==Times@@#&]],For[a=1,a<3,a++,For[b=a,b<3,b++,For[c=b,c<5,c++,For[d=c,d<10,d++,For[e=d,e<300,e++,If[Tr[s=Join[Table[1,#-5],{a,b,c,d,e}]]==Times@@s,Print[s]]]]]]]]&

input

[n]

You can test this algorithm on Wolfram Sandbox which is an online freely available software
Just follow the link, paste the code (ctrl+v),paste input at the end of the code and press shift+enter to run.
You will get all my solutions in seconds
Here is also Try it online! in C++(gcc)
(Many thanks to @ThePirateBay for supporting and translating my code to a free language)
this program generates only solutions of the form {a,b,c}{a,b,c}
which means a+b+c=a*b*c
It takes 1 sec to compute
the twelve solutions are:

{1,1...,1,1,1,2,293}  {1,1...,1,1,1,2,293}
  {1,1...,1,1,1,3,147}  {1,1...,1,1,1,3,147}
  {1,1...,1,1,1,5,74}  {1,1...,1,1,1,5,74}
  {1,1...,1,1,2,2,98}  {1,1...,1,1,2,2,98}
  {1,1...,1,1,2,3,59}  {1,1...,1,1,2,3,59}
  {1,1...,1,1,2,5,33}  {1,1...,1,1,2,5,33}
  {1,1...,1,1,2,7,23}  {1,1...,1,1,2,7,23}
  {1,1...,1,1,2,8,20}  {1,1...,1,1,2,8,20}
  {1,1...,1,1,3,3,37}  {1,1...,1,1,3,3,37}
  {1,1...,1,1,3,4,27}  {1,1...,1,1,3,4,27}
  {1,1...,1,1,3,7,15}  {1,1...,1,1,3,7,15}
  {1,1...,1,2,2,6,13}  {1,1...,1,2,2,6,13}

"If your answer [...] is written in a language I can not test with freely available software, I will not score your answer."

Mathics should be able to execute this :)

Why the downvote?

This is partially hardcoded and I would like to know why these are the only solutions, if it's a particular case or what else.

@GB "you are allowed to post answers that generate incomplete solutions"

my program "..generates the most combinations for the highest n in one minute".It is not hardcoded.It just finds the first 12 "easiest" solutions in under a minute

It could be clearer that n was supposed to be an input. I clarified that now. It doesn't appear your program takes an input n.

@orlp Fixed! My program takes any n as input. For n=293 you get the 12 solutions. un-downvote please if since everything works!

I never downvoted. Please also confirm that you understand that your answer will be beaten by any decent answer that tries to generate all solutions, because your answer produces only a single solution for n = 3. For example G B's ruby answer already beats yours.

For n=293 the solutions result to me >= 44 (in 59 minutes of computation)

Python 2, n=175, 28 results in 59s
Made it a little slower using a reduction factor 2, but gets more solutions starting with n=83
I get results for n up to 92 on TIO in a single run.
def submats(n, r):
    if n == r:
        return [[]]
    elif r > 6:
        base = 1
    else:
        base = 2
    mx = max(base, int(n*2**(1-r)))

    mats = []
    subs = submats(n, r+1)
    for m in subs:
        if m:
            mn = m[-1]
        else:
            mn = 1
        for i in range(mn, mx + 1):
            if i * mn < 3*n:
                mats += [m + [i]]
    return mats

def mats(n):
    subs = []
    for sub in submats(n, 0):
        sum = 0
        prod = 1
        for m in sub:
            sum += m
            prod *= m
        if prod > n and prod < n*3:
            subs += [[sub, sum, prod]]
    return subs

def sols(n):
    mat = mats(n)
    sol = [
        [[1]*(n-1)+[3*n-1],[1]*(n-2)+[2,2*n-1]],
    ]
    if n > 2:
        sol += [[[1]*(n-1)+[2*n+1],[1]*(n-2)+[3,n]]]
    for first in mat:
        for second in mat:
            if first[2] == second[1] and first[1] == second[2] and [second[0], first[0]] not in sol:
                sol += [[first[0], second[0]]];
    return sol

Try it online!

"keep 5 elements [1..2] and limit 3n..." I'm glad you liked my algorithm ;-)

I already did something similar in the Ruby version, and now I'm trying to remove that limitation.

For a given n, how many solutions are hardcoded in your algorithm?

Not really hardcoded: 2 standard solutions can be generated using a shortcut (except for n=2 where they are the same combination), and by skipping these, I can limit the range to 2n instead of 3n. If this is considered hardcoded, I will change it.

For 61 my result would be 28 your I remember it is 27... Possibly I made some error

Or maybe you are right and I optimized a little too much.

@GB if there is a little result wrong... Why not repair or adjust the function?

Because not even OP seems to care anymore. But I will "fix" it now, or at least fine tune some parameter in order to get some more results.

Mathematica, n=19 with 11 solutions
this is my new answer according to OP's new criteria
(SOL = {};
For[a = 1, a < 3, a++,
For[b = a, b < 3, b++,
For[c = b, c < 5, c++,
 For[d = c, d < 6, d++,
  For[e = d, e < 3#, e++,
   For[k = 1, k < 3, k++,
    For[l = k, l < 3, l++,
     For[m = l, m < 5, m++,
      For[n = m, n < 6, n++, For[o = n, o < 3#, o++,
        s = Join[Table[1, # - 5], {a, b, c, d, e}];
        t = Join[Table[1, # - 5], {k, l, m, n, o}];
        If[Tr[s[[-# ;;]]] == Times @@ t[[-# ;;]] &&
          Tr[t[[-# ;;]]] == Times @@ s[[-# ;;]],
         AppendTo[SOL,{s[[-#;;]],t[[-#;;]]}]]]]]]]]]]]];
Union[SortBy[#,Last]&/@SOL])&

if you give an input [n] at the end, the program displays the solutions
here are my results (on my old laptop 64-bit 2.4GHz)

n->solutions
2 -> 2
3 -> 4
4 -> 3
5 -> 5
6 -> 4
7 -> 6
8 -> 5
9 -> 7
10 -> 7
11 -> 8
12 -> 6    (in 17 sec)
13 -> 10 (in 20 sec)
14 -> 7 (in 25 sec)
15 -> 7 (in 29 sec)
16 -> 9 (in 34 sec)
17 -> 10 (in 39 sec)
18 -> 9 (in 45 sec)
19 -> 11 (in 51 sec)
20 -> 7 (in 58 sec)

Ruby, n=12 gets 6 solutions
At least on TIO, usual results for 1 up to 11

->n{
  arr=[*1..n*3].product(*(0..n-2).map{|x|
    [*1..[n/3**x,2].max]|[1]
  }).select{|a|
    a.count(1) >= n-4
  }.map(&:sort).uniq
  arr.product(arr).map(&:sort).uniq.select{|r|
    r[0].reduce(&:+) == r[1].reduce(&:*) &&
    r[0].reduce(&:*) == r[1].reduce(&:+)
  }
}

Try it online!
Gets 10 results under a minute for n=13 on my laptop.

Haskell, a lot of solutions fast
import System.Environment

pr n v = prh n v v

prh 1 v l = [ [v] | v<=l ]
prh n 1 _ = [ take n $ repeat 1 ]
prh _ _ 1 = []
prh n v l = [ d:r | d <-[2..l], v `mod` d == 0, r <- prh (n-1) (v`div`d) d ]

wo n v = [ (c,k) | c <- pr n v, let s = sum c, s>=v,
                   k <- pr n s, sum k == v, s>v || c>=k ]

f n = concatMap (wo n) [n+1..3*n]

main = do [ inp ] <- getArgs
          let results = zip [1..] $ f (read inp)
          mapM_ (\(n,s) -> putStrLn $ (show n) ++ ": " ++ (show s)) results

f computes the solutions, the main function adds getting the input from the command line and some formatting and counting.

Compile like this: ghc -O3 -o prodsum prodsum.hs and run with command line argument: ./prodsum 6

Haskell, n=10 with 2 solutions

import           Data.List

removeDups = foldl' (\seen x -> if x `elem` seen then seen else x : seen) []
removeDups' = foldl' (\seen x -> if x `elem` seen then seen else x : seen) []

f n= removeDups $ map sort filterSums
  where maxNumber = 4
        func x y = if (((fst x) == (fst.snd$y)) && ((fst y) == (fst.snd$x)))
                     then [(snd.snd$x),(snd.snd$y)]
                     else [[],[]]
        pOf = removeDups' $ (map sort (mapM (const [1..maxNumber]) [1..n]))
        sumOf = map (\x->((sum x),((product x), x))) pOf
        filterSums = filter (\x-> not$(x == [[],[]])) (funcsumOfsumOf)

This performs like crap, but I at least fixed it so I am actually addressing the challenge now!
Try it online!

for n=2 you get ["[3,3][2,3]","[2,2][2,2]","[1,3][2,2]","[1,2][1,3]","[1,1][1,2]"] which is wrong

All solutions seem to be wrong actually

@Jenny_mathy How is it wrong? 3 + 3 is 6 and 2 * 3 is 6. Do i misunderstand the question.

you are missing the "vice versa"

@Jenny_mathy Dumb mistake on my part!  I fixed it, should work now.

@GB I read the question wrong, should be fixed at this point but it is dog slow.

Axiom, n=83 in 59 seconds here
-- copy the below text in the file name "thisfile.input"
-- and give something as the command below in the Axiom window:
-- )read C:\Users\thisuser\thisdirectory\thisfile

)cl all
)time on

-- controlla che l'array a e' formato da elementi  a.i<=a.(i+1)
tv(a:List PI):Boolean==(for i in 1..#a-1 repeat if a.i> a.(i+1) then return false;true)

-- funzione incremento: incrementa a, con #a=n=b/3,sotto la regola di "reduce(+,a)+#a-1>=reduce(*,a)"
-- e che n<reduce(*,a)<3*n ed reduce(+,a)<3*n
inc3(a:List PI):INT==
   i:=1; n:=#a; b:=3*n
   repeat
      if i>n  then return 0
      x:=reduce(*,a)
      if x>=b then a.i:=1
      else
          y:=reduce(+,a)
          if y>b then a.i=1
          else if y+n-1>=x then
                      x:=x quo a.i
                      a.i:=a.i+1
                      x:=x*a.i
                      if tv(a) then break
                      else a.i:=1
          else a.i:=1
      i:=i+1
   if x<=n then return inc3(a) -- x<=n non va
   x

-- ritorna una lista di liste di 4 divisori di n
-- tali che il loro prodotto e' n
g4(n:PI):List List PI==
  a:=divisors(n)
  r:List List PI:=[]
  for i in 1..#a repeat
     for j in i..#a repeat
        x:=a.i*a.j
        if x*a.j>n then break
        for k in j..#a repeat
            y:=x*a.k
            if y*a.k>n then break
            for h in k..#a repeat
                z:=y*a.h
                if z=n  then r:=cons([a.h,a.k,a.j,a.i],r)
                if z>=n then break
  r

-- ritorna una lista di liste di 3 divisori di n
-- tali che il loro prodotto e' n
g(n:PI):List List PI==
  a:=divisors(n)
  r:List List PI:=[]
  for i in 1..#a repeat
     for j in i..#a repeat
        x:=a.i*a.j
        if x*a.j>n then break
        for k in j..#a repeat
            y:=x*a.k
            if y=n  then r:=cons([a.k,a.j,a.i],r)
            if y>=n then break
  r

-- cerca che [a,b] nn si trovi gia' in r
searchr(r:List List List PI,a:List PI,b:List PI):Boolean==
  aa:=sort(a); bb:=sort(b)
  for i in 1..#r repeat
      x:=sort(r.i.1);y:=sort(r.i.2)
      if x=aa and y=bb then return false
      if x=bb and y=aa then return false
  true

-- input n:PI
-- ritorna r, tale che se [a,b] in r
-- allora #a=#b=n
--        ed reduce(+,a)=reduce(*,b) ed reduce(+,b)=reduce(*,a)
f(n:PI):List List List PI==
  n>100000 or n<=1 =>[]
  a:List PI:=[]; b:List PI:=[]; r:List List List PI:=[]
  for i in 1..n repeat(a:=cons(1,a);b:=cons(1,b))
  if n~=72 and n<86 then  m:=min(3,n)
  else                    m:=min(4,n)
  q:=reduce(*,a)
  repeat
    w:=reduce(+,a)
    if n~=72 and n<86 then x:= g(w)
    else                   x:=g4(w)
    if q=w then r:=cons([copy a, copy a],r)
    for i in 1..#x repeat
           for j in 1..m repeat
                  b.j:=(x.i).j
           -- per costruzione abbiamo che reduce(+,a)= prodotto dei b.i=reduce(*,b)
           -- manca solo di controllare che reduce(+,b)=reduce(*,a)=q
           if reduce(+,b)=q and searchr(r,a,b) then r:=cons([copy a, copy b],r)
    q:=inc3(a)
    if q=0 then break
  r

results:
 for i in 2..83 repeat output [i, # f(i)]
   [2,2][3,4][4,3][5,5][6,4][7,6][8,5][9,7][10,7][11,8][12,6][13,10][14,7][15,7]
   [16,10][17,10][18,9][19,12][20,7][21,13][22,9][23,14][24,7][25,13][26,11]
   [27,10][28,11][29,15][30,9][31,16][32,11][33,17][34,9][35,9][36,13][37,19]
   [38,11][39,14][40,12][41,17][42,11][43,20][44,12][45,16][46,14][47,14][48,13]
   [49,16][50,14][51,17][52,11][53,20][54,15][55,17]
   [56,14][57,20][58,17][59,16][60,15][61,28][62,15][63,16][64,17][65,18]
   [66,14][67,23][68,20][69,19][70,13][71,18][72,15][73,30][74,15][75,17][76,18]
   [77,25][78,16][79,27][80,9][81,23][82,17][83,26]

 f 3
    [[[1,2,5],[8,1,1]],[[1,3,3],[7,1,1]],[[1,2,3],[1,2,3]],[[2,2,2],[6,1,1]]]
                                     Type: List List List PositiveInteger
                                   Time: 0.07 (IN) + 0.05 (OT) = 0.12 sec

The way for run above text in Axiom, would be, copy all that text in a file, save the file with the name: Name.input, in a Axiom window use ")read absolutepath/Name".
results: (# f(i) finds the length of the array f(i), that is the number of solutions)