text:
Rotate matrix rows according to the row above
Specifications
For this challenge, you will be given a matrix of some sort in any reasonable format for a 2-D array. For each row except the last, in order from top (first) to bottom (last), rotate the row below it by x to either direction (you choose a consistent direction to use) where x is the first element in the current row.
Reference
A reference implementation in Python can be found here
Example
Let's walk through an example. Take the following matrix for example:
1 5 8
4 7 2
3 9 6

Let's say we're rotating right. First we rotate [4 7 2] to the right by 1 because the first element of [1 5 8] is 1. Thus, we get [2 4 7] as the second row. The matrix is now like this:
1 5 8
2 4 7
3 9 6

Then, we rotate [3 9 6] to the right by 2 because the first element of the second row is 2. Thus we get:
1 5 8
2 4 7
9 6 3

Challenge
Implement the above
Test Cases
Test cases are given as a list of lists in Python style.
Input -> Output
[[6, 7, 10, 1, 10, 7], [7, 3, 7, 8, 9, 2], [6, 8, 3, 9, 3, 1], [6, 3, 8, 6, 4, 1], [7, 5, 2, 9, 7, 2], [2, 10, 9, 9, 7, 9], [8, 8, 10, 10, 8, 4]] -> [[6, 7, 10, 1, 10, 7], [7, 3, 7, 8, 9, 2], [1, 6, 8, 3, 9, 3], [1, 6, 3, 8, 6, 4], [2, 7, 5, 2, 9, 7], [7, 9, 2, 10, 9, 9], [4, 8, 8, 10, 10, 8]]
[[8, 10, 4, 3, 9, 4, 6], [8, 8, 8, 8, 6, 7, 5], [6, 2, 2, 4, 8, 9, 6], [1, 7, 9, 9, 10, 7, 8]] -> [[8, 10, 4, 3, 9, 4, 6], [5, 8, 8, 8, 8, 6, 7], [2, 4, 8, 9, 6, 6, 2], [7, 8, 1, 7, 9, 9, 10]]
[[6, 2, 4, 4, 4], [5, 9, 10, 5, 4], [3, 5, 7, 2, 2], [1, 5, 5, 10, 10], [8, 2, 3, 2, 1], [3, 3, 9, 5, 10], [9, 5, 9, 7, 2]] -> [[6, 2, 4, 4, 4], [4, 5, 9, 10, 5], [5, 7, 2, 2, 3], [1, 5, 5, 10, 10], [1, 8, 2, 3, 2], [10, 3, 3, 9, 5], [9, 5, 9, 7, 2]]
[[3, 6, 3, 7, 4], [8, 8, 1, 5, 8], [7, 5, 1, 9, 4], [3, 9, 10, 8, 6]] -> [[3, 6, 3, 7, 4], [1, 5, 8, 8, 8], [4, 7, 5, 1, 9], [9, 10, 8, 6, 3]]
[[5, 6, 1, 2, 6], [1, 10, 10, 1, 4], [6, 2, 7, 1, 7], [9, 5, 8, 6, 3], [4, 5, 1, 2, 1], [8, 6, 1, 1, 3]] -> [[5, 6, 1, 2, 6], [1, 10, 10, 1, 4], [7, 6, 2, 7, 1], [6, 3, 9, 5, 8], [1, 4, 5, 1, 2], [3, 8, 6, 1, 1]]
[[10, 1, 2], [9, 9, 10], [2, 4, 7]] -> [[10, 1, 2], [10, 9, 9], [7, 2, 4]]
[[4, 5, 6], [6, 9, 4], [9, 3, 2], [3, 5, 9], [5, 5, 3], [9, 1, 4]] -> [[4, 5, 6], [4, 6, 9], [2, 9, 3], [5, 9, 3], [5, 3, 5], [1, 4, 9]]
[[8, 7, 6, 5], [9, 8, 6, 6], [7, 9, 7, 10]] -> [[8, 7, 6, 5], [9, 8, 6, 6], [10, 7, 9, 7]]
[[10, 2, 8, 8, 1], [2, 10, 1, 4, 10], [3, 2, 5, 3, 8], [5, 1, 8, 1, 8], [6, 1, 3, 1, 2], [7, 9, 1, 1, 2]] -> [[10, 2, 8, 8, 1], [2, 10, 1, 4, 10], [3, 8, 3, 2, 5], [8, 1, 8, 5, 1], [3, 1, 2, 6, 1], [1, 1, 2, 7, 9]]
[[9, 1, 3, 2, 7], [3, 8, 10, 3, 3], [8, 10, 7, 9, 5], [8, 1, 4, 9, 9], [6, 8, 4, 10, 10], [4, 7, 6, 2, 2], [8, 5, 3, 7, 6]] -> [[9, 1, 3, 2, 7], [8, 10, 3, 3, 3], [7, 9, 5, 8, 10], [9, 9, 8, 1, 4], [8, 4, 10, 10, 6], [6, 2, 2, 4, 7], [6, 8, 5, 3, 7]]

Generate more testcases here

we rotate [4 7 2] to the right by 1 ... we get [2 7 4]  Wait, what? Shouldn't it be [2 4 7]? Or am I misunderstanding "rotation"?

For each row except the last Shouldn't that be except the first?

@icrieverytim rotate the row below it technically this is inconsistent with my title but eh

@icrieverytim no you're right, i'm just being dumb whoops. prolly should've used my program

Are we guaranteed that the matrix is positive integers and that the matrix has at least two rows?

Exactly what I was about to ask, @Giuseppe.

Since x can be larger than the length of the row below (according to the test cases), what exactly is [2, 5, 8] rotated by 4? The second test case says it's [2, 5, 8] which doesn't make a lot of sense to me...

The reference implementation is broken, the rotate method currently concatenates two slices to yield the same as array whatever the amount is. I think this fixes it.

@JonathanAllan Yup that seems to fix it, thanks

@Giuseppe Yup, you can

@Shaggy ^^^^^^^

@icrieverytim I'll fix that; I need to do % which I forgot

Husk, 4 bytes
G(ṙ←

Try it online!
Rotates rows to the left.
Explanation
G in Husk is scanl (or cumulative reduce from left, as some languages call it). When given a function of type x->x->x (like in this case) it can use as starting value the first element of the list.
( is needed here to combine the following two functions into a single one.
ṙ is "rotate to the left" and takes a number and a list as arguments.
← returns the first element of a list.

Jelly, 6 5 bytes
ṙ@Ḣð\

Try it online!
Rotates to the left.
Saved a byte thanks to @Jonathan Allan.
Explanation
ṙ@Ḣð\  Input: array of arrays M
   ð\  Cumulative reduce over each array using
ṙ@       Rotate the RHS array using each in the LHS array
  Ḣ      Head

You can dump the €

@JonathanAllan Thanks. Isn't ɓ supposed to work here, as in ṙḢɓ\.

Ah, that actually may require a code change to reduce_cumulative; it would make sense to do so...

C++, 187 149 bytes

38 bytes thanks to Karl Napf

Output is done by the reference type parameter
The parameter's type have to be a std::vector<std::vector<int>> type
auto r=[](auto&a){for(int i=1,j,v;i<a.size();++i){v=a[i-1][0]%a[i].size();for(j=0;j<v;++j){a[i].insert(a[i].begin(),a[i].back());a[i].pop_back();}}};

Trying to do as #define A a[i] and replacing all occurences of a[i] by A will result with same byte count code
Code to help for the test :
//Shift operator overload
std::ostream& operator<<(std::ostream& os, std::vector<std::vector<int>>& v) {
    os << "{\n";
    for (auto&a : v) {
        os << "\t{ ";
        for (auto&b : a) {
            os << b << ' ';
        }
        os << "},\n";
    }
    return os << "}\n";
}

And in the main function
std::vector<std::vector<int>> t{
    {1,5,8},
    {4,7,2},
    {3,9,6}
};

std::cout << t;

r(t);

std::cout << t;

You can drop the #include and std::vector<... declarations by using an unnamed generic lambda [](auto&a){...} and demanding the input to be like vector<vector<int>> as I did in my challenges, e.g. https://codegolf.stackexchange.com/questions/100205/do-matrix-multiplication/100241#100241

141 bytes

Haskell, 84 59 45 bytes
Shifts to the left (now using Leo's approach):
scanl1(\a r->(drop<>take$a!!0`mod`length r)r)

Try it online!

59 bytes: Try it online!

@Laikoni: Damn that's so much nicer and saves a whole lot of bytes, thanks a lot!

Python 2, 65 bytes
l=input();K=0
for i in l:g=-K%len(i);e=i[g:]+i[:g];print e;K=e[0]

Try it online!
Python 2, 55 bytes (possibly broken)
If this version is found to fail for some test cases, I can assure you the above works. I am currently half-asleep, so feel free to remove this version in case it is invalid by editing.
l=input();K=0
for i in l:e=i[-K:]+i[:-K];print e;K=e[0]

Try it online!

You need to add modulo somewhere in there. The rotation numbers are sometimes longer than the lengths.

@icrieverytim I think it's fixed

...Actually, the test cases don't reflect that, which is in turn because the reference implementation doesn't use modulo. I'll ask OP whether it's needed.

05AB1E, 9 bytes
vyNFÁ}=нƒ

Try it online!
vy        # For each row:
  NFÁ}    #   Rotate this row N times (initially 0)
      =   #   Print without popping
       н  #   Get the head
        ƒ #   Assign that to N

Perl 5, 41 + 1 (-a) = 42 bytes
push@F,shift@F for 1..$r;say"@F";$r=$F[0]

Try it online!
Rotates to the left.  Takes the input as lines of space separated integers.
How?
Remove an element from the left end of the list, put it on the right end as many times as we should rotate ($r).  Since $r starts at undef (equivaltent to 0 in this usage), nothing happens to the first line.  Output the list.  Save the first element of the list in $r so we can rotate that many times on the next line.

Pyth, 11 bytes
VQ=ZhJ.>NZJ

Try it here!
Explanation

VQ - For each list in the matrix input:

=Z - Assign Z to the value of the below statement. Its initial value is 0, so that helps us with the first row.

h - The first element of ...

J.>NZ - ... The current list, cyclically rotated by Z places, and assigned to a variable J.

J - Print J.

R, 77 bytes
function(B){for(i in 2:nrow(B))B[i,]=rep(B[i,],sum(B))[1:ncol(B)+B[i-1,1]]
B}

Try it online!
Rotates rows to the right.
Replicates each row of B sum(B) times (creating a huge vector), then grabs the appropriate values from that replicated vector to put into the correct row.
I also wrote a function in the header that converts from the python matrix format to R matrices.

APL (Dyalog), 14 bytes
Anonymous tacit prefix function. Takes list of lists as argument and prints rows on separate lines with the numbers in each row separated by single spaces. Rotates left (although the explanation mentions how rotate right).
{⎕←⍺⌽⍨⊃⍵}/0,⍨⌽

Try it online!
⌽ reverse the argument (because reduction is right-to-left)
0,⍨ append a zero (for initial rotation of zero steps)
{…}/ reduce by the following anonymous lambda, where ⍺ is the element on the left and ⍵ on the right (the reduction goes right-to-left
 ⊃ pick the first of the right argument
 ⍺⌽⍨ rotate the left argument to the left* that many steps
 ⎕← output to STDOUT with a trailing line-break

* To rotate right, insert a - to the right of ⍨. This will negate the rotation amount.


text:
Output the Trinity Hall Prime
Based on this Math.SE question; number copied from this answer. Number originally from a Numberphile video, of course.
Your task is to output the following 1350-digit prime number:
888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888111111111111111111111111888888111111111111111111111111888888111111811111111118111111888888111118811111111118811111888888111188811111111118881111888888111188811111111118881111888888111888811111111118888111888888111888881111111188888111888888111888888111111888888111888888111888888888888888888111888888111888888888888888888111888888111888888888888888888111888888811188888888888888881118888188811188888888888888881118881188881118888888888888811188881118888111888888888888111888811111888811118888888811118888111111188881111111111111188881111111118888111111111111888811111111111888811111111118888111111111111188881111111188881111111111111118888811118888811111111111111111888881188888111111111111111111118888888811111111111111111111111888888111111111111111111111111118811111111111111111111111111111111111111111111062100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001

You may optionally include newlines in the output.
Rules

This is kolmogorov-complexity, so no input.
Your program must terminate within one hour on a standard computer - if it is close, I will use mine for testing. If your program runs for more than minute, or does not terminate on TIO, please include the time on your computer.
This is code-golf, so shortest code, in bytes, wins.

"number originally from a numberphile video" i think it's originally from professor mckee :P

What about this prime?

Jelly, 74 71 69 68 66 bytes
“©ạ-3ṗÇñ"ỤḍV8żṢ?ḤsMVE[,Ṃƭ"ḞÇsẇʂ(ụFsẠʂẆŀṣ’ḃ19ĖŒṙị⁾81s30m0Z062 ȷ446‘

Try it online!
How it works
The literal “©ạ-3ṗÇñ"ỤḍV8żṢ?ḤsMVE[,Ṃƭ"ḞÇsẇʂ(ụFsẠʂẆŀṣ’ replaces all characters with their code points in Jelly's code page and interprets the result as a (bijective) base-250 number, yielding the following integer.
103877200905186099028820568168804302565394743652609510039112658230540917082292838565138059974

Then, ḃ19 converts this number to bijective base 19, yielding the following digit array.
16,14,18,12,19,11,3,12,5,10,3,14,4,9,3,15,4,8,3,6,6,4,4,7,3,4,10,3,4,6,3,3,12,3,4,5,3,2,14,3,4,4,3,7,9,4,3,4,3,8,9,4,3,3,3,9,8,4,4,2,3,9,8,5,3,2,3,9,8,6,3,1

Now, ĖŒṙ enumerates the digits and performs run-length decoding, yielding the following array.
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,7,7,7,8,8,8,8,8,8,8,8,8,8,8,8,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,11,11,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,13,13,13,14,14,14,14,14,14,14,14,14,15,15,15,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,18,18,18,18,19,19,19,20,20,20,20,20,20,21,21,21,21,21,21,22,22,22,22,23,23,23,23,24,24,24,24,24,24,24,25,25,25,26,26,26,26,27,27,27,27,27,27,27,27,27,27,28,28,28,29,29,29,29,30,30,30,30,30,30,31,31,31,32,32,32,33,33,33,33,33,33,33,33,33,33,33,33,34,34,34,35,35,35,35,36,36,36,36,36,37,37,37,38,38,39,39,39,39,39,39,39,39,39,39,39,39,39,39,40,40,40,41,41,41,41,42,42,42,42,43,43,43,44,44,44,44,44,44,44,45,45,45,45,45,45,45,45,45,46,46,46,46,47,47,47,48,48,48,48,49,49,49,50,50,50,50,50,50,50,50,51,51,51,51,51,51,51,51,51,52,52,52,52,53,53,53,54,54,54,55,55,55,56,56,56,56,56,56,56,56,56,57,57,57,57,57,57,57,57,58,58,58,58,59,59,59,59,60,60,61,61,61,62,62,62,62,62,62,62,62,62,63,63,63,63,63,63,63,63,64,64,64,64,64,65,65,65,66,66,67,67,67,68,68,68,68,68,68,68,68,68,69,69,69,69,69,69,69,69,70,70,70,70,70,70,71,71,71,72

Then, ị⁾81 indexes into the string 81, replacing odd numbers with the character 8, even number with the character 1. Afterwards, s30 splits the result into chunks of length 30. Displaying one chunk per line, the result looks as follows.
888888888888888811111111111111
888888888888888888111111111111
888888888888888888811111111111
888111111111111888881111111111
888111111111111118888111111111
888111111111111111888811111111
888111111888888111188881111111
888111188888888881118888111111
888111888888888888111888811111
888118888888888888811188881111
888111111188888888811118881111
888111111118888888881111888111
888111111111888888881111888811
888111111111888888881111188811
888111111111888888881111118881

Now, m0 concatenates the array of chunks with a reversed copy of itself. Afterwards, Z zips the result, transposing rows and columns.
888888888888888888888888888888
888888888888888888888888888888
888888888888888888888888888888
888111111111111111111111111888
888111111111111111111111111888
888111111811111111118111111888
888111118811111111118811111888
888111188811111111118881111888
888111188811111111118881111888
888111888811111111118888111888
888111888881111111188888111888
888111888888111111888888111888
888111888888888888888888111888
888111888888888888888888111888
888111888888888888888888111888
888811188888888888888881118888
188811188888888888888881118881
188881118888888888888811188881
118888111888888888888111888811
111888811118888888811118888111
111188881111111111111188881111
111118888111111111111888811111
111111888811111111118888111111
111111188881111111188881111111
111111118888811118888811111111
111111111888881188888111111111
111111111118888888811111111111
111111111111888888111111111111
111111111111118811111111111111
111111111111111111111111111111

0 is an unparsable nilad, so the result from before is printed (without line breaks) and the return value is set to 0.
62 is another unparsable nilad, so the result from before (0) is printed and the return value is set to 62.
ȷ446 is yet another unparsable nilad. 62 is printed and the return value is set to 10446.
Finally, ‘ increments the result. The final result (10446 + 1) is printed when the program finishes.

ooo cool please add an explanation :D

@HyperNeutrino based on the output (but with my complete lack of Jelly knowledge), there's some mirroring going on or something like that

@Stephen Well I mean first it's some fancy number and then conversion into "bijective base something" (whatever that means, I'll go figure that out), and then enumerate, and then run-length, and then index into [8, 1]... Oh, that's smart! I'm stealing this trick I hope you don't mind :))) and then yeah add all that weird 06210..01 stuff. nice :)

@HyperNeutrino Added an explanation.

Up voted for the "graphics" alone. This is pretty sweet, wish I understood Jelly :)

SOGL V0.12, 81 78 75 73 bytes
$!╚Qαūπōθ(└↓Υ8Π⁶!√|ΠΚψ░⅜Υ‛⁷>∙↓ts3]δεΧ‰“8«─'½Κ81¹¹I⌡_¹◄ø∑'¹n╬³0621"η“⌡01⁰∑

Try it Here!
Explanation:
...“                 push a big number of the RLE lengths of the top part
    8«─              convert from base 10 to base 16 (15 was the max length, and making it base 15 wasn't worth it)
       '½Κ           prepend to the array 48
          81¹        push [8, 1]
             ¹       wrap those two in an array
              I      rotate clockwise, resulting in [[8, 48], [1, 2], [8, 9], [1, 12], ...]
               ⌡_¹   flatten (iterate over, splat current items contents on stack, collect the contents in an array)
                  ◄  run-length decode

ø∑                   join as a string
  '¹n                split into lines of length 15
     ╬³              palindromize horizontally with no overlap
       0621          push 0, 6, 2, and 1
           "η“       push 445
              ⌡      that many times do
               0       push 0
                1    push 1
                 ⁰∑  join the stack together in a string

Jelly, 136 bytes
“ßṪṭAƭẠvµM⁾ṖOḥ⁻Ɠ×Ṣ~*pṭẒFỵṿ¦4ÇḟọLÑOcKɲ⁶2*Ḣɲ’b45;@€1ẋ/€ø“Œ\⁴rrNỊġ:,xƙŒ#ṠƲQçḷĠ%&⁻ɼiḂŀB<Ȧƈg(Ṇb>TḥḄ|ḃṘƬ#l7ƇØṃ’b94;@€8ẋ/€ðżF;0;6;2;1;0ẋ445¤;1Ḍ

Try it online!
Explanation (numbers shortened)
“ßṪṭ...*Ḣɲ’b45;@€1ẋ/€ø“Œ\⁴...ƇØṃ’b94;@€8ẋ/€ðżF;0;6;2;1;0ẋ445¤;1Ḍ  Main link
“ßṪṭ...*Ḣɲ’b45;@€1ẋ/€                                             Run-length encoded 1s
“ßṪṭ...*Ḣɲ’                                                      The base-45 encoding of the list of the run-lengths of 1s
           b45                                                    in base 45
                €                                                 For each element
              ;@                                                  prepend
                 1                                                1
                    €                                             For each sublist
                   /                                              Reduce over
                  ẋ                                               Repeat list (this gets a bunch of lists of 1s)
                     ø“Œ\⁴...ƇØṃ’b94;@€8ẋ/€                       Run-length encoded 8s
                      “Œ\⁴...ƇØṃ’                                 The base-94 encoding of the list of the run-lengths of 8s
                                 b94                              in base 94
                                      €                           For each element
                                    ;@                            prepend
                                       8                          8
                                          €                       For each sublist
                                         /                        Reduce over
                                        ẋ                         Repeat list (this gets a bunch of lists of 8s)
                                           ðżF;0;6;2;1;0ẋ445¤;1Ḍ  With both of the previous lists of lists, construct the final string
                                            ż                     Interleave them
                                             F                    Flatten it
                                              ;0                  Append 0
                                                ;6                Append 6
                                                  ;2              Append 2
                                                    ;1            Append 1
                                                      ;           Append
                                                       0ẋ445¤     (Nilad)
                                                       0          0
                                                        ẋ445      445 times
                                                             ;1   Append 1
                                                               Ḍ  Convert decimal digits to a number

-121 bytes thanks to Dennis using “...’ literals instead of normal numbers

“...’ literals save a bunch of bytes. https://tio.run/##Nc5NSwJBHAbwDyOFSJArY28jUR289CJBR0@GRLKH8BAFEbsaGb0c2qAUAjcxg1AQyZrZlYIdd8iP8cwX2aag0//h4YHfv1Q0zeMoUtajaIK/gvdWZQ@eexgMN5X9CX6fA3tWti/vxAN46zRxoDfwnCz8IfhX0CGiBtaEf7MhbnO765OBst9TCbCWTlajQNJ0RVW6BryrWX0F01To5JX9Vi5vwb8cPy3NHMlG6MTAXTnYFi9gH2N3alqbk9E@WCW01jLfHXmxFwc/Lyzv6H/Azk7AquB12Y2Z87Im6uDVX26R/HEL/1w/HGVpks7RFDVoUreEpIM2NcCuo@gH

@Dennis Oh geez that is even more unreadable. Beautiful! Thanks! :D

0;6;2;1; seems awfully wordy.

@MagicOctopusUrn Yeah I could probably shorten it quite a bit; I'll look into that sometime :P

Jelly,  133 84  73 bytes
“÷iþṃL7[ḲʂƘⱮ=ƬƤ¬`RẹŀẹY÷n£ị€ıø&ḟ"gPƲ_ÇḊṪ’b⁴48;ĖŒṙḂ×7‘s15m€0F;“¡©£¢‘Ḍ×ȷ446‘

Try it online! (footer formats the decimal number with the dimensions that yield the coat of arms).
How?
A run-length encoded form of a binary format of the left-side of the coat of arms' 8s and 1 up to the row before the one starting 0621 reflected with the 0621 added and then multiplied up by 10446 and incremented.
“...’b⁴48;ĖŒṙḂ×7‘s15m€0F;“¡©£¢‘Ḍ×ȷ446‘ - Link: no arguments
“...’                                  - base 250 number
     b⁴                                - to base 16
       48;                             - prepend a 48
          Ė                            - enumerate [[1,48],[2,12],[3,3],[4,12],[5,3],...
           Œṙ                          - run-length decode (48 1s then 12 2s then ...)
             Ḃ                         - modulo by 2 (vectorises) evens->0 odds->1
              ×7                       - multiply by 7 (vectorises)
                ‘                      - increment (vectorises) - now all 8s and 1s
                 s15                   - split into chunks of length 15
                    m€0                - reflect each chunk
                       F               - flatten
                         “¡©£¢‘        - code-page indices = [0,6,2,1]
                        ;              - concatenate
                               Ḍ       - from decimal list to number
                                 ȷ446  - 10^446
                                ×      - multiply
                                     ‘ - increment

Charcoal, 107 104 98 96 87 79 bytes
Ｅ³⁰✂”}∧Pt→8⌕ＬＪε`‽∨↑¬KαfＧⅉKＭκ⎆wp◧⪫⊘^≦#⁸¹"π✂×OγX‹nI”×ι¹⁵×⊕ι¹⁵‖ＣＭ²⁸←621Ｍ²⁵¦¹⁴1ＵＢ0

Try it online! Link to verbose code for explanation

Proton, 368 bytes
s=(map("8"&(*),[93,6,6,1,1,6,2,2,6,3,3,6,3,3,6,4,4,6,5,5,6,6,6,6,18,6,18,6,18,7,16,4,3,16,3,4,14,4,4,12,4,4,8,4,4,4,4,4,4,4,4,4,5,5,5,5,8,6,2]),map("1"&(*),[24,24,6,10,6,5,10,5,4,10,4,4,10,4,3,10,3,3,8,3,3,6,3,3,3,3,3,3,3,3,3,1,3,3,2,3,3,3,3,3,5,4,4,7,14,9,12,11,10,13,8,15,4,17,2,20,23,26,44]))
q=''.join(s[0][i]+s[1][i]for i:0..len(s[0]))
print(q+'0621'+'0'*445+'1')

Try it online!

Python 2, 760 523 329 205 196 bytes
-237 bytes thanks to Stephen. -124 bytes thanks to Jonathan Frech.
print''.join((ord(j)-34)*'81'[i%2]for i,j in enumerate(":(:((#,#(('$,$'(&%,%&(&%,%&(%&,&%(%'*'%(%(((%(%4%(%4%(%4%)%2%&#%%2%%$&%0%&%&%.%&'&&*&&)&0&+&.&-&,&/&*&1'&'3'$'6*9(<$N"))+'0621'+'0'*445+'1'

Try it online!

526 bytes by declaring variables for 8 and 1 and combining 621

Oh. XD I just automated it, so I didn't see the 621. Thanks!

205 bytes by compressing the list. A few more if you only want to use printable bytes.

Ruby, 180 bytes
s=0;"".unpack('H*')[0].split(?f).map{|a|a.chars.map{|c|s^=2**c.to_i(16)};t=("%015b"%s).gsub ?0,?8;$><<t+t.reverse};puts'0621'+?0*445+?1

Try it online!
178 bytes + 2 bytes for -Kn (forces ASCII encoding.)
43 mostly unprintable characters in between the first quotes. Hexdump:
00000000: 733d 300a 22ff f012 3456 789a bff5 f6f7  s=0."...4Vx.....
00000010: ff8f 4f3f 012f ff8b fef7 af69 df45 8cf0  ..O?./.....i.E..
00000020: 1237 bf6a f59f 48f2 37f1 6f04 5f3f 12f0  .7.j..H.7.o._?..
00000030: 222e 756e 7061 636b 2827 482a 2729 5b30  ".unpack('H*')[0
00000040: 5d2e 7370 6c69 7428 3f66 292e 6d61 707b  ].split(?f).map{
00000050: 7c61 7c61 2e63 6861 7273 2e6d 6170 7b7c  |a|a.chars.map{|
00000060: 637c 735e 3d32 2a2a 632e 746f 5f69 2831  c|s^=2**c.to_i(1
00000070: 3629 7d3b 743d 2822 2530 3135 6222 2573  6)};t=("%015b"%s
00000080: 292e 6773 7562 203f 302c 3f38 3b24 3e3c  ).gsub ?0,?8;$><
00000090: 3c74 2b74 2e72 6576 6572 7365 7d0a 7075  <t+t.reverse}.pu
000000a0: 7473 2730 3632 3127 2b3f 302a 3434 352b  ts'0621'+?0*445+
000000b0: 3f31                                     ?1

How?
Everyone else was doing run length encoding, so I wanted to try something different.
The formatted "picture" version of the prime can be separated into two parts - a 30x30 grid of 8's and 1's, and a second section of mostly zeros which can be hardcoded. Focusing on the first part, we observe that it's symmetrical down the center, so if we can produce the left half then we can just print half of each line with its reverse.
Half of one line is 15 characters long. If we replace the 8's with zeros, each line can be interpreted as a 15-bit binary number. Conveniently, for the most part the edit distance between each consecutive line is small, so I decided to implement my solution by storing the first line s (888888888888888, which just becomes 0) and applying a series of bit flipping operations on s, printing the result each time.
Since each line is 15 bits long, I encoded these operations as hexadecimal digits - for example, if the operation is b (or 11), then we flip bit 11. Some lines differ by more than one bit, so they require a string of hexadecimal digits. We have one bit left over (f) so we can use it as a delimiter between these strings, and also as a "do nothing" value. Example below (you can see these lines in the post referenced in the question):
Line 3: 000000000000000
Line 4: 000111111111111  <-- flip bits 0 through b
Line 5: 000111111111111  <-- do nothing
Line 6: 000111111011111  <-- flip bit 5

To put that all together, we would encode 0123456789ab, then separate with f, do nothing with f, then 5. This works because we're going to do .split(?f) later to get each set of operations by line, which will yield ["0123456789ab", "", "5"], and "" will be a no-op.
The difference between lines 3 and 4 above is by far the longest set of edits, and the edit distance between any two consecutive lines is usually 0-2, so I would say that this encoding is reasonably inexpensive, although I'm sure it can be improved.
The entire encoded string ends up being fff0123456789abff5f6f7ff8f4f3f012fff8bfef7af69df458cf01237bf6af59f48f237f16f045f3f12f0 (86 bytes), which will get the entire 30x30 grid. But we're not done yet...
Hexadecimal digits can be represented by 4 bits (b -> 1100, etc.) That means that if we're willing to encode our string 4 bits at a time rather than using bytes, we can cut the length of the string in half. So that's what I did - the hexdump shows the string represented in 43 bytes. After that, it's just a matter of using Ruby's nifty String#unpack with H* (interpret as hex string, high nibble first) to expand the 43-byte string into the 86-byte version we know and love, and looping over each set of operations flipping bits - for our stored string s and an operation c we do s ^ 2**c.to_i(16) to flip the corresponding bit.
After each set of edits is completed, we pad the resulting binary to 15 bits, switch all of the 0's back to 8's, and print the result and its reverse. As noted before, the part of the number after the 30x30 grid can be hardcoded, so we do that as puts'0621'+?0*445+?1.
The final encoded string has no possibility of working on TIO, so the TIO version uses escapes, which still works but is longer.

CJam, 532 412 340 231 210 209 bytes
".$MBZp&8OIoLs7Rv/BEqN#1r~E$O%6^UO=\z:(Iw]l\LQ.g.aWf+{2;on|YP'y$:Lc$i$GMCg&mRs#y0*z`Z,C|Hf6;b/o-0|FNK5R:OIi}{'`CJ}LOXMSA,&vzl5scm5y0{om=A_#/wF"'#fm92bs:A;"6NLkB)h%@{u`hp_v+YK"'#fm92bYb2f+{[A/(\s:A;)]}%e~'0445*1
Try it Online
Run-length encoding expanded from base 92 (Base 250 led to multibyte chars so had to adjust). Also, 4341089843357287864910309744850519376 is expanded from base 92 and converted to binary. A 1 means the run-length is two digits, 0 means it's one digit. For example, the first 4 digits of the binary representation are 1101 because the first four runs are [93,8],[24,1],[6,8],[24,1] (93 8's, 24 1's, etc...)

JavaScript, 454 450 332 207 204 bytes
-4 bytes thanks to Stephen. -125 bytes thanks to Shaggy and Dom Hastings.
_=>[...`]

,`].map((j,i)=>'81'[i%2].repeat(j.charCodeAt())).join``+0+621+"0".repeat(445)+1

There's a boatload of unprintables in this answer, so here's a hexdump:
00000000: 5f3d 3e5b 2e2e 2e60 5d18 0618 0606 010a  _=>[...`].......
00000010: 0106 0605 020a 0205 0604 030a 0304 0604  ................
00000020: 030a 0304 0603 040a 0403 0603 0508 0503  ................
00000030: 0603 0606 0603 0603 1203 0603 1203 0603  ................
00000040: 1203 0703 1003 0401 0303 1003 0302 0403  ................
00000050: 0e03 0403 0403 0c03 0405 0404 0804 0407  ................
00000060: 040e 0409 040c 040b 040a 040a 0408 040f  ................
00000070: 0504 0511 0502 0514 0817 061a 022c 605d  .............,`]
00000080: 2e6d 6170 2828 6a2c 6929 3d3e 2738 3127  .map((j,i)=>'81'
00000090: 5b69 2532 5d2e 7265 7065 6174 286a 2e63  [i%2].repeat(j.c
000000a0: 6861 7243 6f64 6541 7428 2929 292e 6a6f  harCodeAt())).jo
000000b0: 696e 6060 2b30 2b36 3231 2b22 3022 2e72  in``+0+621+"0".r
000000c0: 6570 6561 7428 3434 3529 2b31            epeat(445)+1

f=
_=>[...`]

,`].map((j,i)=>'81'[i%2].repeat(j.charCodeAt())).join``+0+621+"0".repeat(445)+1

document.write(f())

I believe returning the value from a function would be valid.

Oh, right thanks. Could you please also do the HTML part? :P I seriously don't know a lot of this, I just picked JS because of the neat regex replace. EDIT: Thanks. :D

You can negate the quotes around the last +'1' as it's already a String and +'0621' can be +0+621!

326 bytes - I though it might have been a bigger saving :(

Or 324 bytes by incorporating @DomHasting's suggestion.

225 bytes (Sorry, forgot to include the _=> in the previous 2)

222 bytes - Last one, I promise!

OK, fine, just one more! 207 bytes

[...`] makes me so mad

Hang on, Dom only saved you 3 of those 125 bytes! ;D

Only just seeing your latest version; now that our solutions are so similar and given that mine was largely derived from golfing yours down, I'm happy to delete mine so you can incorporate it here. I'd been toying with the idea of using the string you're now using all day but, as I was on my phone for most of it, I couldn't verify it would work (even though I knew it would!). By my count, dropping this string into my solution should give you 194 bytes. Oh, and you'll need to change the character before the last 1 in my string to codepoint 445, too.

I've now updated my solution to that 194 byte version. Ping me if you use it so I can delete it.

JavaScript (ES6), 206 205 204 203 198 197 194 bytes
Came up with this while working on i cri everytim's solution, figured it was different enough to warrant posting on it's own.
This includes a load of unprintables between the ] and the , so follow the TIO link below to view it with Unicode escapes (each sequence of \u followed by 4 digits counts as 1 byte).
_=>`],0621ƽ1`.replace(/\D/g,(x,y)=>"810"[y<122?y&1:2].repeat(x.charCodeAt()))

Try it online

MATLAB/Octave, 319 318 bytes
This is my first attempt at this challenge. Still a bit large and there are probably more efficient ways of doing it, but I thought I'd post it anyway as the method was more interesting than just zipping it.
for i=reshape('|871%871%8%1 8)1 8%1%8$1!8)1!8$1%8#1"8)1"8#1%8#1"8)1"8#1%8"1#8)1#8"1%8"1$8''1$8"1%8"1%8%1%8"1%8"118"1%8"118"1%8"118"1&8"1/8"1#8 1"8"1/8"1"8!1#8"1-8"1#8"1#8"1+8"1#8$1#8#1''8#1#8&1#8-1#8(1#8+1#8*1#8)1#8,1#8''1#8.1$8#1$801$8!1$831''861%891!8K1 0 6 2 1~0~0~0~0`0 1',2,[]);fprintf(repmat(i(2),1,i(1)-31));end

Try it online!
The method used here is to make use of a Run-Length-Encoding scheme of sorts.
We start off with the original number and count the number of consecutive digits. These are written in the result below as the count followed directly by the digit (space separated for clarity).
938 241 68 241 68 61 8 101 8 61 68 51 28 101 28 51 68 41 38 101 38 41 68 41 38 101 38 41 68 31 48 101 48 31 68 31 58 81 58 31 68 31 68 61 68 31 68 31 188 31 68 31 188 31 68 31 188 31 78 31 168 31 48 1 38 31 168 31 38 21 48 31 148 31 48 31 48 31 128 31 48 51 48 41 88 41 48 71 48 141 48 91 48 121 48 111 48 101 48 131 48 81 48 151 58 41 58 171 58 21 58 201 88 231 68 261 28 441 0 6 2 1 4450 1

If any of the values is larger than 95 we break that up into multiple chunks of 95 or less - this only happens for the 445 0's which instead becomes four sets of 95 0's and a set of 65 0's. We also pad any counts that are less than 10 with a 0 to make all elements three characters long. This yields with the spaces removed:
938241068241068061018101018061068051028101028051068041038101038041068041038101038041068031048101048031068031058081058031068031068061068031068031188031068031188031068031188031078031168031048011038031168031038021048031148031048031048031128031048051048041088041048071048141048091048121048111048101048131048081048151058041058171058021058201088231068261028441010016012011950950950950650011

In hindsight at this point I could have done this step before merging it all together, but ho hum you live and learn. We do something clever which is to take the count for each group (2 digits) and we add 31. Because all of them are <96, the resulting number is the ASCII value for a printable character (32 to 126). Giving us counts of:
|7%7%% ) %%$!)!$%#")"#%#")"#%"#)#"%"$'$"%"%%%"%"1"%"1"%"1"&"/"# ""/""!#"-"#"#"+"#$##'##&#-#(#+#*#)#,#'#.$#$0$!$3'6%9!K    ~~~~`

After a bit of reshaping in MATLAB to make it more favourable for decoding, and then also escaping ' characters with '' (otherwise MATLAB splits string literals there), we are left with the clever string:
|871%871%8%1 8)1 8%1%8$1!8)1!8$1%8#1"8)1"8#1%8#1"8)1"8#1%8"1#8)1#8"1%8"1$8''1$8"1%8"1%8%1%8"1%8"118"1%8"118"1%8"118"1&8"1/8"1#8 1"8"1/8"1"8!1#8"1-8"1#8"1#8"1+8"1#8$1#8#1''8#1#8&1#8-1#8(1#8+1#8*1#8)1#8,1#8''1#8.1$8#1$801$8!1$831''861%891!8K1 0 6 2 1~0~0~0~0`0 1

That is the root of the code. In the code all I then do is reshape the array into a 2D string with 128 pairs of characters. For each pair the first character has 31 subtracted, and then the second character is displayed that many times.
The result is the original prime:
888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888111111111111111111111111888888111111111111111111111111888888111111811111111118111111888888111118811111111118811111888888111188811111111118881111888888111188811111111118881111888888111888811111111118888111888888111888881111111188888111888888111888888111111888888111888888111888888888888888888111888888111888888888888888888111888888111888888888888888888111888888811188888888888888881118888188811188888888888888881118881188881118888888888888811188881118888111888888888888111888811111888811118888888811118888111111188881111111111111188881111111118888111111111111888811111111111888811111111118888111111111111188881111111188881111111111111118888811118888811111111111111111888881188888111111111111111111118888888811111111111111111111111888888111111111111111111111111118811111111111111111111111111111111111111111111062100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001

Edits:

rearranged the magic string so I could get rid of a transpose after the reshape. Saves a byte.

05AB1E, 76 bytes
•ŒÆÿ¹т£Ƶ‘β\,ä¸γλaXë«Š¸þaγG(žÃÇ…»šKþÈ/?`'•20BS20öDg81s∍Ss×J30ôø.∞0D445×621s1J

Try it online!

Stole this from Dennis:
888888888888888811111111111111
888888888888888888111111111111
888888888888888888811111111111
888111111111111888881111111111
888111111111111118888111111111
888111111111111111888811111111
888111111888888111188881111111
888111188888888881118888111111
888111888888888888111888811111
888118888888888888811188881111
888111111188888888811118881111
888111111118888888881111888111
888111111111888888881111888811
888111111111888888881111188811
888111111111888888881111118881

Noticed it always alternates between 8 and 1, so I counted the lengths of each run (Base 20):
['G', 'E', 'I', 'C', 'J', 'B', '3', 'C', '5', 'A', '3', 'E', '4', '9', '3', 'F', '4', '8', '3', '6', '6', '4', '4', '7', '3', '4', 'A', '3', '4', '6', '3', '3', 'C', '3', '4', '5', '3', '2', 'E', '3', '4', '4', '3', '7', '9', '4', '3', '4', '3', '8', '9', '4', '3', '3', '3', '9', '8', '4', '4', '2', '3', '9', '8', '5', '3', '2', '3', '9', '8', '6', '3', '1']

Joined it all together, and converted it into a base-10 integer:
3954184379309026812828704944878416720438306456270310298603957651230861078960874182787979106461

Compressed it further into base-255:
ŒÆÿ¹т£Ƶ‘β\,ä¸γλaXë«Š¸þaγG(žÃÇ…»šKþÈ/?`'

Then, after creating the compressed bit... We just have to manipulate it back to the original..
20B                                 # Back to base 20.
   S                                # Each char separate...
    20ö                             # As their base 10 values...
       Dg81s∍                       # Extend '81' to the length of the array.
             Ss×J                   # Push that many 8 or 1's as told by the array.
                 30ôø.∞             # Split by the symmetrical pattern, flip it, mirror.
                       0D445×621s1  # Create the part that doesn't fit into a pattern.
                                  J # Join whole stack together.

Final output:
88888888888888888888888888888
88888888888888888888888888888
88888888888888888888888888888
88811111111111111111111111888
88811111111111111111111111888
88811111181111111118111111888
88811111881111111118811111888
88811118881111111118881111888
88811118881111111118881111888
88811188881111111118888111888
88811188888111111188888111888
88811188888811111888888111888
88811188888888888888888111888
88811188888888888888888111888
88811188888888888888888111888
88881118888888888888881118888
18881118888888888888881118881
18888111888888888888811188881
11888811188888888888111888811
11188881111888888811118888111
11118888111111111111188881111
11111888811111111111888811111
11111188881111111118888111111
11111118888111111188881111111
11111111888881118888811111111
11111111188888188888111111111
11111111111888888811111111111
11111111111188888111111111111
11111111111111811111111111111
11111111111111111111111111111062100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001

C (gcc), 277 250 201 bytes
-27 bytes thanks to ceilingcat
n;f(i){for(i=0;n="oApYGYGGBKBGGFCKCFGEDKDEGEDKDEGDEKEDGDFIFDGDGGGDGDSDGDSDGDSDHDQDEBDDQDDCEDODEDEDMDEFEEIEEHEOEJEMELEKENEIEPFEFRFCFUIXG[Cm"[i++]%64;)for(;--n;)putchar(49+i%2*7);printf("0621%0446d",1);}

Try it online!

Perl 5, 307 bytes
$d=1;print((map{($d^=9)x$_}(93,24,6,24,6,6,1,10,1,6,6,5,2,10,2,5,6,4,3,10,3,4,6,4,3,10,3,4,6,3,4,10,4,3,6,3,5,8,5,3,6,3,6,6,6,3,6,3,18,3,6,3,18,3,6,3,18,3,7,3,16,3,4,1,3,3,16,3,3,2,4,3,14,3,4,3,4,3,12,3,4,5,4,4,8,4,4,7,4,14,4,9,4,12,4,11,4,10,4,13,4,8,4,15,5,4,5,17,5,2,5,20,8,23,6,26,2,44)),0,621,0 x445,1)

Try it online!

CJam (108 81 bytes)
"u{èl>`#ö^½³ó!;kMðSÀËndEyvY3ÉÊÅBà#®"256bFbee{)*~}%"81"f=15/_Wf%zT6Y446,:!1

Online demo
In case character encoding borks the above, here it is xxd-encoded:
0000000: 2275 1e7b e86c 3e60  8d23 80f6 5ebd b3f3  "u.{.l>`.#..^...
0000010: 213b 968d 6b4d f053  c0cb 6e64 1c45 7976  !;..kM.S..nd.Eyv
0000020: 5933 c9ca 8dc5 42e0  23ae 2232 3536 6246  Y3....B.#."256bF
0000030: 6265 657b 292a 7e7d  2522 3831 2266 3d31  bee{)*~}%"81"f=1
0000040: 352f 5f57 6625 7a54  3659 3434 362c 3a21  5/_Wf%zT6Y446,:!
0000050: 31                                        1

The initial run of 8s and 1s is split into just the left half and run-length encoded as just the lengths of alternating runs. Runs of more than 24 are split into runs of at most 24, separated by runs of 0, so that the lengths can be base-25 encoded and then base-256 encoded to pack them down.

JavaScript (ES2017), 287 bytes
_=>"00000000000000000027wr2027wr2027a9ko261b7c23jerc23jerc1yjm0o1y8coo1y2ou01xx5q01xx5q01xx5q00yykxc9ull699d4au9dk75xffo1v2fgptj4fh8jrj3hhwvgfhmlev3hour5rhq24n3hqytj3hr4hdrhr8ykfhra0hr".replace(/.{6}/g,n=>parseInt(n,36).toString(2).replace(/0/g,8).padStart(30,8))+0+621+"0".repeat(445)+1

Uses a slightly different approach to @icrieverytim's answer. -10 bytes thanks to @Shaggy's suggestion of using replace instead of match!

f=
_=>"00000000000000000027wr2027wr2027a9ko261b7c23jerc23jerc1yjm0o1y8coo1y2ou01xx5q01xx5q01xx5q00yykxc9ull699d4au9dk75xffo1v2fgptj4fh8jrj3hhwvgfhmlev3hour5rhq24n3hqytj3hr4hdrhr8ykfhra0hr".replace(/.{6}/g,n=>parseInt(n,36).toString(2).replace(/0/g,8).padStart(30,8))+0+621+"0".repeat(445)+1
;
p.innerHTML=f()
pre{word-wrap:break-word;white-space:normal}
<pre id=p></pre>

287 bytes.

Bubblegum, 88 bytes
00000000: edc9 310a 0250 10c4 d02b fdb1 90dc ff64  ..1..P...+.....d
00000010: 96c1 80a2 8885 60aa d97d 7cb3 3de8 75c5  ......`..}|.=.u.
00000020: 37ab 820a 51ee 9537 942a 55c4 aaec 76b4  7...Q..7.*U...v.
00000030: cfb5 1cdc 33dd 908b ac1c 74a0 894e 03c8  ....3.....t..N..
00000040: 11cc 99ab 9c1d c661 32c5 bad6 8aad 96d2  .......a2.......
00000050: b95e 76fe fd6e bb01                      .^v..n..

Try it online!

Ruby, 194 bytes
$><<?8+"~:(:((#,#(('$,$'(&%,%&(&%,%&(%&,&%(%'*'%(%(((%(%4%(%4%(%4%)%2%&#%%2%%$&%0%&%&%.%&'&&*&&)&0&+&.&-&,&/&*&1'&'3'$'6*9(<$N".bytes.reduce(""){|s,x|s+(s[-1]==?8??1:?8)*(x-34)}+"0621"+?0*445+?1

The upper part is RLE-encoded, the rest is simply hardcoded.
Try it online!

Kotlin, 339 bytes
val s="8J188J1888138<13881887148<14871886158<15861886158<15861885168<16851885178:178518851888188518851D8518851D8518851D8519851B85168315851B85158416851@85168516851>85168716861:861689168@168;168>168=168<168?168:168A1786178C1784178F1:8I188L148^130363231ǯ031"
fun x()=(0..s.length-1 step 2).map{i->(1..(s[i].toInt()-50)).map{print(s[i+1])}}

Try it online!

///, 260 bytes
/;/88%//:/1&13%13"//9/\/\///7/"1#95/!!!!94/%""93/8889-/000009,/11#9'/###9&/#88"9%/"""9#/389"/1119!/-----0/'''''''##8%4#;4&"8%18""&11;188"1::1&#%1#"&#8"",8"&&"&&'&&'&&'&#3"'#"#13"'#"3,"##&#"#"'"#",7#7"7%",%#%"#%,%1#%7"",4#8784,8,8%%,#%%",;411;%%41106215555!0001

Try it online!
Nothing terribly interesting, just some compression.

Mathematica, 192 bytes
Uncompress["1:eJxTTMoP8nRjZWCwoCUwxAGIl0VSZIEhi2wEXAgma4Eqa0GCrAW6rAW6rAWyJKYsulPRGGhBRLksNmmYy/HJonkOXStWaeTwgTGQ5JADD4mJTQRdGo2PysUwC1kA0yJDFPdgJjWoKHZJNB/hlMYhaYiaMgkDAzMjQ4NRMHSBIQDgQA6C"]

See: http://reference.wolfram.com/language/ref/Compress.html

Python 2, 191 190 188 bytes
s='0621'+'0'*445+'1'
a=1
for c in'L":&7(4%"%1%$%/$($-$*$+$,$)$.$\'$$($$%$#,#$#$#.#$"##0##!$#0#\'#2#&#2#&#2#&#&&&#&#%(%#&#$*$#&$#*#$&$#*#$&%"*"%&&!*!&&8&8}':s=`a`*(ord(c)-32)+s;a^=9
print s

Try it online!
Same principal as my answer over here

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:
Find the sum of the divisors of N
Write a program that displays on the screen the sum of the divisors of a number (1 ≤ N ≤ 100) entered by the user in the range of 1 to N.
This is OEIS A000203.

Examples:
Input: 7
7 / 1 = 7
7 / 7 = 1

7 + 1 = 8

Output: 8

Input: 15
15 / 1 = 15
15 / 3 = 5
15 / 5 = 3
15 / 15 = 1

15 + 5 + 3 + 1 = 24

Output: 24

Input: 20
20 / 1 = 20
20 / 2 = 10
20 / 4 = 5
20 / 5 = 4
20 / 10 = 2
20 / 20 = 1

20 + 10 + 5 + 4 + 2 + 1 = 42

Output: 42

Input: 1
1 / 1 = 1

Output: 1

Input: 5
5 / 1 = 5
5 / 5 = 1

5 + 1 = 6

Output: 6

@H.PWiz I think he means "the divisors of a number N"

I think you mean sum of divisors, aka, the sigma function?

Sorry, i mean "The sum of the multiple of N".

@H.PWiz this is the sum of those, so I dunno

@Stephen That seems like a trivial change to me

Oh, and that question is restricted by time complexity, so maybe not.

Closely related

05AB1E, 2 bytes
ÑO

Try it online!
How?
Ñ    Divisors
 O   Sum

Polyglot with 2sable

ÑO - Rejecting the challenge and winning at the same time. That's pretty badass.

x86-64 Machine Code, 23 bytes
89 F9 89 FE EB 0D 89 F8 99 F7 F1 85 D2 99 0F 44 D1 01 D6 E2 F1 96 C3

The above bytes of code define a function that accepts a single integer, N, and returns the sum of its multiples as a result.
The single parameter is passed in the EDI register, consistent with the System V AMD64 ABI (as used on *nix-style systems). The result is returned in the EAX register, as with all x86 calling conventions.
The algorithm is a very straightforward one, similar to many of the other submissions in other languages. We loop N times, each time computing the modulo and adding that to our running total.
Ungolfed assembly mnemonics:
; unsigned SumOfMultiples(unsigned N  /* (EDI) */)
    mov     ecx, edi      ; make copy of input N, to be used as our loop counter
    mov     esi, edi      ; make copy of input N, to be used as our accumulator
    jmp     CheckEnd      ; jump directly to 'CheckEnd'
AddModulo:
    mov     eax, edi      ; make copy of input N, to be used as input to DIV instruction
    cdq                   ; short way of setting EDX to 0, based on EAX
    div     ecx           ; divide EDX:EAX by ECX, placing remainder in EDX
    test    edx, edx      ; test remainder, and set ZF if it is zero
    cdq                   ; again, set EDX to 0, without clobbering flags
    cmovz   edx, ecx      ; set EDX to ECX only if remainder was zero (EDX = ZF ? 0 : ECX)
    add     esi, edx      ; add EDX to accumulator
CheckEnd:
    loop    AddModulo     ; decrement loop counter (ECX), and keep looping if it != 0
    xchg    eax, esi      ; move result from accumulator (ESI) into EAX
    ret                   ; return, with result in EAX

Try it online!
It sure seems like there should be a way to make this shorter, but I can't see it. Computing modulo on x86 takes quite a bit of code, since you do it using the DIV (or IDIV) instruction, and both of those use fixed input registers (EDX and EAX), the values of which get clobbered (because they receive the results, the remainder and quotient, respectively).
The only real tricks here are pretty standard golfing ones:

I've structured the code in a somewhat unusual way so that I can use the CISC-style LOOP instruction, which is basically just a combination of DEC+JNZ with the ECX register as the implicit operand.
I'm using XCHG at the end instead of MOV because the former has a special 1-byte encoding when EAX is one of the operands.
I use CDQ to zero out EDX in preparation for the division, even though for unsigned division you would ordinarily just zero it using a XOR. However, XOR is always 2 bytes, while CDQ is only 1 byte. I use CDQ again a second time inside of the loop to zero EDX, before the CMOVZ instruction. This works because I can be guaranteed that the quotient of the division (in EAX) is always unsigned, so a sign-extension into EDX will set EDX equal to 0.

C (gcc), 45 bytes
i,s;f(n){for(s=i=n;--i;)s+=n%i?0:i;return s;}

Try it online!

C, C++, C#, D, Java, 65 62 bytes
int d(int n){int s=0,i=1;for(;i<=n;++i)s+=n%i>0?0:i;return s;}

This works in all theses 5 programming languages because of similarities.
C, C++ and D optimization : 62 60 bytes
In C++ and D, integers convert implicitly to booleans ( Zero => false, Not Zero => true ), so you don't need to have the !=0
int d(int n){int s=0,i=1;for(;i<=n;++i)s+=n%i?0:i;return s;}

D optimization : golfy template system, 55 bytes
T d(T)(T n){T s,i=1;for(;i<=n;++i)s+=n%i?0:i;return s;}

C++ optimization by c and c-- : 53 52 bytes
int f(int n,int i=0){return++i<n?f(n,i)+i*!(n%i):n;}

Code to test :
C :
printf("%d %d %d %d %d", d(7), d(15), d(20), d(1), d(5));

C++ :
std::cout << d(7) << ' ' << d(15) << ' ' << d(20) << ' ' << d(1) << ' ' << d(5);

C# :
class FindSum
{
    int d(int n) { int s = 0, i = 1; for (; i <= n; ++i) s += n % i > 0 ? 0 : i; return s; }

    static void Main(string[] args)
    {
        var f = new FindSum();
        Console.WriteLine(string.Format("{0}, {1}, {2}, {3}, {4}", f.d(7), f.d(15), f.d(20), f.d(1), f.d(5)));
    }
}

D :
writeln(d(7));
writeln(d(15));
writeln(d(20));
writeln(d(1));
writeln(d(5));

Java :
public class FindSum {
    int d(int n){int s=0,i=1;for(;i<=n;++i)s+=n%i>0?0:i;return s;}

    public static void main(String[] args) {
        FindSum f = new FindSum();
        System.out.println(String.format("%d, %d, %d, %d, %d", f.d(7), f.d(15), f.d(20), f.d(1), f.d(5)));
    }
}

A few things: First, I don't think you need parentheses around the n%i/n%i!=0 in any of the languages. Second, your first solution should be able to have n%i>0 instead of n%i!=0. Third, D's solution can be T d(T)(T n){T s,i=1;for(;i<=n;++i)s+=n%i?0:i;return s;} by abusing the template system and default values.

52 bytes, C++

Mathematica, 14 bytes
Tr@Divisors@#&

or an answer by @Loki
Mathematica, 17 bytes
DivisorSum[#,#&]&

@Jennymathy Very nice, thanks! An equivalent and funny way to write it is also: DivisorSum[#, # &] &

@Jennymathy Hmm, this is even better: Total@Divisors@ is only 15 characters long! And it works: eg Total@Divisors@15 gives 24 as expected. Mathematica  FTW :)

@Loki and Tr@Divisors@#& even better  ;-)

@Jennymathy Wow, awesome!

@Jennymathy, actually you don't even need the #&, Tr@Divisors@ also just works, ie Tr@Divisors@15 gives 24

@Loki the program must be a function f= that takes an input f[x] that's why I present it in this way.Welcome to PPCG

You can use Tr@*Divisors to shave off a byte.

Japt, 3 bytes
â)x

Try it online!

Alternative: â x

@Mr.Xcoder: not really an alternative; it's doing the exact same thing - only difference is the choice of parenthesising.

Or with the flag -x, it could be one byte

Shnap, 44 43 bytes
-1 bye thanks to Mr. Xcoder (lol I was outgolfed in my own language)
 $n return:{s=0for d:range(n+1)if n%d<1s+=d}

This is a function ($ starts a function in Shnap).
Try it online!
Explanation:
$ n                        //Start function with parameter n
    return: {              //Technically, we are returning a scope-block, which evaluates to the last statement run
        s = 0              //Our result
        for d : range(n+1) //For each value in the iterator range(n+1)
            if n % d < 1  // If n is divisible by d
                s += d     // Add d to the sum
                           // Since (s += d) returns (s + d), and a scope-block returns the last run statement, this will be the last statement and equal to our result
    }

Noncompeting, 19 bytes
After many language updates, this can now be reduced to a measly 19 bytes:
$n=>sum(factors(n))

Try it online!

==0 is <1 (43 bytes)

@Mr. Xcoder thanks... I was outgolfed... In my own language... Which isn't even esoteric xD

Brachylog, 2 bytes
f+

Try it online!
Explanation
f       Factors
 +      Sum

Risky, 3 bytes
+/?+??

Try it online!

Jelly, 2 bytes
Æs

Try it online!
Built-in that does exactly as wanted.

Jelly seems so beautiful! Where can i find some stuff to study about it?

@KevinHalley You can check out the Tutorial page on Github, or you can visit the official Jelly chatroom once you have 20 reputation, or the Jelly training chatroom, also at 20 reputation, which you'll need to request permission to train in

I desperately want to upvote this because you suggested not upvoting trivial solutions.

@CodyGray Yeah, maybe there's no point putting that there :P

R, 31 26 bytes
function(N)(x=1:N)%*%!N%%x

Try it online!
Returns a 1x1 matrix.
Computes !N%%x maps elements d of 1:N by: d->(1 if d divides N, 0 otherwise)
Then x%*%x!N%%x is the matrix product of 1:N which results in the sum of x where !N%%x is 1. Neat! Technically a port of Luis Mendo's Octave answer but I only saw that after I thought of this.
R+ numbers, 14 bytes
numbers::Sigma

Try it online!

For the first one you can save 2 bytes with N=scan();

@gstats yes, but then I should get +4 bytes per meta discussion. If you have a strong opinion you can weigh in on Jarko's answer but as nobody has suggested an alternative, that stands in my mind.

Shouldn't the second be numbers::Sigma(N)? Like this it outputs the source code of function Sigma.

@RuiBarradas a function is a perfectly good submission. to test it, you obviously have to call it as I do in the first submission.

Note: that anonymous functions in the later versions of R now can now use the syntax \(x) instead of function(x). So you can save quite a few characters there.

Javascript, 54 44 bytes
n=>[...Array(x=n)].reduce(y=>y+!(n%x)*x--,0)

Saved 10 bytes thanks to Shaggy
Try it online!

const f = n=>[...Array(x=n)].reduce(y=>y+!(n%x)*x--,0)

console.log(f(7))
console.log(f(15))
console.log(f(20))
console.log(f(1))
console.log(f(5))

Python, 44 bytes
lambda k:sum(i*(k%i<1)for i in range(1,1+k))

Thanks to Stephen, save 1 byte by removing whitespace.
Thanks to Jonathan Frech, save another 1 byte by changing if to multiply.

You could also write it as lambda k:sum(-~i*(k%-~i<1)for i in range(k))

41 bytes.

@97.100.97.109 Maybe that is different enough to post as another answer.

@97.100.97.109 And looks like it is similar to this answer. https://codegolf.stackexchange.com/a/142108/44718 so you can go up vote that one.

Pari/GP, 5 bytes
sigma

Try it online!

J, 23 bytes
[:+/](([:=&0]|[)#])1+i.

Try it online!
For J fans, there is a clever 13 byte solution: >:@#.~/.~&.q: but since it wasn't my invention I'm not posting it as my official answer.
My own solution simply filters 1..n, finding divisors, then sums them.  The crux of it is the dyadic fork
](([:=&0]|[)#])

Note that in this context ] is 1..n, and [ is n itself.  Hence ]|[ are the remainders when dividing each element of 1..n into n, and =&0 tells you if they're equal to 0.

This for 13 bytes should be equivalent: +1#.i.*0=i.|]

@miles, that is really nice.  This part is i.|] is a great improvement on my approach.  I don't fully understand this part though: +1#.i. -- could you explain it?

1#. is base 1 conversion, which is equivalent to +/"1. First i.|] to get the remainders, then 0= to find the ones equal to 0 (the divisors), then i.* to zero out the non-divisors in the range, then sum using 1#., then add + itself since i. is an exclusive range.

Pyth, 6 bytes
s*M{yP

Try it here!
Pyth doesn't have a built-in for divisors, so I think this is reasonable.
Explanation

s*M{yP    - Full program with implicit input.

     P    - The prime factors of the input.
    y     - The powerset of its prime factors.
   {      - Deduplicate.
 *M       - Map with multiplication.
s         - Sum.
          - Implicitly display the result.

Given 20, for instance, this is what our program does after each instruction:

P: [2, 2, 5].

y: [[], [2], [2], [5], [2, 2], [2, 5], [2, 5], [2, 2, 5]].

{: [[], [2], [5], [2, 2], [2, 5], [2, 2, 5]].

*M: [1, 2, 5, 4, 10, 20].

s: 42.

Java (OpenJDK 8), 53 51 bytes
n->{int s=0,i=0;for(;i++<n;)s+=n%i<1?i:0;return s;}

Try it online!

@corsiKa Only class fields. In a local scope they're unitialized.

MATL, 6 bytes
t:\~fs

Try it online!
-4 bytes thanks to @LuisMendo
10 bytes
My previous solution using a loop
:"G@\~@*vs

Try it online!
3 bytes
Using built-in
Z\s

Try it online!

Haskell, 30 bytes
f n=sum[i|i<-[1..n],n`mod`i<1]

Try it online!

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

Try it online!
Explanation:
Now outdated by improvements.
The heart of the algorithm is this:
({}(<>))<>{(({})){({}[()])<>}{}}{}<>([{}()]({})) turns |N, M...| into |N mod M, M...|
{((<{}{}>))} if the top of stack is not zero, replace it and the second with zero

That is a modification on mod that will give us M if it is a factor of N and 0 otherwise. Full code is below.
((({})<>) place input, N on both stacks
{ Loop to find factors
 <
  (([()]{})) Decrement and Duplicate; get next factor to check
  { if not zero
   (<>({})<>) Copy N from other stack
   ({}(<>))<>{(({})){({}[()])<>}{}}{}<>([{}()]({})){((<{}{}>))} Code explained above
  }
  {} drop the zero
 >
 {} add the factor
}) push the sum

Do you have an explanation?

@FunkyComputerMan I got one now!

Excel VBA, 41 Bytes
Anonymous VBE immediate window function that takes input from [A1] and outputs to the VBE immediate window
For i=1To[A1]:s=s-i*([A1]mod i=0):Next:?s

Excel, 41 Bytes
Worksheet formula that takes input from [A1] and outputs to the caller
Requires MS Excel Version 16.0 or later for access to Let(...) function
=LET(a,SEQUENCE(A1),SUM((MOD(A1,a)=0)*a))

For i=1To[A1]:s=s-([A1]mod i=0)*i:Next:?s is 41 bytes.  The minus is because VBA seems to convert True to -1.

@Axuary - thanks for having me take a look at this one again - It was fun to make the worksheet formula solution for this

TI-Basic, 16 bytes
sum(seq(Inot(fPart(Ans/I)),I,1,Ans

Takes input in Ans. Output is stored in Ans and displayed.

Vyxal s, 1 byte
K

Try it Online!
K∑ flagless. K just gets the divisors of a number.

Husk, 2 bytes
ΣḊ

Try it online!

wow that's pretty good

Raku, 25 23 22 bytes
thanks ovs for 2 byte improvement
also JoKing for 1 byte improvement
{sum grep $_%%*,1..$_}

declare anonymous block ($_ implicitly declared)
filter (grep) numbers from 1 to $_ inclusive using the whatever variable (*) that are divisible by $_
get the sum of that list

Try it online!

{grep($_%%*,1..$_).sum} works for 23

that that is very smart

you can move sum to the start to save one on the brackets, Try it online!

tinylisp, 74 73 bytes
(load library
(d D(q((K N)(i K(a(i(mod N K)0 K)(D(s K 1)N))0
(q((N)(D N N

Try it online!
-1 byte thanks to DLosc.
And without library just for fun:
tinylisp, 97 90 bytes
(d D(q((N K)(i(l N K)N(D(s N K)K
(d F(q((K N)(i K(a(i(D N K)0 K)(F(s K 1)N))0
(q((N)(F N N

Try it online!
-7 bytes thanks to DLosc.

@DLosc thanks! I should probably rename D to M since now it's just a mod function.

Huh--I didn't notice that, lol.

JavaScript, 31 bytes
f=(n,i=n)=>i&&!(n%i)*i+f(n,i-1)

VBA (Excel), 73 bytes
a=Cells(1,1)
x=1
While x<=a
If a Mod x = 0 Then b=b+x
x=x+1
Wend
MsgBox b

This answer is invalid as it is a collection of snippets that cannot be run as a single unit as stands. To make this valid you will need to convert this to a subroutine or an anonymous VBE immediate window function.

I am not very familiar in what you had said. Can you help me a bit more?

To make this post valid you would have to convert it into one of the following formats, 1 - Subroutine, 2 - Function, 3 - Anonymous VBE immediate window function (a single line that can be executed in the Immediate window);  For your implementation, the simplest implementation of this would be to convert to a subroutine by wrapping with Sub Y...End Sub to get the 85 Byte solution Sub y
A=Cells(1,1)
x=1
While x<=A
If A Mod x=0 Then b=b+x
x=x+1
Wend
MsgBox b
End Sub

That however can be optimized quite heavily down to the 72 byte solution Sub y
While x<=[A1]
x=x+1
If [A1]Mod x=0Then b=b+x
Wend
Debug.?b
End Sub
which assumes that it is run in a clean module (x = default int value, 0) and outputs to the VBE immediate window (? autoformats to Print  )

Beyond this, and recognizing that your solution does not take input via the subroutine call, this can then be converted to a VBE immediate window function for 50 Bytes While x<=[A1]:x=x+1:b=IIf([A1]Mod x,b,b+x):Wend:?b which assumes that x,b are the default value of 0 and outputs to the VBE immediate window (from the VBE immediate window ? is equivalent to Debug.Print )

Note that in the above, the If ... Then clause was converted to an IIf call - if this is not possible and the If statement lies in a loop, then your subroutine / function cannot be made into an anonymous VBE immediate window function, as anything that follows the Then regardless of next lines (:) shall be regarded as part of that If statement and thus, the compiler sees an un-terminated loop structure

That's about all of the basics - see here for more.

Thank You Sir @TaylorScott . I guess I really don't know a lot about the definitions in VBA. Yes I read about your post and it actually helped me a lot and understand more. Thank you again Sir.

Bash + GNU utilities, 36
bc<<<`seq -f"n=%g;a+=n*!$1%%n;" $1`a

Try it online.

Pure Bash, 41
for((;++i<=$1;a+=$1%i?0:i))
{
:
}
echo $a

Try it online.
I first tried a fancy bash expansion answer, but it ended up being longer than the simple loop above:
echo $[$(eval echo +\\\(n={1..$1},$1%n?0:n\\\))]

Python 2, 41 bytes
f=lambda n,i=1:i<=n and(n%i<1)*i+f(n,i+1)

Try it online!

Add++, 9 bytes
D,f,@,dFs

Try it online!
I clearly got here too late. This defines a function that gets the factors, then sums them.

Ohm v2, 2 bytes
VΣ

Try it online!
This is pretty straight-forwad:

V   - Divisors.
 Σ  - Sum.

Damnit, you beat me too it!

Husk, 5 bytes
ṁΠuṖp

Try it online!
How?

ṁΠuṖp  - Full program, implicit input.

     p  - Prime factors.
    Ṗ   - Powerset.
   u    - Remove duplicates.
ṁΠ     - Get the product of each list, sum and implicitly output.

Thanks to Zgarb for the suggestions in chat!

Gaia, 2 bytes
dΣ

Try it online!
Pretty straight-forward:

dΣ   - Full program.

d    - Divisors.
 Σ   - Sum.

Neim, 2 bytes

Try it online!

Octave, 20 bytes
@(n)~mod(n,t=1:n)*t'

Try it online!

PowerShell, 36 bytes
param($a)1..$a|%{$j+=$_*!($a%$_)};$j

Try it online!
Explanation
param($a)1..$a|%{$j+=$_*!($a%$_)};$j
param($a)                            # Takes input $a
         1..$a|%{               };   # For-loop from 1 up to $a
                          $a%$_      # Modulo, if this is zero we've hit a divisor
                        !(     )     # Take the Boolean-not of that. If a divisor, it's 1
                     $_*             # Multiply the current number by that Boolean
                                     # Only if it's a divisor will this be non-zero
                 $j+=                # Add it into our accumulator
                                  $j # Output our accumulator

Axiom, 42 bytes
f(x:PI):PI==(x=1=>1;reduce(+,divisors(x)))

results
(19) -> [[i,f(i)] for i in [7,15,20,42,1,5] ]
   (19)  [[7,8],[15,24],[20,42],[42,96],[1,1],[5,6]]
                                          Type: List List PositiveInteger

Why is not possible upvote the answer of who write it? I have the suspect here people upvote their answer logging with some other login... I say that because in some question there are more star than the people answer... (so why give one star if you not participate to competition?)

APL, 9 bytes
+/⍳×0=⍳|⊢

Try it online!
How? (input n)

⍳|⊢, [n mod 1, ..., n mod n]
0=, [0 == n mod 1, ... 0 == n mod n]
⍳×, [1*(0 == n mod 1), ..., n*(0 == n mod n)]
+/, sum([1*(0 == n mod 1), ..., n*(0 == n mod n)])

Rockstar, 96 bytes
listen to N
X's0
T's0
while N-X
let X be+1
let D be N/X
turn up D
let T be+D is N/X and X

say T

Try it here (Code will need to be pasted in)

GolfScript, 15 bytes
~.,{.3$\%!*+}*+

Try it online!
~                # Parses the input to integer
 .,              # Makes an array with numbers from 0 to (N-1)
   {.3$\%!*+}    # This block goes to the top of the stack without being executed
             *   # Folds
              +  # Adds the input and the result

What the block does:
    .            # Duplicates the number of the array
     3$          # Makes a copy of N
       \%!       # Tests if the number of the array is a divisor of N
          *      # Multiplies, resulting in the divisor if it was divisible or 0 if it wasn't
           +     # Adds to the acumulator

x86-16 machine code, 18 bytes
00000000: 89c1 9988 0e09 0150 d40a 7502 02d4 58e2  .......P..u...X.
00000010: f2c3                                     ..

Listing:
89 C1           MOV  CX, AX                 ; input number as loop counter
99              CWD                         ; zero DX as running sum
            DIVLOOP:
88 0E 0109      MOV  BYTE PTR[AAM1+1], CL   ; move loop counter to divisor
50              PUSH AX                     ; save input number
            AAM1:
D4 0A           AAM                         ; ZF if (AL % CL == 0), AH = quotient
75 02           JNZ  END_LOOP               ; if not ZF, continue loop
02 D4           ADD  DL, AH                 ; otherwise add to running sum
            END_LOOP:
58              POP  AX                     ; restore input number
E2 F2           LOOP DIVLOOP                ; loop until CL == 0
C3              RET                         ; return to caller

Callable function, input N in AX, result in DX.
Inspired by @CodyGray's excellent answer, and the comment "It sure seems like there should be a way to make this shorter" I just had to try!
As Cody mentioned, Using DIV/IDIV is inconvenient because it clobbers two registers including the dividend. Another is that the ZF flag is set when the quotient is 0, however in this case we're only interested in when the remainder is 0.  Enter AAM, a trusty and underrated byte-sized division/modulo instruction that can be golfy.  Even though it does clobber the dividend just like DIV, it will set ZF when the remainder is 0 which is what we want here.  It's downside is that the divisor is encoded in the instruction opcode, which can be modified at runtime at a cost of 4 bytes (in real mode at least).

this is for MS-DOS ? what assembler and debugger you using ? TASM ?

@NotStar I use MASM 1.1 for DOS asm and then just DOS DEBUG.EXE for the x86-16 stuff. Quick and dirty!

Python 3, 45 bytes
lambda n:sum(i for i in range(1,n+1)if n%i<1)

Try it online!

Kotlin, 42 bytes
{var s=0;for(i in 1..it)if(it%i==0)s+=i;s}

Try it online!

K (ngn/k), 14 bytes
{+/&~1!x%!1+x}

Try it online!

!1+x generate sequence from 1..x
x% divide the input by each term in this range
&~1! identify values in the range that evenly divide the input
+/ take (and implicitly return) their sum

Factor + math.primes.factors math.unicode, 15 bytes
[ divisors Σ ]

Try it online!

Fig, \$3\log_{256}(96)\approx\$ 2.469 bytes
+Sk

Try it online!
+Sk
 S  # Sum
  k # The divisors
+   # And add the input

Prolog (SWI), 60 56 bytes
-4 bytes thanks to @Steffan
N+X:-bagof(M,(between(1,N,M),N mod M<1),L),sumlist(L,X).

Try it online!

=:=0 can be <1

also you can use bagof instead of findall

Go, 62 bytes
func p(n int)(p int){i:=1
for;i<=n;i++{if n%i<1{p+=i}}
return}

Attempt This Online!
-2 bytes compared to my answer to Product of Divisors via use of Go's 0-initialization for variables.

Arturo, 19 16 bytes
$=>[∑factors&]

Try it

K (ngn/k), 20 bytes
{+/t(*=(t:1+!x)!'x)}

Try it online!
I honestly didn't know how I manage to make a for-each that find the divisors, lol.
Explanations:
{+/t(*=(t:1+!x)!'x)}  Main function. x is input
    (           'x)   For x amount of times
               !      Modulo it with
       (    !x)       Range, create a list of [0..x-1]
          1+          + 1 to each number in list to turn it into [1..x]
        t:            Assign it to variable t
                      Now, we got the modulo results of each number from [1..x],
                      we now need to
      =               Group them into a dictionary
     *                And get the value of the first key
                      i.e. the occurence positions of the 0s
                      (Implicit at)
   t                  The variable t
 +/                   Sum

Thunno, \$ 2 \log_{256}(96) \approx \$ 1.65 bytes
fS

Attempt This Online!
f   # Factors
 S  # Sum

Thunno 2 S, 1 byte
F

Attempt This Online!
Or, FS flagless.

RProgN 2, 2 bytes
ƒ+

Explained
ƒ+
ƒ   # Factorize
 +  # Sum

Trivial, but felt it needed to be posted.
Try it online!

Perl 5, 35 + 1 (-p) = 36 bytes
$\+=($n%$_==0)&&$_ for 1..($n=$_)}{

Try it online!

Recursiva, 20 18 bytes
smBa++'%'Va'a:0!a'

Try it online!
Explanation:
smBa++'%'Va'a:0!a' - Input to a; 20
s                    - sum up; 42
 m                   - map with; [1, 0, 3, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15]
  Ba                 - Range; [1,2..20]
    ++'%'Va'a:0!a'   - function, evaluates to 0 if param cannot divide a i.e. 20

QBIC, 17 bytes
[:|~b%a|\p=p+a}?p

Explanation
[:|      FOR a = 1; a <= b (read from cmd line); a++
~b%a|    IF b modulo a has a remainder THEN - empty block -
\p=p+a   ELSE add divisor 'a' to running total 'p'
}        END IF, NEXT
?p       PRINT p

CJam, 16 bytes
ri:X{)_X\%!*}%:+

Try it online!
Explanation
ri                 e# Read integer, n
  :X               e# Write to variable X
    {       }%     e# Map this block over the array [0 1 ... n-1]
     )             e# Increment current value. Will give 1, 2, ..., n
      _            e# Duplicate
       X           e# Push input
        \          e# Swap
         %         e# Modulus
          !        e# Negate
           *       e# Multiply
              :+   e# Sum of array. Implicitly display

C#, 56 bytes

Data

Input Int32 i A number
Output Int32 The sum of the divisors of the number

Golfed
i=>{int s=0,d=1;for(;d<=i;d++)s+=i%d<1?i/d:0;return s;};

Ungolfed
i => {
    int
        s = 0,
        d = 1;

    for( ; d <= i; d++ )
        s += i % d < 1 ? i / d : 0;

    return s;
};

Ungolfed readable
// Takes an int
i => {
    // Initializes the sum 's' and divider 'd' vars
    int
        s = 0,
        d = 1;

    // Cycles each number lower than the the number 'i'
    for( ; d <= i; d++ )

        // Sums the result of the division between 'i' and 'd' if the modulus is 0
        s += i % d < 1 ? i / d : 0;

    // Returns the sum
    return s;
};

Full code
using System;
using System.Collections.Generic;

namespace TestBench {
    public class Program {
        // Methods
        static void Main( string[] args ) {
            Func<Int32, Int32> f = i => {
                int s = 0, d = 1;

                for( ; d <= i; d++ )
                    s += i % d < 1 ? i / d : 0;

                return s;
            };

            List<Int32>
                testCases = new List<Int32>() {
                    7,
                    15,
                    20,
                    42,
                    1,
                    5,
                };

            foreach( Int32 testCase in testCases ) {
                Console.WriteLine( $" INPUT: {testCase}\nOUTPUT: {f( testCase )}" );
            }

            Console.ReadLine();
        }
    }
}

Releases

v1.0 - 56 bytes - Initial solution.

Notes

None

In this statement s+=i%d<1?i/d:0;, you can save 2 bytes by replacing i/d by d, the results will be the same ( mostly because it will add the same numbers by in the reverse order : For example, in the second test case, all the division result are added : 15+5+3+1=24. If you add all the denominators ( i believe it's the word to describe the number used to divide the input, sorry if it's the wrong word, i'm not a native english speaker ), we get : 1+3+5+15=24, which is the same )

Batch, 70 bytes
@set/ai=%2+1,s=%3+i*!(%1%%i)
@if not %i%==%1 %0 %1 %i% %s%
@echo %s%

Alternative solution, also 70 bytes:
@set s=0
@for /l %%i in (1,1,%1)do @set/as+=%%i*!(%1%%%%i)
@echo %s%

MY, 4 bytes
ωḊΣ↵

Try it online!
How?
It's really simple: ω is the argument, Ḋ is divisors, Σ is sum, ↵ is output. I thought I already answered this challenge, for some reason.

Ruby, 29 bytes
->x{(1..x).sum{|r|x%r>0?0:r}}

Try it online!

Clojure, 53 bytes
#(apply +(for[i(range 1(inc %)):when(=(mod % i)0)]i))

Casio-Basic, 42 bytes
sum(seq(piecewise(n/x=int(n/x),x,0),x,1,n

The piecewise acts as a shorter If statement. seq loops values of x from 1 to n, and the piecewise returns x if the number is a factor, otherwise it returns 0. sum adds the whole list together to output the total.
41 bytes for the function, +1 to add n in the parameters box.

MathGolf, 2 bytes
─Σ

One of many 2-bytes answers in a code-golf language.
Try it online.
Explanation:
─   # Get a list of divisors of the (implicit) input-integer
 Σ  # Sum them together
    # (after which the entire stack is output implicitly as result)

Ruby, 27 bytes
->x{(1..x).sum{1[x%_1]*_1}}

Attempt This Online!
Abuses Ruby's nth bit operator.

cQuents, 3 bytes
Uz$

Try it online!
Explanation
     implicit mode sequence - print nth term in sequence given input n
U    sum (                           )
 z         divisors (              )
  $                   current term

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


text:
Piles and Piles of Pebbles
My job is stacking pebbles into triangular piles. I've only been doing this for a century and it is already pretty boring. The worst part is that I label every pile. I know how to decompose pebbles into piles of maximal size, but I want to minimize the number of piles. Can you help?
Task
Given an integer, decompose it into the minimum number of triangular numbers, and output that minimum number.
Triangular Numbers
A triangular number is a number which can be expressed as the sum of the first n natural numbers, for some value n. Thus the first few triangular numbers are
1 3 6 10 15 21 28 36 45 55 66 78 91 105

Example
As an example, let's say the input is 9. It is not a triangular number, so it cannot be expressed as the sum of 1 triangular number. Thus the minimum number of triangular numbers is 2, which can be obtained with [6,3], yielding the correct output of 2.
As another example, let's say the input is 12. The most obvious solution is to use a greedy algorithm and remove the largest triangular number at a time, yielding [10,1,1] and an output of 3. However, there is a better solution: [6,6], yielding the correct output of 2.
Test Cases
in out
1 1
2 2
3 1
4 2
5 3
6 1
7 2
8 3
9 2
10 1
11 2
12 2
13 2
14 3
15 1
16 2
17 3
18 2
19 3
20 2
100 2
101 2
5050 1

Rules

The input integer is between 1 and the maximum integer of your language.
I can emulate any language with my pebbles, and I want your code as small as possible because I have nothing but pebbles to keep track of it. Thus this is code-golf, so the shortest code in each language wins.

Sandbox full of pebbles.

Thematically related: https://codegolf.stackexchange.com/questions/95231/natural-pi-0-rock

OEIS A061336

Not to be confused with OEIS A057945 (the first difference occurs for n = 12).

Retina, 57 49 bytes
.+
$*
(^1|1\1)+$
1
(^1|1\1)+(1(?(2)\2))+$
2
11+
3

Try it online! Based on my answer to Three triangular numbers. Change the third line to ^(^1|1\1)*$ to support zero input. Edit: Saved 8 (but probably should be more) bytes thanks to @MartinEnder.

You don't need group 1 in the second stage, and neither group 1 nor 3 in the third stage.

And then ((?(2)1\2|1)) can be shortened to (1(?(2)\2)).

Actually, it's another three byte shorter to do something weird like this: ^((?<2>)(1\2)+){2}$. Or ^(()(?<2>1\2)+){2}$ if you prefer.

@MartinEnder That last version makes my brain ache, but I was able to use your second comment for my linked answer, which was nice.

I think the last one is actually simpler than even the standard approach because it doesn't have the weird conditional forward reference.

Mathematica, 53 bytes
Min[Plus@@@Table[$($+1)/2,{$,#+1}]~FrobeniusSolve~#]&

This code is very slow. If you want to test this function, use the following version instead:
Min[Plus@@@Table[$($+1)/2,{$,√#+1}]~FrobeniusSolve~#]&

Try it on Wolfram Sandbox
Explanation
Min[Plus@@@Table[$($+1)/2,{$,#+1}]~FrobeniusSolve~#]&  (* input: n *)

           Table[$($+1)/2,{$,#+1}]                     (* Generate the first n triangle numbers *)
                                  ~FrobeniusSolve~#    (* Generate a Frobenius equation from the *)
                                                       (* triangle numbers and find all solutions. *)
    Plus@@@                                            (* Sum each solution set *)
Min                                                    (* Fetch the smallest value *)

Jelly (fork), 9 bytes
æFR+\$S€Ṃ

This relies on a fork where I implemented an inefficient Frobenius solve atom. Can't believe it's already been a year since I last touched it.
Explanation
æFR+\$S€Ṃ  Input: n
æF         Frobenius solve with
     $     Monadic chain
  R          Range, [1, n]
   +\        Cumulative sum, forms the first n triangle numbers
      S€   Sum each
        Ṃ  Minimum

Darn Frobenius solve atom it beat my normal Jelly solution by 6 whole bytes :(

@EriktheOutgolfer I need to finish it and make a pull for it.

R, 69 58 bytes
function(n)3-n%in%(l=cumsum(1:n))-n%in%outer(c(0,l),l,"+")

Try it online!
Explanation:
function(n){
 T <- cumsum(1:n)             # first n triangular numbers  [1,3,6]
 S <- outer(c(0,T),T,"+")     # sums of the first n triangular numbers,
                              # AND the first n triangular numbers [1,3,6,2,4,7,4,6,9,7,9,12]
 3 - (n %in% S) - (n %in% T)  # if n is in T, it's also in S, so it's 3-2: return 1
                              # if n is in S but not T, it's 3-1: return 2
                              # if n isn't in S, it's not in T, so 3-0: return 3
}

Kotlin, 176 154 bytes
Submission
{var l=it
var n=0
while(l>0){n++
val r=mutableListOf(1)
var t=3
var i=3
while(t<=l){r.add(t)
t+=i
i++}
l-=r.lastOrNull{l==it|| r.contains(l-it)}?:r[0]}
n}

Beautified
{
    // Make a mutable copy of the input
    var l=it
    // Keep track of the number of items removed
    var n=0
    // While we still need to remove pebbles
    while (l > 0) {
        // Increase removed count
        n++
        // BEGIN: Create a list of triangle numbers
        val r= mutableListOf(1)
        var t = 3
        var i = 3
        while (t<= l) {
            // Add the number to the list and calculate the next one
            r.add(t)
            t+=i
            i++
        }
        // END: Create a list of triangle numbers
        // Get the fitting pebble, or the biggest one if none fit or make a perfect gap
        l -= r.lastOrNull {l==it|| r.contains(l-it)} ?: r[0]
    }
    //Return the number of pebbles
    n
}

Test
var r:(Int)->Int =
{var l=it
var n=0
while(l>0){n++
val r=mutableListOf(1)
var t=3
var i=3
while(t<=l){r.add(t)
t+=i
i++}
l-=r.lastOrNull{l==it|| r.contains(l-it)}?:r[0]}
n}

data class TestData(val input:Int, val output:Int)

fun main(args: Array<String>) {
    val tests = listOf(
            TestData(1,1),
            TestData(2,2),
            TestData(3,1),
            TestData(4,2),
            TestData(5,3),
            TestData(6,1),
            TestData(7,2),
            TestData(8,3),
            TestData(9,2),
            TestData(10,1),
            TestData(11,2),
            TestData(12,2),
            TestData(13,2),
            TestData(14,3),
            TestData(15,1),
            TestData(16,2),
            TestData(17,3),
            TestData(18,2),
            TestData(19,3),
            TestData(20,2),
            TestData(100,2),
            TestData(101,2),
            TestData(5050,1)
    )
    tests.map { it to r(it.input) }.filter { it.first.output != it.second }.forEach { println("Failed for ${it.first}, output ${it.second} instead") }
}

TryItOnline

MATL, 15 bytes
`G:Ys@Z^!XsG-}@

Try it online!
Explanation
`         % Do...while
  G:      %   Push range [1 2 3 ... n], where n is the input
  Ys      %   Cumulative sum: gives [1 3 6 ... n*(n+1)/2]
  @Z^     %   Cartesian power with exponent k, where k is iteration index
          %   This gives a k-column matrix where each row is a Cartesian tuple
  !Xs     %   Sum of each row. Gives a column vector
  G-      %   Subtract input from each entry of that vector. This is the loop
          %   condition. It is truthy if it only contains non-zeros
}         % Finally (execute before exiting the loop)
  @       %   Push iteration index, k. This is the output
          % End (implicit). Proceeds with next iteration if the top of the
          % stack is truthy

Jelly, 15 bytes
0rSƤṗ⁸S⁼¥Ðf⁸ḢTL

Try it online!

JavaScript (ES6), 75 63 61 bytes
f=(n,x=y=0)=>y<n+2?x*x+y*y-8*n-2+!y?f(n,x<n+2?x+1:++y):2-!y:3

How?
We use the following properties:

According to Fermat polygonal number theorem, any positive integer can be expressed as the sum of at most 3 triangular numbers.
A number t is triangular if and only if 8t+1 is a perfect square (this can easily be proven by solving t = n(n+1) / 2).

Given a positive integer n, it's enough to test whether we can find:

x > 0 such that 8n+1 = x² (n itself is triangular)
or x > 0 and y > 0  such that 8n+2 = x²+y² (n is the sum of 2 triangular numbers)

If both tests fail, n must be the sum of 3 triangular numbers.
f = (n, x = y = 0) =>                 // given n and starting with x = y = 0
  y < n + 2 ?                         // if y is less than the maximum value:
    x * x + y * y - 8 * n - 2 + !y ?  //   if x² + y² does not equal 8n + 2 - !y:
      f(                              //     do a recursive call with:
        n,                            //       - the original input n
        x < n + 2 ? x + 1 : ++y       //       - either x incremented or
      )                               //         y incremented and x set to y
    :                                 //   else:
      2 - !y                          //     return either 1 or 2
  :                                   // else:
    3                                 //   return 3

Test cases

f=(n,x=y=0)=>y<n+2?x*x+y*y-8*n-2+!y?f(n,x<n+2?x+1:++y):2-!y:3

;[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 100, 101, 5050 ]
.forEach(n => console.log(n + ' --> ' + f(n)))


text:
Ethiopian Multiplication
This question is inspired by this answer. Coincidentally, I used to use Ethiopian Multiplication when I was a kid, but had never known the name of the method until recently.
Ethiopian multiplication is a method of multiplying integers using only addition, doubling, and halving.
Method:

Take two numbers to be multiplied and write them down at the top of two columns.
In the left-hand column repeatedly halve the last number, discarding any remainders, and write the result below the last in the same column, until you write a value of 1.
In the right-hand column repeatedly double the last number and write the result below. stop when you add a result in the same row as where the left hand column shows 1.
Examine the table produced and discard any row where the value in the left column is even.
Sum the values in the right-hand column that remain to produce the result of multiplying the original two numbers together.

For example: 17 x 34
17    34

Halving the first column:
17    34
 8
 4
 2
 1

Doubling the second column:
17    34
 8    68
 4   136
 2   272
 1   544

Strike-out rows whose first cell is even, we'll do this by encasing those numbers on the right in square brackets:
17    34
 8   [68]
 4  [136]
 2  [272]
 1   544

Sum the remaining numbers in the right-hand column:
17    34
 8   [68]
 4  [136]
 2  [272]
 1   544
    =====
     578

So 17 multiplied by 34, by the Ethiopian method is 578.
The Task:
Golf code that takes two numbers between 1 and 1000 and perform the same layout and algorithm, displaying the product below.
Input Method: However you choose...
Example Input:
19 427

Resulting Output:
19   427
 9   854
 4 [1708]
 2 [3416]
 1  6832
   ======
    8113

Please note the alignment of the digits. This is most important in the layout.
Also note that the double line laid out by equal signs must be two characters longer than the overall answer and must be centre justified.
Testing
How will you be testing this? By providing a run of your program using two numbers. These numbers can be extracted from your user ID number (this can be obtained by hovering your cursor over your avatar on the top window). Take your number and take the last three digits, this will be number B, take whatever else remains at the front, that will be number A. Then test for A times B.
Testing example:
My user ID number is 8555, so my numbers are 8 and 555. So my output should look like this:
8  [555]
4 [1110]
2 [2220]
1  4440
  ======
   4440

Restrictions:
No native multiplication operators permitted save for in the use of "doubling", as per mentioned in the algorithm. In other words, if you're using an operator like *, it can only be used for multiplying by 2 only.
Entries that do not adhere to this will not be considered and the user will be escorted off the premises with a cardboard box full of their belongings. Each entry will have code, plus the test based on your user ID number.
This is code golf. Shortest number of bytes will receive the prize, glory and admiration of their peers... (And maybe a Lamborghini... I said "maybe"!)

"No actual multiplication must take place." - This is unobservable. You may restrict using of some characters (like * or x), but it is impossible to detect if multiplication is used or not. Except that part, the challenge is interesting.

Maybe you should either ask for a full description of the code proving that the algorithm is implemented with no multiplication OR an unrestricted simulation that provides the desired output. But that looks like two distinct challenges to me.

As noted in the sandbox, related, possible dupe. @FelixPalmen, yes, this is long multiplication in binary.

Charcoal, 91 bytes
≔⟦⟧τ≔⁰σＮθＮηＷθ«⊞τ⪫  Ｉθ⊞υ⪫⎇﹪θ²  ¦[]Ｉη≔⁺σ∧﹪θ²ησ≔÷θ²θ≔⁺ηηη»⊞υ…=⁺²ＬＩσ⊞υ⪫  Ｉσ←Ｅ⮌τ⮌ιＭ⌈ＥυＬιＬυ←Ｅ⮌υ⮌ι

Try it online! Link is to verbose version of code. Explanation:
≔⟦⟧τ≔⁰σ

Sets t to the empty list and s to 0. (u already defaults to the empty list.)
ＮθＮη

Inputs the two numbers.
Ｗθ«

Repeats while q is nonzero.
   ⊞τ⪫  Ｉθ

Wrap q in padding and append it to the list t.
   ⊞υ⪫⎇﹪θ²  ¦[]Ｉη

Wrap h either in padding or [] depending on whether q is odd, and append it to the list u.
   ≔⁺σ∧﹪θ²ησ

Add h to s if q is odd.
   ≔÷θ²θ

Integer divide q by 2.
   ≔⁺ηηη»

Add h to itself.
⊞υ…=⁺²ＬＩσ

Append a suitable string of = signs to the list u.
⊞υ⪫  Ｉσ

Append the padded sum s to the list u.
←Ｅ⮌τ⮌ι

Rotate the list t by 180° and print it up-side down, thus right-justifying it.
Ｍ⌈ＥυＬιＬυ←Ｅ⮌υ⮌ι

Move the cursor so that when u is right-justified its top left corner lines up with the top-right corner we just reached, and print u right-justified.

Amazing work. You have the lead so far, @Neil. Where can I find out more about the language, is there a link?

@WallyWest The title is linked to the GitHub page and from there you can read the wiki for more information.

Python 2, 203 202 187 133 bytes
a,b=input()
s=0
while a:print'%3s%9s'%(a,'[ %%dd] '[a%2::2]%b);s+=[0,b][a%2];a/=2;b*=2
print'%10s==\n%11s'%(''.rjust(len(`s`),'='),s)

Try it online!
If I can use * for string multiplication ('='*R) and as a 'selector' (b*(a%2) instead of [0,b][a%2]), I get:
118 bytes
a,b=input()
s=0
while a:print'%3s%9s'%(a,'[ %%dd] '[a%2::2]%b);s+=a%2*b;a/=2;b*=2
print'%10s==\n%11s'%('='*len(`s`),s)

Try it online!

Explanation:
a,b=input()                   #Get input
L=len(`a`)                    #Get length of first number for adjusting text
l=[]                          #Output list
s=0                           #Sum
while a:
 B=['[%d]',' %d '][a%2]%b     #B is either '[b]' or ' b ' depending on if a is odd/even
 l+=[(`a`,B)]                 #Add a,B to output list
 s+=[0,b][a%2]                #Add b to sum if a is odd
 a/=2;                        #Halve a
 b*=2;                        #Double b
R=len(B)                      #Length of last B for adjusting output
l+=[('',''.rjust(R,'='))]     #Add double line ==== to output list
l+=[('','%d '%s)]             #Add sum to output list
for x,y in l:
 print x.rjust(L),y.rjust(R)  #Print adjusted numbers

189 bytes

Java (OpenJDK 8), 353 316 267 214 210 bytes
(a,b)->{int g=0;for(;a>0;g+=a%2*b,a/=2,b*=2)System.out.printf("%1$8d%2$10s\n",a,a%2<1?"["+b+"]":b+" ");System.out.printf("%1$19s%2$18s","".valueOf(new char[(int)Math.log10(g)+3]).replace("\0","=")+"\n",g+" ");}

Try it online!

214 bytes: (a,b)->{int g=0;for(;a>0;g+=a%2*b,a/=2,b*=2)System.out.printf("%1$8d%2$10s\n",a,a%2<1?"["+b+"]":" "+b+" ");System.out.printf("%1$19s%2$18s","".valueOf(new char[(int)Math.log10(g)+3]).replace("\0","=")+"\n",g+" ");}

@Nevay a%2*b nice and simple, thank you

Mathematica, 264 bytes
(s=#;k=(i=IntegerLength)@s;t=#2;w=0;P=Print;T=Table;While[s>0,If[OddQ@s,P[""<>T[" ",k-i@s],s,"  ",""<>T[" ",i[s(t)]-i@t],t];w=w+t,P[""<>T[" ",k-i@s],s,""<>T[" ",i[s(t)]-i@t]," [",t,"]"]];s=Quotient[s,2];t=2t];P[" "<>T[" ",k],""<>T["=",i@w+2]];P["  "<>T[" ",k],w])&

input

[19,427]

output
19   427
 9   854
 4 [1708]
 2 [3416]
 1  6832
   ======
    8113

You could probably save a whopping one byte by using infix notation on s=Quotient[s,2] :)

[Bash], 144 142 140 131 128 bytes
Better respect of display, note there is a trailing space character
read a b;for((;a;));{ ((a%2))&&((r+=b))&&x=$b\ ||x=[$b];printf %3s%9s\\n $a "$x"
((a/=2,b+=b));};printf %12s\\n =${r//?/=}= $r\

First answer
read a b;while((a));do ((a%2))&&((r+=b))&&printf "%6s  %6s
" $a $b||printf "%6s [%6s]
" $a $b;((a/=2,b+=b));done;printf "%6s %7s
" \  ==== \  $r

Perl 5, 157 bytes
155 bytes of code + 2 command line flags (-nl)
$\=<>;$w=y///c;$y=2+length$\<<((log)/log 2);while($_){$s+=$\if$_%2;printf"%${w}s %${y}s\n",$_,$_%2?$\.$":"[$\]";$_>>=1;$\<<=1}say$"x++$w,'='x$y;say$"x++$w,$s

Try it online!

C, C++, 319 313 301 299 bytes
-8 bytes thanks to Zacharý
Great thanks to printf magic i just learnt in 60 minutes between the edits
#include<string.h>
#include<stdio.h>
#define O printf("%*d %c%*d%c\n",5,a,a%2?32:91,9,b,a%2?32:93);
void m(int a,int b){int r=0,i=0;O while(a>1){r+=a%2*b;a/=2;b*=2;O}r+=b;char t[20],p[20];memset(t,0,20);memset(p,0,20);sprintf(t,"%d",r);memset(p,61,strlen(t)+2);printf("%*c%*s\n%*d",5,32,12,p,16,r);}

C++ optimization, replace header stdio.h by cstdio and string.h by cstring, saves 2 byte
Compilation with MSVC requires to add #pragma warning(disable:4996) in order to use sprintf
Testing with my PPCG ID :
72 x 535 =>
   72 [      535]
   36 [     1070]
   18 [     2140]
    9       4280
    4 [     8560]
    2 [    17120]
    1      34240
          =======
           38520

It respects the rules, digit are aligned, and the equal signs will always be 2 char larger than the final number. Example with 17 x 34 =>
   17         34
    8 [       68]
    4 [      136]
    2 [      272]
    1        544
            =====
             578

I think you can change the last two lines to #define O printf("%*d %c%*d%c\n",5,a,a%2?' ':'[',9,b,a%2?' ':']'); and void m(int a,int b){int r=0,i=0;O while(a>1){r+=a%2*b;a/=2;b*=2;O}r+=b;char t[20],p[20];memset(t,0,20);memset(p,0,20);sprintf(t,"%d",r);for(;i<strlen(t)+2;++i)p[i]='=';printf("%*c%*s\n%*d",5,' ',12,p,16,r);}

Yeah, I know that, but why does that matter?. Ad also, the precedence of % and * are the same, so r+=a%2*b should work.

@Zacharý in fact, i was wrong, you're right

Do you even need to include , can't you use the same trick you did here?

240 bytes

JavaScript 2017, 221 bytes
Mostly a problem of output formatting
(a,b)=>{for(t=b,r=0,l=[],w=`${a}`.length;a;l.push([a,t]),a>>=1,t+=t)z=`${r+=a&1&&t}`.length+2;P=(s,w)=>`${s}`.padStart(w);return[...l.map(([a,b])=>P(a,w)+P(a&1?b+' ':`[${b}]`,z+1)),P('='.repeat(z),z-~w),P(r,z+w)].join`
`}

Less golfed
(a, b) => {
  var w=`${a}`.length, r=0, l=[]
  while(a) {
    r += a&1 && b
    l.push([a,b])
    a >>= 1
    b += b
  }
  // algo complete, result in r, now display it and the steps in l[]
  var z=`${r}`.length+2
  var P= (s,w) => `${s}`.padStart(w)
  return [... l.map( ([a,b]) => P(a,w) + P(a&1?b+' ' : `[${b}]`, z+1) )
    , P('='.repeat(z), z+w+1)
    , P(r, z+w)
  ].join`\n`
}

Test

var F=
(a,b)=>{for(t=b,r=0,l=[],w=`${a}`.length;a;l.push([a,t]),a>>=1,t+=t)z=`${r+=a&1&&t}`.length+2;P=(s,w)=>`${s}`.padStart(w);return[...l.map(([a,b])=>P(a,w)+P(a&1?b+' ':`[${b}]`,z+1)),P('='.repeat(z),z-~w),P(r,z+w)].join`
`}

function update(){
  var i=I.value, [a,b]=i.match(/\d+/g)
  O.textContent=F(+a,+b)
}

update()
<input id=I value='21x348' oninput='update()'>

just revisiting this question... what's padStart do exactly? I don't recognize this method...

@WallyWest https://www.google.com/search?client=firefox-b-d&q=padStart

Would suck to be running this in IE! ;)

Haskell, 305 bytes
i=iterate
s=show
l=length.s
a!b=zip((takeWhile(>0).i(`div`2))a)(i(*2)b)
a?b=sum[y|(x,y)<-a!b,rem x 2>0]
a%b=l(snd.last$a!b)
a#b=unlines$[(' '<$[1..l a-l x])++s x++(' '<$[-1..a%b-l y])++if mod x 2<1then show[y]else(' ':s y)|(x,y)<-a!b]++map((++)(' '<$[-1..l a+a%b-l(a?b)]))['='<$[1..l a+1+a%b],' ':(s$a?b)]

Try it online!
The ! operator creates the two lists, ? computes the product. % and # are used for the ascii layout.

C, 205 201 190 183 156 150 143 bytes
This will compile with warnings as C89, & I don't believe it's valid C99, but it ends up being smaller than HatsuPointerKun's version, as it saves bytes by ommitting #include's, not using dynamic lengths to printf as they're unneeded, & using log10() to calculate the number of ='s needed:
r;m(a,b){r=0;while(a){printf(a%2?"%4d%10d\n":"%4d [%8d]\n",a,b);r+=a%2?b:0;a/=2;b<<=1;}printf("%15.*s\n%14d",(int)log10(r)+3,"==========",r);}

As my number is 64586, I used this test program to calculate 64 * 586:
#include <stdio.h>
int m(int a, int b);
int main(void)
{
    m(64, 586);
    putchar('\n');
}

& it outputs:
  64 [     586]
  32 [    1172]
  16 [    2344]
   8 [    4688]
   4 [    9376]
   2 [   18752]
   1     37504
        =======
         37504

edit
saved 4 bytes by the "implicit int" rule
edit 2
saved 11 bytes by changing to a do...while() loop & moving the printf into the loop from a macro.  Also should work correctly if a=1.
edit 3
saved 7 bytes & made the code work right.
edit 4
Saved 26 bytes with some printf trickery.
edit 5
saved 6 bytes by collapsing extra padding into 1 number.
edit 6
saved 7 bytes by printf trickery with the ternary operator & not declaring an unused variable

Great work, Justin! Look forward to seeing more from you in the weeks to come!

Thank you.  I hope to do more in the weeks to come, too.

Excel VBA, 183 172 bytes
An anonymous VBE immediate window function that takes input from range [A1:B1] and outputs to the console.
a=[A1]:b=[B1]:k="     ":While a:c=a Mod 2:?Right(k &a,2)Right(k &IIf(c,b &" ","["&b &"]"),7):s=s+IIf(c,b,0):a=a\2:b=b*2:Wend:?Right(k &String(Len(s)+2,61),9):?Right(k &s,9)

Ungolfed
Sub EthiopianMultiply(ByVal a As Integer, b As Integer)
    Const k As String = "     "
    While a
        Let c = a Mod 2
        Debug.Print Right(k & a, 2);
        Debug.Print Right(k & IIf(c, b & " ", "[" & b & "]"), 7)
        Let s = s + IIf(c, b, 0)
        Let a = a \ 2
        Let b = Int(b * 2)
    Wend
    Debug.Print Right(k & String(Len(s) + 2, 61), 9)
    Debug.Print Right(k & s, 9)
End Sub

Output
61   486
30  [972]
15  1944
 7  3888
 3  7776
 1 15552
  =======
   29646

Excel, 201 Bytes
An anonymous worksheet function that takes no input and outputs as plain text to the calling cell. Output is best viewed with word wrapping, a wide column width, and a monospace font on the calling cell.
Functions for all inputs such that \$(A<10^5)\land(B*2^{\lceil Log_2 A\rceil}<10^7)\$.
Golfed
=Let(s,"            ",z,2^Sequence(Log(A1,2)+1,,0),a,Int(A1/z),b,B1*z,c,Sum(IsOdd(a)*b),TextJoin("
",,Right(s&a,4)&Right(s&If(IsOdd(a),b&" ","["&b&"]"),8),Right(s&Rept("=",Len(c)+2),12),Right(s&c,11)))

Commented
=Let(s,"          ",                   ' Define var block, hold 10 spaces in s
    z,2^Sequence(Log(A1,2)+1,,0),      ' z=array of powers of 2
    a,Int(A1/z),                       ' a=⌊Input 1/z⌋            - left array
    b,B1*z,                            ' b=B1*2^{0...⌈log2(A1)⌉}  - ~right array
    c,Sum(IsOdd(A)*B),                 ' c=∑(If a(i)Is Odd b(i)) - Sum
    TextJoin("\n",,                    ' concat w. `\n` delimiter from below:
      Right(s&a,4)&	               ' `a` value, padded to 4 chars concat with
          If(IsOdd(a),b&" "," ["&b&"]")'     `b` value, wrapped in `[]` if `a` val is even
	Right(s&   ...,8),             '   padded to 8 chars
      Right(s&Rept("=",Len(c)+2),12),  ' the `=` line
      Right(s&c,11)))		       ' the sum

Output