Message Boards Message Boards

GROUPS:

Trachtenberg Multiplication Rule

Posted 2 months ago
309 Views
|
0 Replies
|
4 Total Likes
|

In the movie "Gifted" (en.wikipedia.org/wiki/Gifted(2017film)) the seven year old girl Mary is doing mental arithmetic with the Trachtenberg system (en.wikipedia.org/wiki/Trachtenberg_system).

Here I show how to multiply a number of any length by 6 without actually multyplying by 6. This rule can by applied at a really early age. All numbers stay low and carry is 0 or 1. (There are rules for numbers from 1 to 12)

Rule: Take half of the neighbor, then, if the current digit is odd, add 5.

carryc[a_] := Block[{p = a, c = a, i, q, r},
  i = Length[p];
  While[i > 1, {q, r} = QuotientRemainder[p[[i]], 10]; p[[i]] = r; 
   c[[i]] = q; p[[i - 1]] = p[[i - 1]] + q; i = i - 1]; 
  p[[1]] = Mod[p[[1]], 10];
  c = RotateLeft[c]; c[[-1]] = 0;
  {p, c}]

multiplyingby6[a_] := With[{al = Join[{0}, IntegerDigits[a]]},
  Block[{ans, c}, {ans, c} = 
    carryc[al + Quotient[RotateLeft[al], 2] + 5 Mod[al, 2]];
   Print["Use the number add half the neighbor, add five if the \
number is odd."];
   Print[6 a]; If[ans[[1]] == 0, k = 1, k = 0];
   Grid[{Join[{"6 x"}, Drop[al, k]], 
     Join[{"Rule"}, 
      Drop[MapThread[
        If[#1 == 5, 
          Row[{#2, "+\[LeftFloor]", #3, "/2\[RightFloor]+", #1}], 
          Row[{#2, "+\[LeftFloor]", #3, 
            "/2\[RightFloor]"}]] &, {5 Mod[al, 2], al, 
         RotateLeft[al]}], k]], Join[{"Carry"}, Drop[c, k]], 
     Join[{"Ans"}, Drop[ans, k]]}, Frame -> All, 
    ItemStyle -> {Directive[18, Blue, FontFamily -> "Ink Free"], 
      None}, Background -> {None, {{LightGreen, LightYellow, LightRed,
         LightGreen}}}]]]

Example 1 (only even digits):

multiplyingby6[624]

enter image description here

Example 2 (some odd digits):

multiplyingby6[615]

enter image description here

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract