text:
Existential Golf
Math has a lot of symbols.  Some might say too many symbols.  So lets do some math with pictures.
Lets have a paper, which we will draw on.  To start the paper is empty, we will say that is equivalent to \$\top\$ or \$\textit{true}\$.
If we write other things on the paper they will also be true.
For example

Indicates that the claims \$P\$ and \$Q\$ are true.
Now let us say that if we draw a circle around some statement that statement is false.  This represents logical not.
For example:

Indicates that \$P\$ is false and \$Q\$ is true.
We can even place the circle around multiple sub-statements:

Since the part inside the circle normally reads as \$P\text{ and }Q\$ by putting a circle around it it means \$\text{not }(P\text{ and }Q)\$.  We can even nest circles

This reads as \$\text{not }((\text{not }P)\text{ and }Q)\$.
If we draw a circle with nothing in it, that represents \$\bot\$  or \$\textit{false}\$.

Since empty space was true, then the negation of true is false.
Now using this simple visual method we can actually represent any statement in propositional logic.
Proofs
The next step after being able to represent statements is being able to prove them.  For proofs we have 4 different rules that can be used to transform a graph.  We always start with an empty sheet which as we know is a vacuous truth and then use these different rules to transform our empty sheet of paper into a theorem.
Our first inference rule is Insertion.
Insertion
We will call the number of negations between a sub-graph and the top level it's "depth". Insertion allows us to introduce any statement we wish at an odd depth.
Here is an example of us performing insertion:

Here we chose \$P\$, but we could just as well choose any statement we wanted.
Erasure
The next inference rule is Erasure.  Erasure tells us that if we have a statement that is at a even depth we can remove it entirely.
Here is an example of erasure being applied:

Here we erased the \$Q\$, because it was \$2\$ levels nested. Even if we wanted to we could not have erased \$P\$ because it is \$1\$ level nested.
Double Cut
Double Cut is an equivalence.  Which means, unlike the previous inferences it can also be reversed.  Double Cut tells us that we can draw two circles around any sub-graph, and if there are two circles around a sub-graph we can remove them both.
Here is an example of the Double Cut being used

Here we use Double Cut on \$Q\$.
Iteration
Iteration is a equivalence as well.1 It's reverse is called Deiteration  If we have a statement and a cut on the same level, we can copy that statement inside of a cut.
For example:

Deiteration allows us to reverse an Iteration.
A statement can be removed via Deiteration if there exists a copy of it at the next level up.

This format of representation and proof is not of my own invention.  They are a minor modification of a diagrammatic logic are called Alpha Existential Graphs.  If you want to read more on this, there is not a ton of literature, but the linked article is a good start.

Task
Your task will be to prove the following theorem:

This, when translated into traditional logic symbolization is
\$((A\to(B\to A))\to(((\neg C\to(D\to\neg E))\to((C\to(D\to F))\to((E\to D)\to(E\to F))))\to G))\to(H\to G)\$.
Also known as the Łukasiewicz-Tarski Axiom.
It may seem involved but existential graphs are very efficient when it comes to proof length.  I selected this theorem because I do think it is an appropriate length for a fun and challenging puzzle.  If you are having trouble with this one I would recommend trying some more basic theorems first to get the hang of the system.  A list of these can be found at the bottom of the post.
This is proof-golf so your score will be the total number of steps in your proof from start to finish.  The goal is to minimize your score.
Format
The format for this challenge is flexible you can submit answers in any format that is clearly readable, including hand-drawn or rendered formats.  However for clarity I suggest the following simple format:

We represent a cut with parentheses, whatever we are cutting is put inside of the parens.  The empty cut would just be () for example.
We represent atoms with just their letters.

As an example here is the goal statement in this format:
(((A((B(A))))(((((C)((D((E)))))(((C((D(F))))(((E(D))((E(F))))))))(G))))((H(G))))

This format is nice because it is both human and machine readable, so including it in your post would be nice.
If you want some nice(ish) diagrams here is some code that converts this format to \$\LaTeX\$:
Try it online!
As for your actual work I recommend pencil and paper when working out.  I find that text just isn't as intuitive as paper when it comes to existential graphs.
Example proof
In this example proof we will prove the following theorem:

Now this may seem alien to you at first but if we translate this into traditional logic notation we get \$(A\rightarrow B)\rightarrow(\neg B\rightarrow \neg A)\$, also known as the law of contra-positives.
Proof:

Practice Theorems
Here are some simple theorems you can use to practice the system:
Łukasiewicz' Second Axiom

Meredith's Axiom

1: Most sources use a more sophisticated and powerful version of Iteration, but to keep this challenge simple I am using this version.  They are functionally equivalent.

I feel like this question is better suited for puzzling

@ConorO'Brien Why?  Puzzling is mainly concerned with answering rather than optimizing.  This question is very easy to answer, making it mostly golfing challenge.

Puzzling can very much be concerned with optimizing. I feel this challenge might find a better home on puzzling, but that's of course just my opinion

@connorobrien [tag:proof-golf] is a long established part of this community, and long may it continue.

Here's a site with a fun interactive Flash applet about these sorts of expressions: http://www.markability.net

19 steps

(())  [double cut]
(AB()(((G))))  [insertion]
(AB(A)(((G))))  [iteration]
(((AB(A)))(((G))))  [double cut]
(((AB(A))(((G))))(((G))))  [iteration]
(((AB(A))(((G))))((H(G))))  [insertion]
(((AB(A))(((G)(()))))((H(G))))  [double cut]
(((AB(A))(((DE()(C)(F))(G))))((H(G))))  [insertion]
(((AB(A))(((DE(C)(DE(C))(F))(G))))((H(G))))  [iteration]
(((AB(A))(((DE(CD(F))(DE(C))(F))(G))))((H(G))))  [iteration]
(((AB(A))(((E(CD(F))(DE(C))(F)((D)))(G))))((H(G))))  [double cut]
(((AB(A))(((E(CD(F))(DE(C))(E(D))(F))(G))))((H(G))))  [iteration]
(((AB(A))(((G)((CD(F))(DE(C))(E(D))((E(F)))))))((H(G))))  [double cut]
(((AB(A))(((G)((CD(F))(DE(C))(((E(D))((E(F)))))))))((H(G))))  [double cut]
(((AB(A))(((G)((C((D(F))))(DE(C))(((E(D))((E(F)))))))))((H(G))))  [double cut]
(((AB(A))(((G)((DE(C))(((C((D(F))))(((E(D))((E(F)))))))))))((H(G))))  [double cut]
(((AB(A))(((G)((D(C)((E)))(((C((D(F))))(((E(D))((E(F)))))))))))((H(G))))  [double cut]
(((AB(A))(((G)(((C)((D((E)))))(((C((D(F))))(((E(D))((E(F)))))))))))((H(G))))  [double cut]
(((A((B(A))))(((G)(((C)((D((E)))))(((C((D(F))))(((E(D))((E(F)))))))))))((H(G))))  [double cut]

Practice theorems
Łukasiewicz’ second axiom: 7 steps

(())  [double cut]
(A()(B)(C))  [insertion]
(A(A(B))(B)(C))  [iteration]
(A(AB(C))(A(B))(C))  [iteration]
((AB(C))(A(B))((A(C))))  [double cut]
((AB(C))(((A(B))((A(C))))))  [double cut]
((A((B(C))))(((A(B))((A(C))))))  [double cut]

Meredith’s axiom: 11 steps

(())  [double cut]
(()(D(A)(E)))  [insertion]
((D(A)(E))((D(A)(E))))  [iteration]
((D(A)(E))((D(A)(E(A)))))  [iteration]
((D(A)(E))(((E(A))((D(A))))))  [double cut]
(((E)((D(A))))(((E(A))((D(A))))))  [double cut]
(((E)((C)(D(A))))(((E(A))((D(A))))))  [insertion]
(((E)((C)(D(A)(C))))(((E(A))((D(A))))))  [iteration]
(((E)((C)((A)(C)((D)))))(((E(A))((D(A))))))  [double cut]
(((E)((C)((A)(((C)((D)))))))(((E(A))((D(A))))))  [double cut]
(((E)((C)((A(B))(((C)((D)))))))(((E(A))((D(A))))))  [insertion]

Haskell proof searcher
(What, you thought I was going to do that by hand?  :-P)
This only tries insertion, double cut introduction, and iteration.  So it’s still possible these solutions could be beaten using erasure, double cut elimination, or deiteration.
{-# LANGUAGE ViewPatterns #-}

import Control.Applicative hiding (many)
import Data.Char
import Data.Function hiding ((&))
import qualified Data.Map as M
import Data.Maybe
import qualified Data.MultiSet as S
import qualified Data.PQueue.Prio.Min as Q
import System.IO
import Text.ParserCombinators.ReadP

type Var = Char

data Part
  = Var Var
  | Not Conj
  deriving (Eq, Ord)

instance Show Part where
  show (Var s) = [s]
  show (Not c) = "(" ++ show c ++ ")"

newtype Conj = Conj
  { parts :: S.MultiSet Part
  } deriving (Eq, Ord)

instance Show Conj where
  show (Conj (S.toAscList -> [])) = ""
  show (Conj (S.toAscList -> g:gs)) =
    show g ++ concat ["" ++ show g1 | g1 <- gs]

true :: Conj
true = Conj S.empty

not_ :: Conj -> Conj
not_ = Conj . S.singleton . Not

(&) :: Conj -> Conj -> Conj
Conj as & Conj bs = Conj (S.union as bs)

intersect :: Conj -> Conj -> Conj
intersect (Conj as) (Conj bs) = Conj (S.intersection as bs)

diff :: Conj -> Conj -> Conj
diff (Conj as) (Conj bs) = Conj (S.difference as bs)

splits :: Conj -> [(Conj, Conj)]
splits =
  S.foldOccur
    (\a o bcs ->
       [ (Conj (S.insertMany a o1 bs), Conj (S.insertMany a (o - o1) cs))
       | (Conj bs, Conj cs) <- bcs
       , o1 <- [0 .. o]
       ])
    [(true, true)] .
  parts

moves :: Bool -> Conj -> [(Conj, String)]
moves ev a =
  (do (b, c) <- splits a
      andMoves ev b c) ++
  (do (p, _) <- S.toOccurList (parts a)
      partMoves ev p (Conj (S.delete p (parts a))))

andMoves :: Bool -> Conj -> Conj -> [(Conj, String)]
andMoves ev a b = [(a, "insertion") | not ev]

partMoves :: Bool -> Part -> Conj -> [(Conj, String)]
partMoves ev (Not a) b =
  [(a1 & b, why) | (a1, why) <- notMoves ev a] ++
  [ (not_ (diff a d) & b, "iteration")
  | (d, _) <- splits (intersect a b)
  , d /= true
  ]
partMoves _ (Var _) _ = []

notMoves :: Bool -> Conj -> [(Conj, String)]
notMoves ev a =
  (case S.toList (parts a) of
     [Not b] -> [(b, "double cut")]
     _ -> []) ++
  [(not_ a1, why) | (a1, why) <- moves (not ev) a]

partSat :: Part -> Bool -> M.Map Var Bool -> [M.Map Var Bool]
partSat (Var var) b m =
  case M.lookup var m of
    Nothing -> [M.insert var b m]
    Just b1 -> [m | b1 == b]
partSat (Not c) b m = conjSat c (not b) m

conjSat :: Conj -> Bool -> M.Map Var Bool -> [M.Map Var Bool]
conjSat c False m = do
  (p, _) <- S.toOccurList (parts c)
  partSat p False m
conjSat c True m = S.foldOccur (\p _ -> (partSat p True =<<)) [m] (parts c)

readConj :: ReadP Conj
readConj = Conj . S.fromList <$> many readPart

readPart :: ReadP Part
readPart =
  Var <$> satisfy isAlphaNum <|> Not <$> (char '(' *> readConj <* char ')')

parse :: String -> Maybe Conj
parse s = listToMaybe [c | (c, "") <- readP_to_S readConj s]

partSize :: Part -> Int
partSize (Var _) = 1
partSize (Not c) = 1 + conjSize c

conjSize :: Conj -> Int
conjSize c = sum [partSize p * o | (p, o) <- S.toOccurList (parts c)]

data Pri = Pri
  { dist :: Int
  , size :: Int
  } deriving (Eq, Show)

instance Ord Pri where
  compare = compare `on` \(Pri d s) -> (s + d, d)

search ::
     Q.MinPQueue Pri (Conj, [(Conj, String)])
  -> M.Map Conj Int
  -> [[(Conj, String)]]
search (Q.minViewWithKey -> Nothing) _ = []
search (Q.minViewWithKey -> Just ((pri, (a, proof)), q)) m =
  [proof | a == true] ++
  uncurry search (foldr (addMove pri a proof) (q, m) (moves True a))

addMove ::
     Pri
  -> Conj
  -> [(Conj, String)]
  -> (Conj, String)
  -> (Q.MinPQueue Pri (Conj, [(Conj, String)]), M.Map Conj Int)
  -> (Q.MinPQueue Pri (Conj, [(Conj, String)]), M.Map Conj Int)
addMove pri b proof (a, why) (q, m) =
  case M.lookup a m of
    Just d
      | d <= d1 -> (q, m)
    _
      | null (conjSat a False M.empty) ->
        ( Q.insert (Pri d1 (conjSize a)) (a, (b, why) : proof) q
        , M.insert a d1 m)
    _ -> (q, m)
  where
    d1 = dist pri + 1

prove :: Conj -> [[(Conj, String)]]
prove c = search (Q.singleton (Pri 0 (conjSize c)) (c, [])) (M.singleton c 0)

printProof :: [(Conj, String)] -> IO ()
printProof proof = do
  mapM_
    (\(i, (a, why)) ->
       putStrLn (show i ++ ". `" ++ show a ++ "`  [" ++ why ++ "]"))
    (zip [1 ..] proof)
  putStrLn ""
  hFlush stdout

main :: IO ()
main = do
  Just theorem <- parse <$> getLine
  mapM_ printProof (prove theorem)

22 Steps
\$\to\$(((())(()))) [Double Cut x3]
\$\to\$(((AB())(CDE(F)()))H(G)) [Insertion x3]
\$\to\$(((AB(A))(CDE(F)(CD(F)))(G))H(G)) [Iteration x3]
\$\to\$(((A((B(A))))(((((C))DE(F)(C((D(F)))))(G))))((H(G)))) [Double Cut x5]
\$\to\$(((A((B(A))))(((((C)DE)DE(F)(C((D(F)))))(G))))((H(G)))) [Iteration]
\$\to\$(((A((B(A))))(((((C)((D((E)))))((((((D))E(F)))(C((D(F)))))))(G))))((H(G)))) [Double Cut x5]
\$\to\$(((A((B(A))))(((((C)((D((E)))))((((((D)E)E(F)))(C((D(F)))))))(G))))((H(G)))) [Iteration]
\$\to\$(((A((B(A))))(((((C)((D((E)))))((((((D)E)((E(F)))))(C((D(F)))))(G))))))((H(G)))) [Double Cut]

A few things I learned from completing this puzzle:

Reduce the provided representation. This involves reversing double cuts and iterations. For example, this axiom reduces to (((AB(A))(((C)DE)(CD(F))(E(D))(E(F)))(G))H(G)) after reversing double cuts, and (((AB(A))(()CDE(F)))H(G))) after reversing iterations.
Look for stray atoms. For example, H is used as a dummy variable, and thus can be inserted at any point.

Practice Theorem Solutions:
Solution for Łukasiewicz' Second Axiom: [8 Steps]
\$\to\$(()) [Double Cut]
\$\to\$(()AB(C)) [Insertion]
\$\to\$((AB(C))AB(C)) [Iteration]
\$\to\$((A((B(C))))A((B))(C)) [Double Cut x2]
\$\to\$((A((B(C))))A(A(B))(C)) [Iteration]
\$\to\$((A((B(C))))(((A(B))((A(C)))))) [Double Cut x2]
Solution for Meredith's Axiom: [12 Steps]
\$\to\$(()) [Double Cut]
\$\to\$(()(A)D(E)) [Insertion]
\$\to\$(((A)D(E))(A)D(E(A))) [Iteration x2]
\$\to\$(((((A)D))(E))(A)D(E(A))) [Double Cut]
\$\to\$(((((A(B))D)(C))(E))(A)D(E(A))) [Insertion x2]
\$\to\$(((((A(B))(C)D)(C))(E))(A)D(E(A))) [Iteration]
\$\to\$(((((A(B))(((C)((D)))))(C))(E))(((((A)D))(E(A))))) [Double Cut x4]

I've updated to include my full solution. Fun puzzle! Please let me know how I can improve my post.

Generally here answers aren't hidden - the assumption being that reading the answer implies a "spoiler" to the solution. Also we have MathJax here, using \$ as the begin/end which I think would make your solution much easier to read. I hope you have a nice time here :)

I've updated the number of rules used (the proof remains the same). Can someone who is good at formatting please help improve my answer?


text:
Draw a times table (also called modular multiplication circle) of a number \$n\$ with \$k\$ vertices
Not to be confused with this question.
You need to draw a times table (also known as Cremona's method for cardioid generation) as shown in this video. The number \$n\$ and \$k\$ will be the inputs.
In the video n and k are 2 and 10 respectively.

How to draw?

Draw a circle, divide its perimeter into equal spaced parts with
\$k\$ points and number them with \$0, 1, 2, \dots, k-1\$ .
Draw \$k\$ line segments between \$i\$ and \$i\times n \mod k\$   for all integers \$i\$, \$0 \le i < k\$.

You can use any graphing library that your language allows.
Remember this is a code-golf so keep the answer short and sweet.

Examples
Input : n = 2 and k = 27

Input : n = 5 and k = 10

You can also play around with it here. The modulus/points is \$k\$ while multiplication factor is \$n\$.

Challenge
You need to draw at least the circle and the lines.
You can output any file format (svg, png, jpeg) and HTML rendering is also allowed.
You can also write the image to STDOUT

Best of luck because you are going to need it!

From the looks of it, this seems to be Cremona's method for cardioid generation. Related Mathematica SE question.

Your description seems to confuse K with N sometimes. I had to read it a couple times to see what you meant.

What do we need to draw, specifically? Just the lines? Circle and the points too?

Frankly, this question should have been posted on the Sandbox and left there for some time (at least a few days). However, since this challenge is already posted, I advise that you keep it here, but make as many clarifications as possible before someone answers the question (to prevent invalidating answers).

I like this challenge, and I don't want it to end up being closed. I therefore suggest clarifying what exactly has to be included in the output: the circle, the points and the lines, the lines and the points, the lines only, etc.

I've been away for a bit, but when did PPCG get $\LaTeX$ again?

Python 2 with pylab, 133 129 bytes
from pylab import*
n,k=input()
gca().add_patch(Circle((0,0),1))
a=2*pi/n
for i in range(n):c=i*a,k*i*a;plot(cos(c),sin(c))
show()

Saved 4 bytes thanks to Mr. Xcoder.

for i in range(n):c=i*a,k*i*a;plot(cos(c),sin(c)) saves 4 bytes

Python 2, 280 241 235 233 bytes
from math import*
n,k=input()
a=2*pi/k
s='<svg viewBox="-49 -49 98 98"><circle r="49"/><path d="'
p=0;exec"s+='M%f,%f L%f,%f '%(49*cos(p),49*sin(p),49*cos(p*n),49*sin(p*n));p+=a;"*k
open('c.svg','w').write(s+'" stroke="red"/></svg>')

Try it online!
Saved 35 bytes due to removing xmlns attribute at the encouragement of qwr; and 4 more since %k was not required. 4 more by using exec instead of for i in range(k).
Writes an SVG file named c.svg. Look, ma! No graphics library! :)

works for me without xmlns tag. Is it optional?

@qwr: I think it's required in the relevant RFC if it is served as image/svg+xml (e.g., in a browser as a standalone file and not embedded in an html document). Otherwise - yes, It seems like, e.g., Photoshop will display it properly without. Would save 35 bytes; but seems a bit cheaty :).

well this is code golf so I say if it opens in a common program (opens in GNOME image viewer for me) then it's valid.

@qwr: Yes, it is code golf, so...

JavaScript (ES6), 207 206 bytes

with(Math)f=(k,n,g=i=>[cos(i*=PI*2/k),sin(i)])=>`<svg viewBox=-1,-1,2.01,2.01><circle r=1 fill=none${s=` stroke=#000 stroke-width=.01 `}/><path d=M${[...Array(k)].map((_,i)=>g(i)+`L`+g(i*n)).join`M`}${s}/>`
;o.innerHTML=f(27,2)

<input type=number min=2 value=27 id=k><input type=number min=2 value=2 id=n>

Output of the function is an HTML5-compatible SVG snippet. The function itself is the first line of the snippet, the rest of the snippet merely serves to demonstrate the function. Edit: Saved 1 byte thanks to @Arnauld.

@ChasBrown Whoops, overlooked that, sorry. There goes 40 bytes...

R, 160 bytes
function(n,k,C=cospi,S=sinpi){par(pty="s")
plot(S(z<-0:2e4/1e4),C(z),'l',xaxt='n',yaxt='n',an=F,ax=F,xla="",yla="")
a=2/k*1:k
segments(C(a),S(a),C(a*n),S(a*n))}

Try it online!
... or play with it if you want (change the code and press execute)

-2 bytes thanks to @JayCE

Here's the appearance :

Nice! you can check with OP if it's acceptable to print axes, etc. to save about 30 bytes. also a=T works within symbols I believe. Probably more golfing possible...

@JayCe: saved several bytes still without showing the axes. I had to get rid of symbols since it's not really a perfect circle of radius 1 around zero. I resorted to plot

I can not test this right now but it should save 2 bytes

Carefully rethinking the formula (...stupid of me) saved a lot of bytes :)

Javascript 146 bytes + HTML 113 + Js Library cardioidjs  = 259 bytes
Note: I dont think this is allowed but acording to OP

You can use any graphing library that your language allows.

Program ask for k and n and uses the lib to create the table

_=document.getElementById('a');l=prompt;c=new Cardioid(_,{iterations:1000,pieces: (t=l("k"))%2?t-1:+t,fun1:l("n"),initialRotation: 180});c.draw()

<canvas id="a" width="500" height="500"></canvas>

Looks valid. But boring. And some redundant spaces?

Python 3 + turtle, 126 118 bytes
Just learn about clone. This version creates a turtle for each line drawn, so it clutters the screen a bit. Calling ht() will help.
from turtle import*
n,k=eval(input())
a=clone()
exec('a.circle(99,360*n/k);circle(99,360/k);clone().goto(a.pos());'*k)

A direct port of my LOGO solution. However Python multi-turtle support is a bit different (they're named, not numbered), so turtle 0 in LOGO solution is the default turtle, and turtle 1 is a.
[*map(goto,[a.pos(),pos()])] is exactly 1 byte shorter than
p=pos();goto(a.pos());goto(p), and obviously much less readable...

This exits immediately after the drawing is done. To prevent that, adds done() at the end.
Because the drawing may be too slow, add speed(0) at the beginning (after the import statement)
I don't have Python 2 installed, but this (111 bytes) should work.

Desmos, 58 bytes
r=1
p=[0,...,k-1]2\pi/k
s=-cot(p/2+mod(np,k)/2)
sx+sinp-scosp

View it on Desmos, includes other functions for better visualization
Had more golfability than most Desmos answers, fun to work on. Note: since the link in the submission is broken, you can use this as an interactive tool to play around with them now!
Explanation:
r=1                       Draw circle
p=[0,...,k-1]2\pi/k       Generate list of angles (note: switching to degrees sould save a byte here, but we can't do that as it's not possible through code alone)
s=-cot(p/2+mod(np,k)/2)   Calculate slope of the line for each angle pair
sx+sinp-scosp             Draw the lines

FMSLogo, 80 77 bytes
[repeat ?[arc2 360/? 99 foreach list ask 1[arc2 360/?*?2 99 pos]pos "setpos]]

Usage
This is an explicit-slot template, which can be used by typing, for example
apply [...] [54 2]

into the Logo prompt, replacing [...] with the program above.
It can be used to draw the circle anywhere on the screen, but the radius is hardcoded (99).
To clear the screen use cs.
Images
(FMSLogo also has a convenient command bitcopy for copying to clipboard. Example run:
pu bk 100 bitcopy 200 200 home pd

)

Excel VBA, 167 bytes
An immediate window function that takes input and output onto the Sheet1 object.
Set s=Sheet1.Shapes:s.AddShape(9,0,0,1E2,1E2).ShapeStyle=7:f=50:c=[2*Pi()/B1]:For i=0To[B1]:j=i*[A1]:s.AddLine f+f*Cos(c*i),f+f*Sin(c*i),f+f*Cos(c*j),f+f*Sin(c*j):Next

Ungolfed and Commented
Set s=Sheet1.Shapes                                             ''  On the Sheet1 Object
s.AddShape(9,0,0,1E2,1E2).ShapeStyle=7                          ''  Add a blue circle
f=50                                                            ''  Hold var as 50
c=[2*Pi()/B1]                                                   ''  Calc Rads Splitting circle into k slices
For i=0To[B1]                                                   ''  Iterate from 0 to k
j=i*[A1]                                                        ''  Calculate Next Point
s.AddLine f+f*Cos(c*i),f+f*Sin(c*i),f+f*Cos(c*j),f+f*Sin(c*j)   ''  Draw a line from i to i*n Mod k
Next                                                            ''  Loop

Output

Small Basic, 218 bytes
A Script that takes input from the TextWindow and outputs to the GraphicsWindow Object
n=TextWindow.Read()
k=TextWindow.Read()
GraphicsWindow.DrawEllipse(0,0,100,100)
f=50
c=2*Math.Pi/k
For i=0To k
GraphicsWindow.DrawLine(f+f*Math.Cos(c*i),f+f*Math.Sin(c*i),f+f*Math.Cos(c*i*n),f+f*Math.Sin(c*i*n))
EndFor

Try it at SmallBasic.com! Requires IE/Silverlight
Output
Input 3,24

Lua (love2d Framework),281 bytes
j,p,z,w,v=love,math,100,200,90 g,r=j.graphics,p.rad c=g.circle function j.load(b)n,k=b[1],b[2]m= 360/k::t::a=function(i)return z*p.sin(r(m*i +v))+w,z*p.cos(r(m*i+v))+w end c("line",w,w,z)for i=1,k do x,y=a(i)c("fill",x,y,3)l=(i*n)%k d,e=a(l)g.line(x,y,d,e)end g.present()goto t end

If this is copied in a main.lua file and run it will show it on screen
output for n=2,k=22

also beware if you run it, that it will probably tell you that it is frozen because it is in an endless draw function in the load function
but it will show it on the screen.
Also here is a clean version
--definitions of everything
j,p,z,w,v=love,math,100,200,90
g,r=j.graphics,p.rad c=g.circle
function j.load(b)
  --get the parameters
  n,k=b[1],b[2]
  m= 360/k
  --goto label
  ::t::
  --function which takes a point number as input and outputs the x,y adds also 90 to it because why ever love starts
   a=function(i)return z*p.sin(r(m*i +v))+w,z*p.cos(r(m*i+v))+w end
   --draw the circle
   c("line",w,w,z)
   for i=1,k do
     --get point position and draw it
     x,y=a(i)
     c("fill",x,y,3)
     --calculate and print the line to the other point
     l=(i*n)%k
     d,e=a(l)
     g.line(x,y,d,e)
   end
   --show it on screen
   g.present()
   goto t
end

If someone also wants to play around with it here a version which you can
change the n with up and down and the k with left and right arrows :)
--definitions of everything
j,p,z,w,v=love,math,100,200,90
g,r=j.graphics,p.rad c=g.circle
function j.load(b)
  --get the parameters
  n,k=b[1],b[2]

end

function u(n,k)
--function which takes a point number as input and outputs the x,y adds also 90 to it because why ever love starts
   a=function(i)return z*p.sin(r(m*i +v))+w,z*p.cos(r(m*i+v))+w end
   --draw the circle
   m= 360/k

   c("line",w,w,z)
   for i=1,k do
     --get point position and draw it
     x,y=a(i)
     c("fill",x,y,3)
     --calculate and print the line to the other point
     l=(i*n)%k
     d,e=a(l)
     g.line(x,y,d,e)
   end
end

function j.draw()
  --n=n+0.001
  --k=k+0.01
  u(n,k)
  love.graphics.print("n: "..n.."\nk: "..k,0,0)
end

function j.keypressed(ke,s)
  k=k*1
  if ke== "up"then
    n=n+1
  elseif ke=="down" then
    if n >1 then n=n-1 end
  elseif ke=="right" then
    k=k+1
  elseif ke=="left" then
    if k>1 then
      k=k-1
    end
  end

end

APL (dzaima/APL), 57 bytes
No MATL answer here yet! yay!
{n←⍺⋄P5.G.circle 3⍴30⋄{P5.G.ln↑30×1+2 1○ᑈ1n×⍵×○2÷k}¨⍳k←⍵}

Made with help from dzaima.
Draws a 30x30 circle  with the times table for n and k.
Function submission which takes arguments as n f k, and will display properly on a default sized canvas.
This uses the formula from user58543's answer.
You can test this out using this file and dzaima's APLP5 engine.
Explanation:
{n←⍺⋄P5.G.circle 3⍴30⋄{P5.G.ln↑30×1+2 1○ᑈ1n×⍵×○2÷k}¨⍳k←⍵}
{n←⍺⋄                                                   k←⍵} store left arg in n and right arg in k
      P5.G.circle 3⍴30⋄                                      Draw circle of radius 30

                                                        ⍳k   generate range 1..k
                       {                              }¨     Execute the following for each number i:
                                            1n×⍵×○2÷k        Multiply [1,n] with i×2π/k
                                      2 1○ᑈ                  Take cos and sin of each of those
                                30×1+                        Multiply 30, add 30 to them
                              ↑                              Convert to matrix
                        P5.G.ln                              Plot a line using those coordinates

Output for n=5, k=10:

:-)

MATL, 39 37 35 33 31 29 bytes
:qG/ti*vO9Wt:w/h,18L*ZeXG1IZG

Inputs are k, then n.
Try at MATL Online!
How it works
:         % Implicit input: k. Range: [1 2 ... k]
q         % Subtract 1, element-wise: [0 1 ... k-1]
G/        % Push k again; divide element-wise: [0 1/k ...(k-1)/k]
t         % Duplicate
i*        % Input: n. Multiply element-wise: gives [0 n/k ... n*(k-1)/k]
v         % Concatenate vertically: gives 2-row matrix [0 1   ... k-1;
          %                                             0 n/k ... n*(k-1)/k]
O         % Push 0
9W        % Push 9; exponential with base 2: gives 512
t         % Duplicate
:         % Range: gives [1 2 ... 512]
w         % Swap: moves copy of 512 to top
/         % Divide, element-wise: gives [1/512 2/512 ... 1]
h         % Concatenate: gives [0 1/512 2/512 ... 1]
,         % Do the following twice
  18L     %   Push 2*pi*j (predefined literal)
  *       %   Multiply, element-wise
  Ze      %   Exponential with base e, element-wise. Each imaginary number
          %   becomes a point in the unit circle
  XG      %   Plot. Since the input is complex, this plots in the complex
          %   plane. The first time this plots the 2-row matrix defining the
          %   lines, with each column of the matrix plotted separately. The
          %   second time it plots the 512-vector with points in the circle
  1IZG    %   Hold on. This causes the next plot to be added, instead of
          %   overwriting the previous one

There we go. :-)

Small Basic + Turtle, 390 bytes
A Script that takes input from the TextWindow and outputs to the GraphicsWindow Object
n=TextWindow.Read()
k=TextWindow.Read()
For i=0To 360
Turtle.Angle=i
Turtle.Move(2.618)
EndFor
r=150
c=2*Math.Pi/k
For i=0To k
Turtle.PenUp()
Turtle.MoveTo(470+r*Math.Cos(c*i),240+r*Math.Sin(c*i))
Turtle.PenDown()
Turtle.MoveTo(470+r*Math.Cos(c*i*n),240+r*Math.Sin(c*i*n))
EndFor
GraphicsWindow.DrawLine(f+f*Math.Cos(c*i),f+f*Math.Sin(c*i),f+f*Math.Cos(c*i*n),f+f*Math.Sin(c*i*n))
EndFor

Try it at SmallBasic.com! Requires IE/Silverlight
Ungolfed and Commented
n=TextWindow.Read()                                         ''  Take Input, n
k=TextWindow.Read()                                         ''  Take Input, k
For i=0To 360                                               ''  Draw a Circle of Radius 150
  Turtle.Angle=i                                            ''  By turning 1 degree
  Turtle.Move(2.618)                                        ''  And moving Pi*300/360 Units
EndFor                                                      ''  360 times
r=150                                                       ''  Hold Radius variable
c=2*Math.Pi/k                                               ''  Hold Rad Constant
For i=0To k                                                 ''  Iterate over i
  Turtle.PenUp()                                            ''  Stop Drawing
  Turtle.MoveTo(470+r*Math.Cos(c*i),240+r*Math.Sin(c*i))    ''  Move to Position i
  Turtle.PenDown()                                          ''  Start Drawing again
  Turtle.MoveTo(470+r*Math.Cos(c*i*n),240+r*Math.Sin(c*i*n))''  Move to Position (i*n)Mod k
EndFor                                                      ''  Loop

Output
Input 3,72

source: Stack Exchange

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

sort: votes


text:
Stacked digit staircases
Given positive integers \$w\$ and \$h\$ output \$w\$ columns and \$h\$ rows of text as described below.
The first row begins with 11 0s, the second row with 10 1s, third with nine 2s and so on down the the tenth row with two 9s. On each of these first ten rows, following the initial run of consecutive digits, the next lowest digit appears two times before the second next lowest digit appears two times, with this pattern repeating forever. If a run of 0s occurs, the digits after it are always 9s.
Rows below the tenth row are the same as the row immediately above it but shifted to the right by one. The new digit that appears is the same as the previous leftmost digit if it was not next to another instance of itself. Otherwise it is the next highest digit (cycling from 9 back to 0).
The first \$11\times10\$ elements are as follows:
00000000000
11111111110
22222222211
33333333221
44444443322
55555544332
66666554433
77776655443
88877665544
99887766554

Here is an image with colored text to make the pattern more clear.

If you need to produce fewer columns/rows then you should simply crop the above text.
If you need to produce more columns/rows than this, existing staircases should be extended. If more columns/rows adds new staircases of consecutive digits, digits should be cyclicly chosen from the integers. Thus for input \$(15,13)\$ the output should be
000000000009988
111111111100998
222222222110099
333333332211009
444444433221100
555555443322110
666665544332211
777766554433221
888776655443322
998877665544332
099887766554433
009988776655443
100998877665544

Here is an image of this text with color:

Rules

Output can be given by any convenient method.
Either a full program or a function are acceptable. If a function, you can return the output rather than printing it.
You can return a list of lines if you prefer.
You can return a 2D array of digits or list of lists of digits if you prefer.
Standard loopholes disallowed.

Shortest code wins.
Test cases
Input is taken as \$(w,h)\$ for the test cases.
1,1
0
3,2
000
111
20,1
00000000000998877665
11,10
00000000000
11111111110
22222222211
33333333221
44444443322
55555544332
66666554433
77776655443
88877665544
99887766554
15,13
000000000009988
111111111100998
222222222110099
333333332211009
444444433221100
555555443322110
666665544332211
777766554433221
888776655443322
998877665544332
099887766554433
009988776655443
100998877665544

I don't really understand the pattern.  Could you explain the pattern concretely rather than expecting it to be extrapolated from examples.  Some people find examples helpful but I don't really see exactly how the pattern follows from the examples.

@WW Thanks, I added a bit more thorough explanation  at the top

Interestingly now that we have TeX you can actually make the colored grid in text. Test: $\color{red}{1234}$

@qwr oh nice, didn’t know we could do that. What command did you do it with?

\color{red}{text} I believe

C (gcc), 101 100 99 bytes

Saved a byte thanks to pizzapants184.
Saved a byte.

s,t;a(i,r){for(t=~0;++t<r;puts(""))for(s=0;s<i;putchar(48+(t+(s>10-t)*(10*s+9-(s+++t-11)/2))%10));}

Try it online!

-1 byte Try it online! printf("%d", -> putchar(48+

@pizzapants184 Thanks a lot.

@ceilingcat Unfortunately no.

Python 3, 94 93 78 77 74 bytes
lambda x,y:[[[(j-i+10)//2%10,j][j+i<9]for i in range(x)]for j in range(y)]
-1 byte from dylnan
-15 bytes by returning a list of lists instead of printing from xnor
-1 byte by switching the order of the (j-i+10)//2%10 and j parts of the if-else
-3 bytes from Jo King by changing the if-else to a list.
Try it online!

Using a lambda function saves a byte: TIO

The challenge allows outputting lists of lists of digits, so it looks like you don't need to do any printing or joining.

Charcoal, 20 17 bytes
Ｅη⭆θ﹪⌊⟦ι÷⁺⁻ιλχ²⟧χ

Try it online! Link is to verbose version of code. Explanation:
 η                  Height
Ｅ                   Map over implicit range
   θ                Width
  ⭆                 Map over implicit range and join
          ⁻ιλ       Subtract column from row
         ⁺   χ      Add 10
        ÷     ²     Integer divide by 2
       ι            Current row
     ⌊⟦        ⟧    Take the minimum
    ﹪           χ   Modulo by 10
                    Implicitly print each row on its own line

Edit: Saved 3 bytes by switching to @dzaima's algorithm.

Jelly, 19 bytes
Uses a very similar approach to pizzapants' and Neil's. Saved 1 byte thanks to Jonathan Allan.
p’Ḣ_/HḞ+ʋS<9Ɗ?€5s%⁵

Try it online!

The helper link
_/HḞ+5

This is a monadic link (the Jelly equivalent of a single argument function), that can be invoked from the next link using the quick Ç. It takes a list of two integers and does the following on it:
_/

Reduce by subtraction.
HḞ+5%⁵

Floor its halve to an integer and add 5, then take it modulo 10.
The main link
p’ḢÇS<9Ɗ?€s

This is a dyadic link (the Jelly equivalent of a two-argument function), that can be invoked from the next link using the ç quick. It takes two integers \$x\$ and \$y\$ and performs the following:
p’

Cartesian product of their ranges, and then subtract \$1\$ from each integer in that list. It is equivalent to \$([0, x)\cap \mathbb{Z}) \times ([0, y)\cap \mathbb{Z})\$.
S<9Ɗ?€

And for each of the pair in the Cartesian product, if their sum is less than 9, then:
Ḣ

Retrieve the head of the pair (first element). Otherwise,
Ç

Call the helper link (explained above) on the pair.
s%⁵

Finally, split the resulting list into chunks of length \$y\$ and take each mod 10.

You can move the mod 10 to the end and then in-line the helper to save a byte -- either as a dyad with  p’Ḣ_/HḞ+ʋS<9Ɗ?€5s%⁵ or p’Ḣ_/:2+ʋS<9Ɗ?€5s%⁵, or as a monad with p’Ḣ_/:2+5ƲS<9Ɗ?€s%⁵

Canvas, 14 bytes
［⁷｛¹∔⁶＋»¹ｍ◂＠］］

Try it here!
While making this I noticed in several places I had negative modulos in Canvas (here, it meant that » - floor div 2 - rounded towards 0). The previous 18 byte answer that worked without fixes doesn't work anymore (because I only save main.js between versions) but TIO still has the old version
Explanation:
[            ]  for 1..input
 ⁷{         ]     for 1..2nd input
   ¹∔               subtract from this loop counter the outer loops one
     ⁶+             add 12
       »            divide by 2, rounded to -∞
        ¹m          minimum of that & the outer loops counter
          ◂@        in the string "0123456789", get the xth char, 1-indexed

Jelly, 14 bytes
_@þ:2+6«"J$’%⁵

A dyadic link taking \$w\$ on the left and \$h\$ on the right which yields a list of lists of digits.
Try it online! Or see a (post-formatted) test-suite.
How?
_@þ:2+6«"J$’%⁵ - Link: integer w, integer h
  þ            - outer product using (i.e. [[f(i,j) for i in 1..w] for j in 1..h]):
_@             -   subtraction with swapped arguments (i.e. f(i,j): j-i)
               -   e.g. the 4th row is [3, 2, 1, 0,-1,-2,-3,-4,-5,-6,-7,-8,-9,-10,-11,...]
   :2          - integer divide by two (vectorises)
               -                       [1, 1, 0, 0,-1,-1,-2,-2,-3,-3,-4,-4,-5,-5,-6,...]
     +6        - add six (vectorises)
               -                       [7, 7, 6, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 0,...]
          $    - last two links as a monad:
         J     -   range of length -> [1,2,3,...,h]
        "      -   zip with:
       «       -     minimum (vectorises)
               -                       [4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 2, 2, 1, 1, 0,...]
           ’   - decrement (vectorises)
               -                       [3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 1, 1, 0, 0,-1,...]
             ⁵ - literal ten
            %  - modulo (vectorises)
               -                       [3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 1, 1, 0, 0, 9,...]

Kotlin, 78 bytes
{w:Int,h:Int->List(h){r->List(w){c->if(c<11-r)r%10
else(r+9*((c-9+r)/2))%10}}}

Try it online!

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


text:
Intersection Point of Two Line Segments
Given two line segments, determine if the line segments intersect and if so, where. In the case that the two given line segments are co-linear and overlap, determine the midpoint of the overlapping segment. Lines will be specified in pairs of (x, y) coordinates.
Examples

[(-1, -1), (1, 1)], [(-1, 1), (1, -1)] => (0, 0)
[(-1, -1), (1, -1)], [(-1, 1), (1, 1)] => No intersection
[(-2, 0), (1, 1.32)], [(-1, 0.44), (2, 1.76)] => (0, 0.88)
[(-2, -2), (0, 0)], [(1, -1), (1, 1)] => No intersection

Rules

Standard rules and loopholes apply
Input and output may be in any convenient format. Please state your convention along with your solution.

Examples for output conventions would be null for no intersection and a point for an intersection; a boolean and a tuple; string output in (x, y) format or "no intersection"; x and y will be NaN for no intersection. Other conventions are allowed, but these may give you a good starting point.

A minimum of 2 decimal places (or equivalent) precision is required.
Final results should be accurate to within 0.01 when at a scale of -100 - +100. (32-bit floats will be more than accurate enough for this purpose)
This is code-golf, so shortest code wins.

Related: This is not a duplicate of 2D Collision Detection because it only concerns line-line tests and requires an intersection point for intersecting line segments. This is also not a duplicate of Intersection of Two Lines because this concerns line segments specified with two endpoints rather than functions.

Its only me or 3rd test case does not have intersection? Maybe I'm wrong

@LuisfelipeDejesusMunoz they coincide when x is between -1 and 1.

R, 95 bytes
function(m,a=c(1,3),r=range){plot(0,,"n",r(m[a,]),r(m[-a,]));segments(m[1,],m[2,],m[3,],m[4,])}

Try it online!
Here's a graphical solution as an appetizer while I'm working on a full-blown solution.
TIO link will not plot anything.

C (gcc -lm), 225 bytes
#define T 20000
#define N double
N sqrt(N);N D(a,b){N x=a%T-b%T,y=a/T-b/T;return sqrt(x*x+y*y);}F,L,P;f(a,b,c,d){F=L=-1;for(P=0;++P<T*T;L=(D(a,P)+D(P,b)-D(a,b)<0.001&&D(c,P)+D(P,d)-D(c,d)<0.001)?(F=(F<0?P:F)),P:L);a=(F+L)/2;}

Try it online!
Very slow. Input format is endpoints packed into ints as coordinate multiplied
by 100 (to an integer) and 10000 added to it (to a natural). Y coordinate is
multiplied by an additional 20000 to pack it next to X coordinate. No collision
is signaled by the point (-100.01,-100).
Thus the X coordinate of a point A is ((A%20000)-10000)/100.0 and the Y
coordinate is ((A/20000)-10000)/100.0.
Rationale
Thanks to the question providing no time limit and specifying a desired
precision accurately, a non-optimal solution can be used to reduce code size.
Thus instead of actually computing the collision points, then doing some
additional logic if the lines are coincident, this checks every single point of
the given precision and sees if it is a collision.
This collision check is much shorter (code-wise) than the collision computation.
In particular to check if a point collides with a line segment just check if the
distance to each endpoint adds up to the length of the segment. If a point
collides with both line segments individually, then it is a point where the line
segments intersect.
Using this strategy the code finds the endpoints of the collision and returns
their midpoint. Initially they are set to -1, so if there is no collision it
returns -1 (-1+-1/2) which when translated back is a number just out of range.
If there's only one collision point, it is stored in both endpoints, so it is
itself returned (x+x/2). Finally, if there is an overlap the overlap must be a
line, returning the average of the line's endpoints will yield the midpoint.
Algorithm
As such, the algorithm in pseudo-code would be:
collision (AB,CD):
    start and end = -1
    for each point P:
        if P is in both line segments AB and CD
            if start = -1, start = P
            end = P
    return (start+end)/2

is P in line segment AB:
    return distance(A,P) + distance(P,B) = distance(A,B)

Description
The annotated source is thus:
#define T 20000             // We use 20000 a lot
#define N double            // We use double a lot
N sqrt(N);                  // We need to prototype sqrt or it will be assumed to be int(int)
N D(a,b){                   // D defines the distance function
    N x=a%T-b%T,            // x is delta x
      y=a/T-b/T;            // y is delta y
    return sqrt(x*x+y*y);}  // standard distance formula: sqrt(dx^2+dy^2)
F,                          // F is the first point of collision
L,                          // L is the last point of collision
P;                          // P is the current test point
f(a,b,c,d){                 // f takes the 4 segment end-points
    F=L=-1;                 // Initialize both collision points to -1 (invalid)
    for(P=0;++P<T*T;        // Loop P over each point
    L=                      // Set the last collision point based on a ternary
    (D(a,P)+D(P,b)-D(a,b)   // We have to use an epsilon check due to floating point rounding errors
     <0.001                 // This accuracy is definitionally good enough
     &&                     // The previous check was for collision with AB
     D(c,P)+D(P,d)-D(c,d)   // now we have to check for collision with CD
     <0.001)?               // if both collide - we have a collision point!
      (F=(F<0?P:F)),        // if the first collision point isn't set, this is it
      P                     // set the last collision point no matter what
      :                     // they don't both collide, ignore this point
      L);                   // the expression is assigned to L, so keep L the same
    a=                      // return by assigning to the first argument
      (F+L)/2;}             // the average of the first and last points
                            // Luckily the packing of the points fits with enough space so we
                            // don't have to worry about averaging each coordinate separately

F=(F<0?P:F) => F=F<0?P:F for -2 bytes

172 bytes


text:
Drawing convex polyiamonds
Description
OEIS sequence A096004 gives the

Number of convex triangular polyominoes [polyiamonds] containing n cells.

It begins:
1, 1, 1, 2, 1, 2, 2, 3, 2, 2, 2, 3, 2, 3, 3, 5

For example, a(8)=3 with the following three convex polyiamonds:
Input: 8
Output:
  *---*---*---*---*
 / \ / \ / \ / \ /
*---*---*---*---*

    *---*---*
   / \ / \ /
  *---*---*
 / \ / \ /
*---*---*

    *---*
   / \ / \
  *---*---*
 / \ / \ / \
*---*---*---*

Requirements
The goal of this challenge is to write a program that takes in an integer n (in any reasonable format) and outputs ASCII art of all convex polyiamonds with n cells (in any orientation), with each polyiamond separated by two newlines.
Your program must be able to handle up to a(30) in under 60 seconds.

Scoring
This is a code-golf challenge, so fewest bytes wins.

A Wumpus answer to this one would be great!

60 seconds on which machine....

On whichever machine—I trust people to be reasonable.

And this will happen...

You should specify that the polyiamonds are considered the same under rotation and reflection.

I'd seriously consider removing the time restriction.  I don't see what it adds to the challenge other than ambiguity.

Charcoal, 89 bytes
ＮθＦ⊕θＦ⊕ιＦ⊕κＦ⊕λ¿∧¬‹ι⁺⁺κλμ⁼⁻×ιιθΣＥ⟦κλμ⟧×νν«⸿Ｇ↙⊕⊗μ↘⊕⊗⁻ι⁺κμ→⊕×⁴κ↗⊕⊗⁻ι⁺κλ↖⊕⊗λ“⌈∨¿ZH↖↖⸿T u≡9”Ｄ⎚

Try it online! Link is to verbose version of code. Thanks to @LevelRiverSt for explaining the OEIS formula. Explanation:
Ｎθ

Input n. (Using the OEIS formula names rather than the Charcol names here.)
Ｆ⊕θＦ⊕ιＦ⊕κＦ⊕λ

Loop p from 0 to n, d from 0 to p, c from 0 to d and b from 0 to c inclusive. This satisfies the condition b<=c<=d<=p.
¿∧¬‹ι⁺⁺κλμ⁼⁻×ιιθΣＥ⟦κλμ⟧×νν«

Check the other two conditions: b+c+d<=p and n=p*p-b*b-c*c-d*d. Sadly the power function doesn't vectorise yet otherwise that would save 2 bytes.
⸿

Leave a blank line between polyiamonds.
Ｇ↙⊕⊗μ↘⊕⊗⁻ι⁺κμ→⊕×⁴κ↗⊕⊗⁻ι⁺κλ↖⊕⊗λ“⌈∨¿ZH↖↖⸿T u≡9”

Draw the polyiamond. Five of the sides are calculated, and the sixth is inferred and the polygon filled using the compressed string / \ *--- \ / --*-, which results in the desired pattern. (The pattern doesn't start with *--- because the blank line causes the pattern to be offset.)
Ｄ⎚

Output and clear the canvas ready for the next polyiamond. This is quicker than positioning the cursor.

Vectorised power was added five months later: Try it online! Link is to verbose version of code.

Ruby, 202 bytes
->n{(r=[*0..n]).product(r,r,r).map{|i|p,b,c,d=i;b>c||c>d||b+c+d>p||p*p-b*b-c*c-d*d!=n||0.upto(p-d<<1){|j|s=" "*j+"*---\\ / "[j%2*4,4]*p*2;(k=b*4-j)>0&&s[0,k]=" "*k;puts s[0,[p*4+1-j,p*4+1-c*4+j].min]}}}

Try it online!
Uses formula per the OEIS sequence: search for solutions where n = p**2 - b**2 -c**2 - d**2.
n =the number of triangular tiles
p =the side length of a large equilateral triangle (pointing downwards)
b,c,d =the side length of three smaller equilateral triangles, which are removed from the corners of the large equilateral triangle to get the required shape.
Some additional conditions (per OEIS) are needed to avoid duplicates:
b<=c<=d and b+c+d<=p

Aha, I'd been staring at that OEIS formula wondering what it all meant...


text:
Is the matrix centrosymmetric... and so is the code?
Defintion
A centrosymmetric matrix is a square matrix that is symmetric about its center. More rigorously, a matrix \$A\$ of size \$n \times n\$ is centrosymmetric if, for any \$i,\: j \in ([1, n] \cap \mathbb{Z})\$ the following relation is satisfied:
$$A_{i,\:j}=A_{n+1-i,\:n+1-j}$$
Examples of such matrices
Here is an illustration of the symmetry of a matrices like these (borrowed from the aforementioned Wikipedia article):

An even-side-length (\$4\times 4\$) centrosymmetric matrix:
$$\left(\begin{matrix}
1 & 2 & 3 & 4 \\
5 & 6 & 7 & 8 \\
8 & 7 & 6 & 5 \\
4 & 3 & 2 & 1\end{matrix}\right)$$
And an odd-side-length (\$3\times 3\$) one:
$$\left(\begin{matrix}
1 & 2 & 3 \\
5 & 6 & 5 \\
3 & 2 & 1\end{matrix}\right)$$
Task and Specs
Given a square matrix of size at least \$2\$, output one of two distinct and consistent values, deciding whether the matrix is centrosymmetric or not. You can assume that the matrix will consist entirely of positive integers.
However, your code must also be centrosymmetric. That is, it must be a program / function (or equivalents) consisting of \$n\$ lines, each of which containing \$n\$ bytes in your language's encoding, and must satisfy the definition given above, but with bytes instead of positive integers. Your submission's score will be the value of \$n\$, with a lower \$n\$ being better.
You can take input and provide output through any standard method and in any reasonable format, while taking note that these loopholes are forbidden by default. You may (optionally) choose to take the size, \$n\$, as input too (unless you take input as a 1D list, in which case you may only take \$n^2\$ as additional input).
Test cases
Truthy:
[[1, 2], [2, 1]]
[[1, 2, 3], [5, 6, 5], [3, 2, 1]]
[[10, 5, 30], [2, 6, 2], [30, 5, 10]]
[[100, 100, 100], [100, 50, 100], [100, 100, 100]]
[[1, 2, 3, 4], [5, 6, 7, 8], [8, 7, 6, 5], [4, 3, 2, 1]]
[[3, 4, 5, 6, 7], [5, 6, 7, 8, 9], [3, 2, 10, 2, 3], [9, 8, 7, 6, 5], [7, 6, 5, 4, 3]]

Falsy:
[[1, 2], [1, 2]]
[[1, 2, 10], [5, 6, 5], [11, 2, 1]]
[[14, 5, 32], [2, 6, 2], [30, 5, 16]]
[[19, 19, 19], [40, 50, 4], [19, 19, 19]]
[[1, 2, 20, 4], [7, 6, 7, 8], [8, 7, 6, 6], [3, 3, 2, 1]]
[[3, 4, 5, 6, 7], [5, 6, 7, 8, 9], [4, 5, 10, 4, 5], [5, 6, 7, 8, 9], [3, 4, 5, 6, 7]]

Hmm, this still looks pretty hard for non-golfing languages because it breaks parentheses and brackets without comments. A naive approach would be to end each line with a comment character (like Python's #), so that the bottom half of the code would all be a comment.

@JungHwanMin In this particular case Python's # won't work because comments preceded by # are inline only :P

comment out half lines with doc strings """?

@Mr.Xcoder I mean something like acode#\nbcode#\nccode#\n#edocc\n#edocb\n#edoca.

Or even aco#de\nbco#de\ncco#de\ned#occ\ned#ocb\ned#oca.

Possible duplicate of I'm a palindrome. Are you?

It's basically the same question with the added task of flattening the input first.

I guess I'll just beg to differ, as the restrictions on the source change things quite a lot and the winning criterion is different. In my opinion, these differences suffice. Plus, the are other techniques (in many languages shorter ones - e.g. Mathematica) that can be used instead of flatten+palindrome check.

Our input is guarentted to be square, must our code?

@WW A centrosymmetric matrix is a square matrix and your code must be centrosymmetric, so yes, the code has to be square.

Why does a centrosymmetric matrix have to be square?  The definition works just as well without it.

@WW Because I chose to define it as such. For the purposes of this challenge, any centrosymmetric matrix must be square.

My question is why did you choose that?

@WW In short, to keep the challenge simple and avoid any kind of unwanted edge cases. Besides, keeping it square is more intuitive to me.

Keeping it square also has the added benefit of preventing one-liner palindromes.

I wonder how much harder/easier this challenge would be if the rotation was 90 degrees instead of 180.

JavaScript (ES6), size 12 11 9
All versions return false for centrosymmetric or true for non-centrosymmetric.

1-dimensional array + length, size 9 (89 bytes)
Takes input in currying syntax (length)(array), where array is 1-dimensional.
w=>a=> //
a.some //
(v=>v- //
a[--w])//
/////////
//)]w--[a
// -v>=v(
// emos.a
// >=a>=w

Try it online!

Matrix + width, size 11 (131 bytes)
Takes input in currying syntax (width)(matrix).
/**/w=>a=>a
.some(r=>r.
some(v=>v-a
[y][w-++x],
x=!y--),y=w
);'*/'/*';)
w=y,)--y!=x
,]x++-w[]y[
a-v>=v(emos
.r>=r(emos.
a>=a>=w/**/

Try it online!
Payload
w => a => a.some(r => r.some(v => v - a[y][w - ++x], x = !y--), y = w)

Container
/**/CODE;'*/'/*';EDOC/**/

Matrix only, size 12 (155 bytes)
This is my original solution, which computes the width of the matrix by itself.
/**/a=>a[w=a
.length-1,s=
'some']((r,y
)=>r[s]((v,x
)=>v-a[w-y][
w-x]))////*/
/*////))]x-w
[]y-w[a-v>=)
x,v((]s[r>=)
y,r((]'emos'
=s,1-htgnel.
a=w[a>=a/**/

Try it online!
How?
We need a few critical tokens that cannot be split:

some
length
)=>

Line-feeds may be inserted almost anywhere else.
The unrolled payload code reads as:
a => a[w = a.length - 1, s = 'some']((r, y) => r[s]((v, x) => v - a[w - y][w - x]))

and is wrapped inside the following structure:
/**/CODE////*/

which, once reversed, becomes a valid block comment:
/*////EDOC/**/

Jelly, score 2
⁼Ṛ
Ṛ⁼

Try it online!
Takes input as a flattened square matrix (vector of size \$n^2\$).

Befunge-93, size 24
   &:00p110p920p::*:v
vp01:+1g01-1pg02g01&_v#<
>00g`#v_>:           1$^
v2p011<  v:g00p029p01< @
>0g1+20p^>*:#v_1# .#<@ .
v+1g00gg02g01<$ >1+10pv0
>:10g-\88++20g -g-     |
vg02p011_v#`g00g01-1  <1
>1+20p   >:   ^ ^      <

<      ^ ^   :>   p02+1>
1<  1-10g00g`#v_110p20gv
|     -g- g02++88\-g01:>
0vp01+1> $<10g20gg00g1+v
. @<#. #1_v#:*>^p02+1g0>
@ <10p920p00g:v  <110p2v
^$1           :>_v#`g00>
<#v_&10g20gp1-10g1+:10pv
   v:*::p029p011p00:&

Try it online!
Input: n, followed by the elements of the array, all separated by spaces. NOTE: you may need to use a different interpreter if you have a large enough input.
I'm sure there's a better way to do this, I just wanted to try this in Befunge. The actual code portion is the top half.
How?
The code is divided into two main sections, the initialization and the verification.
Initialization:
   &:00p110p920p::*:v
vp01:+1g01-1pg02g01&_v#<
>00g`#v_>:           1$^

This section of the code writes the input matrix right below the code as ASCII characters. Both this and the next section use the three cells at the top left of the code as data. They are stored as n, i, j.
Verification:
                     v
                     1
v2p011<  v:g00p029p01< @
>0g1+20p^>*:#v_1# .#<@ .
v+1g00gg02g01<$ >1+10pv0
>:10g-\88++20g -g-     |
vg02p011_v#`g00g01-1  <1
>1+20p   >:   ^ ^      <

This sections checks every index \$i, j\$ [1-indexed] against the condition \$ A_{i, j} = A_{n+1-i, n+1-j} \$. However, we have a problem: we have \$j\$ offset by \$8\$. To fix that, the following formulae are used:
\$ i' = (n + 1) - i \$
\$ j' = n + 1 - (j - 8) + 8 = (n + 1) + (8 + 8) - j\$
The other portions of code are unread garbage to make it centrosymmetric.

Haskell, \$n = 8\$
No comments!
Takes input as a 1-D list
s a b=
    a/=b
f =s<*>
 reverse
esrever
 >*<s= f
b=/a
  =b a s

Try it online!
\$n= 10\$
Takes input as a 2-D matrix
r =reverse
s a b=a/=b
f   =s<*>r
c  =concat
g =  f<$>c
c>$<f  = g
tacnoc=  c
r>*<s=   f
b=/a=b a s
esrever= r

Try it online!
Thanks to potato44 for all their help in chat. And Lynn for golfing off a row.
Explanation
The general idea here is a simple one, we concat the list and compare it to it's reverse.  However since we want to be centrosymmetric we have to tread carefully.  First we write the code as we would normally:
g=((==)<*>reverse).concat

Now in order for our reverse lines to also be valid Haskell we need the left hand side of our equations to look like a function definition tacnoc.)esrever>*<)==(( doesn't.
The first step to fixing this is disposing of parentheses.
s a b=a==b
f=s<*>reverse
g=f.concat

However we have some new problems now.  Both . and == when reversed are the same, so our reversed lines attempt to redefine the operators (<*> reversed is >*< so we are fine on that front).  . can be replaced with <$> since functions are functors.  And we can replace == with /=, which negates our output, but that is still within the specs.  Now we have
s a b=a/=b
f=s<*>reverse
g=f<$>concat

In order to trim down our line length we alias concat and reverse.
r=reverse
s a b=a/=b
f=s<*>r
c=concat
g=f<$>c

Now we just finish this by making everything centrosymmetric and square.
The shorter 1-D version works in much the same way except since there is no need to concat we can save two lines by removing it.

How about this for n=10?

@Lynn Thanks!  In my head the reverse of <$> was also <$>.

Python 2, size 10 (109 bytes)
def f(a):#
 return(a#
==[r[::-1#
]for r in#
a[::-1]])#
#)]]1-::[a
#ni r rof]
#1-::[r[==
#a(nruter
#:)a(f fed

Try it online!
Previous Python 2, size 14 (209 bytes)
lambda a:all(#
a[i][j]==a[-i#
-1][-j-1]for #
i in range(  #
len(a))for j #
in range(len(#
a)))         #
#         )))a
#(nel(egnar ni
# j rof))a(nel
#  (egnar ni i
# rof]1-j-[]1-
#i-[a==]j[]i[a
#(lla:a adbmal

Try it online!

Not sure if it would be enough for a rearrangement but FYI -i-1 and -j-1 could simply be ~i and ~j

@Mr. Xcoder: I fiddled with that a bit, but it doesn't change the outcome.

Works in python3.6 too, but might not be optimal.

Pyth, size 6 (41 bytes)
q_M_QQ
q.q

   q.q
QQ_M_q

Try it here
Explanation
The first line reverses the input and each row, and checks if we're left with a copy of the input.
The .q in the second line exits the program, so everything after that, as well as the q before it, is a no-op.

APL (Dyalog Unicode), score 7 6 5 4
Full program. Prompts for matrix expression from stdin. Prints a 1 or a 0 and then throws a consistent error. No comments!
r←,⎕
r≡⌽r
r⌽≡r
⎕,←r

Try it online!
⎕ prompt for expression and evaluate it
, ravel (flatten) it
r← store the result in r (for ravelled)
⌽r mirror r
r≡ implicitly print whether r is identical to that
≡ depth of r (gives 1)
r⌽ use r to rotate that
 (this will always cause a RANK ERROR and quit because a matrix is not permitted as left argument to ⌽)

Perl 6, size 9 8 7
{.flat#
#}talf.
#  ],R[
eq # qe
[R,]  #
.flat}#
#talf.{

Try it online!
reverse is the bottleneck here. I've changed it to the technically longer, but much more splittable [*-1 X-^*]. Okay, I've changed it to [R,] after seeing Brad Gilbert's answer to another question.
The flattened code is {.flat eq [R,] .flat}.
Edit: Damn, I've realised I don't even need to flatten the first list, but attempts at shortening it to a size 6 have failed with just one byte too many to fit...
{@_#}_@
eq#<<|
[R,] #
# ],R[
|<<#qe
@_}#_@{

:(
Though if we take it as a one dimensional array, it's easy to fit it in a size 6.
{$_# }
eq #_$
[R,] #
# ],R[
$_# qe
} #_${

Try it online!

Wolfram Language (Mathematica) (REPL only), size 8 (71 bytes)
f=#[[c=-
1;;1;;-1
,c]]==#&
(*
      *(
&#==]]c,
1-;;1;;1
-=c[[#=f

Returns True for centrosymmetric input, and False otherwise.
On Mathematica REPL, lines with syntax errors are ignored (with a thick red bar appearing on the side of the screen). Here, only the first three lines, f=#[[c=-1;;1;;-1,c]]==#&, are executed.
This code captures the function in the name f.
Sadly, the built-in PalindromeQ is too long.

Japt, size 9 4 (11 bytes)
UªSê

êSªU

Try it online!
Takes one-dimensional input, checks if it is a palindrome. If you want, you can fill the two empty lines for some ascii art.
The old two-dimensional version, rotates the input twice and checks if it's equal to the original:
W=U  I
Wz2;II
Vc)eUc
cUe)cV
II;2zW
I  U=W

Try it online!

Nice! I think I have a 6 and I'm trying to beat an uncooperative 4 into submission too, but they're both much more trivial than this.

@Shaggy I managed to get the same solution down to six after giving it a fresh look, four would be very impressive.

Given that input can (now) be a 1 dimensional array, this can be done with a score of 2.

@Shaggy I'm not sure if I see how, the source must be NxN.

like so

@Shaggy Ah, nice, why not post it as an answer?

I might do later on if nobody else wants it. Trying to curtail my Japt postings during LoTM, but it's tough!

I believe a trivial modification can turn this into a 3...

Pyt, size 1
₽

Try it online!
Checks if the input (in the form of concatenated rows) is a palindrome.

._. well, this isn't centrosymmetric according to the challenge: $ n>=2 $, but nice job.

By my understanding the $n \geq 2$ is a constraint on the input, not on the definition of a centrosymmetric matrix.

Whoops, forgot that.

Husk, size 3
Ṡ=↔
=↔=
↔=Ṡ

Try it online! Input as 1D-List. Each line defines a function, but only the one on the first line is called.
Ṡ=↔ is a palindrome tests which checks whether the input equals (=) its reverse (↔).

Husk, size 4
Ṡ=↔Σ
Σ↔=Ṡ
Ṡ=↔Σ
Σ↔=Ṡ

Try it online! For input as 2D-matrix, we concatenate (Σ) the list of lists before checking that it is a palindrome.

MATL, score 4
t,!P
]=%?
?%=]
P!,t

Input has the format [1 2; 2 1], using ; as row separator.
Output is via STDERR (allowed by default):

For centrosymmetric input a consistent error error is produced. With the current Linux and Octave versions in TIO the following STDERR output is produced (disregarding the final lines that start with Real time: ...):
octave: X11 DISPLAY environment variable not set
octave: disabling GUI features
Python 2.7.15 (default, May 16 2018, 17:50:09)
[GCC 8.1.1 20180502 (Red Hat 8.1.1-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> >>> /usr/include/c++/8/bits/basic_string.h:1048: std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator[](std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::reference = char&; std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]: Assertion '__pos <= size()' failed.
panic: Aborted -- stopping myself...

The error may be different depending on the Linux and Octave versions, but will be consistent across inputs.
For non-centrosymmetric input no error is produced, and the STDERR output on TIO is
octave: X11 DISPLAY environment variable not set
octave: disabling GUI features
Python 2.7.15 (default, May 16 2018, 17:50:09)
[GCC 8.1.1 20180502 (Red Hat 8.1.1-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> >>>

Try it online! Or verify all test cases:

Centrosymmetric: 1, 2, 3, 4, 5, 6.
Non-centrosymmetric: 1, 2, 3, 4, 5, 6.

Check that the program is centrosymmetric.
Explanation
% is the comment symbol, which causes the rest of the line o be ignored. Newlines are also ignored. So the code is just
t,!P]=?P!,t

which does the following:
t       % Input, implicit. Duplicate
,       % Do twice
  !     %   Transpose
  P     %   Flip vertically
]       % End
=       % Compare element-wise
?       % If all comparisons gave true
  P     %   Implicit input. Transpose. Actually, since there is no more input, an
        %   error is prand the program exits. The rest of the code is not executed,
        %   and will be described in parentheses
  !     %   (Transpose)
  ,     %   (Do twice)
    t   %     (Duplicate)
        %   (End, implicit)
        % (End, implicit)

Haskell, size 11, 10, 9, 8
Takes the input as a 2D list! (Credit to Ørjan Johansen)
r= --r}-
 reverse
(==)<*>
 r.map{-
-{pam.r
 >*<)==(
esrever
-}r-- =r

Bugs: Second <*> should be >*<. In the 2D one, there's a missing - and the reversed part doesn't have the spaces in the right places.

Got the 2D one down to 8

R, size 9
   #)x-))
#(nacs-<x
#(ver(yna
#       #
#       #
#       #
any(rev(#
x<-scan(#
))-x)#

Try it online!
The last three lines are the actual program that takes a 1D array as input and checks if it's equal to its reverse. Truthy value: FALSE, Falsy value: TRUE.
any(rev(x<-scan())-x)

R + pryr, size 9
pryr::f(#
any(rev(#
x)-x))#

  #))x-)x
#(ver(yna
#(f::ryrp

Try it online!

Ruby, score 9 8
->z{z==#
z.######
reverse#
}#######
#######}
#esrever
######.z
#==z{z>-

Try it online!
A lambda taking a flattened matrix as input. Returns true for centrosymmetric, false otherwise.
-1 thanks to Mr.XCoder,
Unpacked:
->z{
  z == z.reverse
}

C# (.NET Core), score 13 11 10
l=>a=>a.//
Where((e//
,i)=>e!=//
a[l-i-1]//
).Any()///
///()ynA.)
//]1-i-l[a
//=!e>=)i,
//e((erehW
//.a>=a>=l

Try it online!
Takes input as 1D array and n2 as length; returns false for centrosymmetric and true for non-centrosymmetric. This version uses System.Linq but I don't know how to fit it in the code submission due to the particular requirements of the challenge. Unrolled code:
l => a => a.Where((e,i) => e != a[l-i-1]).Any()

Following is my previous submission that does not use LINQ:
C# (.NET Core), score 16 15 13
l=>a=>{/////*
var r=1<2;for
(int i=0;i<l;
)r&=a[i]==a[l
-i++-1];
return r;}
     /*/
   };r nruter
     ;]1-++i-
l[a==]i[a=&r)
;l<i;0=i tni(
rof;2<1=r rav
*/////{>=a>=l

Try it online!
Unrolled code:
l => a =>
{
    var r = 1<2;
    for (int i = 0; i < l;)
        r &= a[i] == a[l-i++-1];
    return r;
}

If you change int to var (thus also tni to rav), the second submission also works in JavaScript.

Python 2, size 8
i=input#
a=i()###
a[::-1##
]!=a<_##
##_<a=!]
##1-::[a
###)(i=a
#tupni=i

Try it online!
Takes input as a 1D list of concatenated rows (of length \$n^2\$) and outputs via exit code (0 for symmetric inputs, 1 otherwise).
The list is simply checked to be a palindrome. If it is, the comparison chain a[::-1]!=a<_ fails at the != step and short-circuits; otherwise the unknown variable _ gets evaluated, crashing the program.

Clean, size 9
Thanks to Ørjan Johansen!
import //
 StdEnv//
r=reverse
?m=m==r//
    m
//r==m=m?
esrever=r
//vnEdtS
// tropmi

Try it online!
Clean, size 10
import/*//
*/StdEnv//
r =reverse
?m      //
 =m==r m//
//m r==m=
//      m?
esrever= r
//vnEdtS/*
//*/tropmi

Try it online!

It's not because of newline, it works with indent. 9 lines

@ØrjanJohansen Can't believe I forgot you could indent them. Thanks!

You're welcome, and I edited the middle line after I posted, it just needs to be m.

@ØrjanJohansen I've updated the answer to reflect that. It looks really elegant that way as well.

05AB1E, size 3 (11 bytes)
ÂQq

qQÂ

Input as a single list.
Try it online.
I guess this one doesn't count.. ;p
ÂQ
qâ

Input as a single list.
Try it online.
Explanation:
Â         # Bifurcate this list (short for DR: Duplicate & Reverse copy)
 Q        # Check if the input-list and the reversed list are equal
  q       # Terminate the program
   qQâ    # No-ops

Some size 3 (11 bytes) alternatives:
R€R
QqQ
R€R

Matrix as input.
Try it online.
RQ
 q
 QR

Single list as input.
Try it online.

><>, Size 6
!/l2(\
s\?\ ?
/{=/ ;
: /={/
? \?\s
\(2l/!

Try it online!
(It turns out it's a pain passing multiple value to -v in tio)
Input is taken as a one dimensional array as the initial stack state with -v. Exits with no output if the matrix is centrosymmetric, exits with an error (prints "Something smells fishy...") if not.
l2(    Checks if the length of the stack is less than 2
?;     Exits cleanly if so

{=     Checks if the first and last elements are equal
?\s    Causes an error ('s' is not a valid instruction) if not

I wasn't entirely happy with this output format, so here's a size 7 one which outputs 1 for true, and 0 for false.
!/l2(\\
 ?   ?0
 =;n1/n
;{   {;
n/1n;=
0?   ?
\\(2l/!

Try it online!

Nice job! ><> can be a fun language to work with, unless it's a complex program, then it's a pain.

if you swap the truthy and falsey values you can get it down to 4 with {-?;

Japt, size 2 (5 bytes)
ê"
"ê

Try it

C (gcc), score 11
Takes a list of int and n as arguments. Returns n as truthy value, 0 as falsy.
/*//};n=l;k
--*==++l*=*
n);l>k;n*n+
l=k(rof{;l*
tni)n,l(f;k
*/*/////*/*
k;f(l,n)int
*l;{for(k=l
+n*n;k>l;)n
*=*l++==*--
k;l=n;}//*/

Try it online!

C (gcc), 12 x 12
C(e,n,t,r)//
int*e;{for//
(r=t=0;e[t//
];r|=e[t]^//
e[~t+++n])//
;n=!!!!r;}//
//};r!!!!=n;
//)]n+++t~[e
//^]t[e=|r;]
//t[e;0=t=r(
//rof{;e*tni
//)r,t,n,e(C

Try it online!

Stax, n = 3
$cr
=q=
rc$

Run and debug it
Explanation:
$cr =q= rc$ Full program, implicit input
$           Flatten
 cr         Copy and reverse
    =       Compare to original
     q      Print result
      =     Silently error because there is only one item on stack
        rc$ Not executed

3 is the best possible because I need at least three commands: Copy,
reverse, and compare
Stax, n = 4
Mrxr
M=qX
Xq=M
rxrM

Run and debug it
Explanation:
Mrxr M=qX Xq=M rxrM Full program, implicit input
Mr                  Transpose and reverse
  x                 Push input again
   r M              Reverse and transpose
      =             Compare
       qX Xq        Print result twice and save to X
            =       Silently error because there is only one item on stack
             M rxrM Not executed

Java 10, size 13 (181 bytes)
a->{var r///*
=1>0;for(int
l=a.length,i=
0;i<l;)r&=a[i
]==a[l-++i];
return r;}
     /*/
   };r nruter
 ;]i++-l[a==]
i[a=&r);l<i;0
=i,htgnel.a=l
 tni(rof;0>1=
*///r rav{>-a

Try it online.
Inspired by @Charlie's C# answer.
Golfed explanation:
a->{var r=1>0;for(int l=a.length,i=0;i<l;)r&=a[i]==a[l-++i];return r;}

a->{                    //  Method with byte-array parameter and boolean return-type
  var r=1>0;            //  Result-boolean, starting at true
  for(int l=a.length,   //  The length of the input-array
      i=0;i<l;)         //  Loop `i` in the range [0, length)
    r&=                 //   Bitwise-AND the result-boolean with:
       a[i]             //    Whether the current item
           ==a[l-++i];  //    equals the opposite item
  return r;}            //  Return the result

Javascript ES6, size 8:
/***/a=>
""+a==a.
reverse(
)/////*/
/*/////)
(esrever
.a==a+""
>=a/***/

Javascript ES6, size 7 (is it valid?):
a=>""+a
==a.//=
reverse
`     `
esrever
=//.a==
a+"">=a

Test:

<script>
f=

a=>""+a
==a.//=
reverse
`     `
esrever
=//.a==
a+"">=a
</script>

<script>
console.log([
  [1, 2, 2, 1],
  [1, 2, 3, 5, 6, 5, 3, 2, 1],
  [10, 5, 30, 2, 6, 2, 30, 5, 10],
  [100, 100, 100, 100, 50, 100, 100, 100, 100],
  [1, 2, 3, 4, 5, 6, 7, 8, 8, 7, 6, 5, 4, 3, 2, 1],
  [3, 4, 5, 6, 7, 5, 6, 7, 8, 9, 3, 2, 10, 2, 3, 9, 8, 7, 6, 5, 7, 6, 5, 4, 3],
].every(f))

console.log([
  [1, 2, 1, 2],
  [1, 2, 10, 5, 6, 5, 11, 2, 1],
  [14, 5, 32, 2, 6, 2, 30, 5, 16],
  [19, 19, 19, 40, 50, 4, 19, 19, 19],
  [1, 2, 20, 4, 7, 6, 7, 8, 8, 7, 6, 6, 3, 3, 2, 1],
  [3, 4, 5, 6, 7, 5, 6, 7, 8, 9, 4, 5, 10, 4, 5, 5, 6, 7, 8, 9, 3, 4, 5, 6, 7],
].every(x=>!f(x)))
</script>

or with lambda saved to variable named a:

a=

a=>""+a
==a.//=
reverse
`     `
esrever
=//.a==
a+"">=a

console.log([
  [1, 2, 2, 1],
  [1, 2, 3, 5, 6, 5, 3, 2, 1],
  [10, 5, 30, 2, 6, 2, 30, 5, 10],
  [100, 100, 100, 100, 50, 100, 100, 100, 100],
  [1, 2, 3, 4, 5, 6, 7, 8, 8, 7, 6, 5, 4, 3, 2, 1],
  [3, 4, 5, 6, 7, 5, 6, 7, 8, 9, 3, 2, 10, 2, 3, 9, 8, 7, 6, 5, 7, 6, 5, 4, 3],
].every(a))

console.log([
  [1, 2, 1, 2],
  [1, 2, 10, 5, 6, 5, 11, 2, 1],
  [14, 5, 32, 2, 6, 2, 30, 5, 16],
  [19, 19, 19, 40, 50, 4, 19, 19, 19],
  [1, 2, 20, 4, 7, 6, 7, 8, 8, 7, 6, 6, 3, 3, 2, 1],
  [3, 4, 5, 6, 7, 5, 6, 7, 8, 9, 4, 5, 10, 4, 5, 5, 6, 7, 8, 9, 3, 4, 5, 6, 7],
].every(x=>!a(x)))

Clojure, Size 9
#(= %(;;;
reverse;;
(map;;;;;
reverse;;
%)));)))%
;;esrever
;;;;;pam(
;;esrever
;;;(% =(#

Try it online!


text:
Exact Partial Sum of Harmonic Series
Challenge
Given a positive integer N, output the sum of the first N reciprocals as an exact fraction, which is represented as a pair of integers in a consistent order representing numerator and denominator.
Rules

Output must be exact.
Output should be as a pair of integers in a consistent order representing numerator and denominator.
Using non-integer numeric types (built-in or library) is forbidden.

Clarification/exception: non-integer numeric types are okay if and only if all values used, computed, and returned are integers (i.e. your language uses rational numbers by default, but you only use integer arithmetic in your answer)

Output should be as reduced as possible. (3/2 is okay, 6/4 is not)
Standard loopholes are forbidden.
Submissions should work for inputs at least up to 20, or this meta, whichever is higher.

Test Cases
1: 1/1
2: 3/2 (1/1 + 1/2)
3: 11/6 (1/1 + 1/2 + 1/3)
4: 25/12 etc.
5: 137/60
6: 49/20
20: 55835135/15519504
56: 252476961434436524654789/54749786241679275146400
226: 31741146384418617995319820836410246588253008380307063166243468230254437801429301078323028997161/5290225078451893176693594241665890914638817631063334447389979640757204083936351078274058192000

Test-Case Generation (Python 3)
import fractions
def f(x):
    return sum(fractions.Fraction(1,i) for i in range(1,x+1))

Similar to this challenge and this challenge.
Numerators are OEIS A001008, and denominators are OEIS A002805.

Sandbox post (deleted)

related

Is gcd a "built-in function" if your language provides it?

@ChasBrown gcd and other built-in functions are fine. Rational/fractional types are not allowed.

support range?.

Can the returned pair of integers be fractional types? My Perl 6 answer only deals with integers, but the default type for numbers is Rat (a fractional type)

@JoKing That's fine if the numbers are rational type as long as only integers are used. I'll update the question.

@user202729 for the range: at least 20, and this meta

@user202729 numerical errors are not allowed (i.e. the first input value that gives incorrect output values is considered to be outside your answer 's range)

Is the output for 20 shown here wrong? I get 55835135 and assumed my output was wrong, until I saw the top python answer also returns the same thing.

@sundar Fixed (it is 55835135, not 55835125)

Yes, that's the value I mentioned in my comment, but you've edited in the wrong value again in the question. Now the numerator says 55825135, while it should say 55835135 (two 3's, no 2's).

Jelly, 10 bytes
!:RS,!:g/$

Try it online!
How it works
!:RS,!:g/$  Main link. Argument: n

!           Compute n!.
  R         Range; yield [1, ..., n].
 :          Divide n! by each k in [1, ..., n].
   S        Take the sum. Let's call it s.
     !      Compute n! again.
    ,       Pair; yield [s, n!].
      :g/$  Divide [s, n!] by their GCD.

Python 2, 80 79 bytes
D=1;N=n=0;exec"n+=1;y=N=N*n+D;x=D=D*n;"*input()
while y:x,y=y,x%y
print N/x,D/x

Try it online!
Prints the numerator and denominator.
Yay! MathJax support!!!! One observes:
$$\sum_{i=1}^{n} \frac{1}{i} = \sum_{i=1}^{n} \frac{n!}{n!i} = \frac{\sum_{i=1}^{n} \frac{n!}{i}}{n!}$$
Then, thinking about recursion, for \$n\$ positive, in the Numerator:
$$\sum_{i=1}^{n+1} \frac{(n+1)!}{i} = (n+1) \sum_{i=1}^{n} \frac{n!}{i} + \frac{(n+1)!}{n+1} = (n+1) \sum_{i=1}^{n} \frac{n!}{i} + n!$$
and one can't help think of the Denominator \$n!\$ recursively as well; thus the exec.
We must pay the Reduced Fraction Piper with a GCD calculation in the while loop; and then we're done.

J, 16 bytes
!(,%+.)1#.!%1+i.

Try it online!
Run examples
f =: !(,%+.)1#.!%1+i.
f 6x
   20 49
f 20x
   15519504 55835135
f 56x
   54749786241679275146400 252476961434436524654789

How it works
!(,%+.)1#.!%1+i.    NB. Tacit verb
            1+i.    NB. 1 to n inclusive
          !%        NB. Divide factorial by 1 to n
       1#.          NB. Sum i.e. numerator (not reduced)
!                   NB. Factorial i.e. denominator (not reduced)
 (,%+.)             NB. Divide both by GCD

J, 9 bytes, using fraction type
1#.1%1+i.

Try it online!
J gives fractions for int-int division if not divisible.

Only if one of the parameters are bigint.

You can use wrapper like this

Would 2 x:1#.1%1+i. count as a valid answer, or is this an invalid use of a rational type?

05AB1E, 10 bytes
!DIL÷O)D¿÷

Try it online!
Uses the same method as all other entries. Output is in the form [denominator, numerator].
!DIL÷O)D¿÷   Full program. Let's call the input I.
!D           Push the factorial twice to the stack. STACK: [I!, I!]
  IL         Range from 1 to I. STACK: [I!, I!, [1 ... I]]
    ÷        Vectorized integer division. STACK: [I!, [I! / 1, I! / 2, ..., I! / I]]
     O       Sum. STACK: [I!, I! / 1 + I! / 2 + ... + I! / I]
      )      Wrap stack. STACK: [[I!, I! / 1 + I! / 2 + ... + I! / I]]
       D     Duplicate. STACK: [[I!, I! / 1 + ... + I! / I], [I!, I! / 1 +... + I! / I]]
        ¿    GCD. STACK: [[I!, I! / 1 + ... + I! / I], gcd(I!, I! / 1 +... + I! / I)]
         ÷   Vectorized integer division.

Wolfram Language (Mathematica), 30 bytes
#/GCD@@#&@{Tr[#!/Range@#],#!}&

Try it online!

14 bytes if built-in fractional types are allowed
HarmonicNumber

Try it online!

InputForm@HarmonicNumber (24 bytes) gives output in the format given by OP.

Perl 6, 57 53 bytes
{+($!=[*] 1..$_)/($!=($/=sum $! X/1..$_)gcd$!),$//$!}

Try it online!
An anonymous code block that takes an integer and returns a tuple of denominator, numerator.
If we were allowed to use fractional types, it would be the much simpler 32 byter:
{sum(map 1/*.FatRat,1..$_).nude}

Try it online!

JavaScript (ES6), 60 bytes
Returns [numerator, denominator].
f=(n,a=0,b=1)=>n?f(n-1,p=a*n+b,q=b*n):b?f(0,b,a%b):[p/a,q/a]

Try it online!
How?
The method is similar to @ChasBrown's Python answer.
We first compute the unreduced numerator \$a\$ and unreduced denominator \$b\$ by starting with \$a=0\$ and \$b=1\$ and recursively doing:
$$a\gets an+b\\
b\gets bn\\
n\gets n-1$$
until \$n=0\$.
We save \$(a,b)\$ into \$(p,q)\$ and then compute \$a\gets \gcd(a,b)\$ with:
$$a\gets b\\
b\gets a \bmod b$$
until \$b=0\$.
We finally return the reduced numerator \$p/a\$ and reduced denominator \$q/a\$.

Stax, 11 bytes
ó╢Δ'åç4}ú┌7

Run and debug it
Explanation:
We want to calculate:
$$\sum_{i=1}^n{\frac 1 i}$$
We now need a denominator \$b\$ and a list of numerators \$a_i\$:
$$\sum_{i=1}^n{\frac{a_i}b}=\frac{\sum_{i=1}^n{a_i}}{b}$$
We can make \$b=n!\$, then we have:
\begin{align}
  \frac{a_i}{n!}&=\frac 1 i&|\times n! \\
  a_i&=\frac{n!}i
\end{align}
So we have:
$$\sum_{i=1}^n{\frac 1 n}=\frac{\sum_{i=1}^n{\frac{n!}i}}{n!}$$
|Fx{[/m|+L:_m Full program
|F            Factorial
  x           Push input again
   {  m       Map over range [1, n]
    [           Copy the factorial
     /          Divide factorial by current value
       |+     Sum
         L    Listify stack, top gets first element
          :_  Divide both values by gcd
            m Print each followed by newline

Pari/GP, 34 bytes
n->l=[sum(i=1,n,n!/i),n!];l/gcd(l)

Try it online!

17 bytes if built-in fractional types are allowed
n->sum(i=1,n,1/i)

Try it online!

Octave, 29 bytes
@(n)sym(sprintf('+1/%i',1:n))

Try it online!

C++17 (gcc), 108 bytes
Only use integer arithmetic:
#import<random>
int f(int x,long&n,long&d){n=0;d=1;int
a;while(n=n*x+d,d*=x,a=std::gcd(n,d),n/=a,d/=a,--x);}

Try it online!

C++17 (gcc), 108 bytes
#import<random>
int f(long&n){double a=0;long
d=1;while(d*=n,a+=1./n,--n);n=a*d+.5;n/=a=std::gcd(n,d);d/=a;}

Try it online!
Same as below, but use C++17's std::gcd.

C++ (gcc), 109 bytes
#import<regex>
int f(long&n){double a=0;long
d=1;while(d*=n,a+=1./n,--n);n=a*d+.5;n/=a=std::__gcd(n,d);d/=a;}

Try it online!
Because C++ doesn't have native bigint support, this will definitely overflow for n>20.
Require:

gcc's deprecated import statement.
gcc's std::__gcd.
-O0 (I think so) otherwise the compiler will optimize out d/=a.
At least 64-bit long.

Explanation:

Let \$d=n!, a=H_n\$.
Round a*d to nearest integer by casting a*d+.5 to long, and assign to n. Now n/d is the output.
Simplify the fraction with std::__gcd.

Can't you use auto a=0. instead of double a=0 (1 char less)?

Yes he can. And one more byte from the loop: 106 bytes

MATL, 13 bytes
:tptb/sht&Zd/

Try it on MATL Online
Same method as used in @Dennis' Jelly answer.
:t    % Range from 1 to n, duplicate.
pt    % Take the product of that (= factorial), duplicate that too.
b/    % Bring the range to top of stack, divide factorial by each element
sh    % Sum those. Concatenate factorial and this into a single array.
t&Zd/ % Compute GCD of those and divide the concatenated array elements by the GCD.

(Implicit output, prints denominator first and then the numerator.)
Floating point inaccuracies mean this doesn't work for n = 20, because the intermediate values are too large. Looks like the test case output was a typo, this returns the same answer as the other answers for n=20.
Here's an integer type-preserving version (25 bytes) I tried in the meantime, before finding this out:
25 bytes, input upto 43
O1i:3Y%"t@*b@*b+wht&Zd/Z}

Try it online!
Casts the numbers to uint64 before operating on them, does the arithmetic explicitly in a loop (without using prod or sum). More importantly, divides the partial numerators and denominators by their GCD every step along the way, at the end of each iteration. This increases the input range to allow n upto 43. Part of the code is based on @Chas Brown's Python answer.
Alternate (original) method using LCM instead of factorial:
16 15 bytes
:t&Zmtb/sht&Zd/

Try it on MATL Online

APL (Dyalog Unicode), 15 12 bytes
⌽!(,÷∨)1⊥!÷⍳

Try it online!
Tacit function, taking a single argument ⍵. Saves a byte by removing the ⌽ if we're allowed to print the denominator first.
Thanks @dzaima for 3 bytes.
How:
⌽!(,÷∨)1⊥!÷⍳ ⍝ Tacit function, argument will be called ⍵.
           ⍳ ⍝ Range 1..⍵
          ÷  ⍝ Dividing
         !   ⍝ the factorial of ⍵
       1⊥    ⍝ Base-1 decode, aka sum;
 !(   )      ⍝ Using that sum and the factorial of ⍵ as arguments, fork:
     ∨       ⍝ (GCD
    ÷        ⍝ dividing
   ,         ⍝ the vector with both arguments)
⌽            ⍝ reversed.

dc, 87 bytes
?sn1dsNsD[lndlDdlNln*+sN*sD1-dsn1<M]sMln1<MlDsAlNsB[lAlB%sTlBsAlTsBlB0<G]dsGxlDlA/lNlA/

Try it online!
This leaves the numerator and denominator on top of the stack in that order, as allowed by this output default. Since dc does not have a gcd built-in, this utilizes the Euclidean algorithm to calculate the gcd.

Excel VBA, 141 bytes
Takes input from [A1] and outputs to the console.
s="=If(Row()>A$1,":[B:B]=s+"1,Row())":l=[LCM(B:B)]:[C:C]=s &"0,"&l &"/B1)":g=[GCD(LCM(B:B),SUM(C:C))]:?Format([Sum(C:C)]/g,0)"/"Format(l/g,0)

Ungolfed and Commented
Sub HarmonicSum(n)
    [A1] = n                            ''  Pipe input
    s = "=IF(ROW()>A$1,"                ''  Hold the start of formulas
    [B1:B40] = s + "1,ROW())"           ''  Get series of numbers 1 to N, trailing 1s
    l = [LCM(B1:B40)]                   ''  Get LCM
    [C1:C40] = s & "0," & l & "/B1)"    ''  Get LCM/M for M in 1 to N
    g = [GCD(LCM(B1:B40),SUM(C1:C40))]  ''  Get GCD
                                        ''  Format and print output
    Debug.Print Format([Sum(C1:C40)] / g, 0); "\"; Format(l / g, 0)
End Sub

APL(NARS), 56 chars, 112 bytes
{⍵=1:⊂1 1⋄{(r s)←⍺⋄(i j)←⍵⋄m÷∨/m←((r×j)+s×i),s×j}/1,¨⍳⍵}

test:
  f←{⍵=1:⊂1 1⋄{(r s)←⍺⋄(i j)←⍵⋄m÷∨/m←((r×j)+s×i),s×j}/1,¨⍳⍵}
  f 1
1 1
  f 2
3 2
  f 3
11 6
  f 20
55835135 15519504

In few words reduce "sum function on 2 fraction numbers" (one fraction number is a list 2 integers) on the set:
1 2, 1 3,..., 1 n

this below seems wrong:
 f 56
74359641471727289 16124934538402170

but if i change the type of input than:
  f 56x
252476961434436524654789 54749786241679275146400
  f 226x
31741146384418617995319820836410246588253008380307063166243468230254437801429301078323028997161 529022507845189
  3176693594241665890914638817631063334447389979640757204083936351078274058192000

Pyt, 14 bytes
Đ!⇹ř/Đ↑⇹ƩáĐÁǤ/

Try it online!
Outputs [denominator, numerator].
Đ                 implicit input; Đuplicate
 !                factorial
  ⇹               swap top two on stack
   ř              řangify
    /             divide
     Đ↑           Đuplicate; get max
       ⇹          swap top two on stack
        Ʃ         Ʃum
         á        push stack to árray
          Đ       Đuplicate
           Á      push contents of Árray to stack
            Ǥ     get ǤCD
             /    divide; implicit print