2
$\begingroup$
ab = DisplayForm[
  GridBox[Flatten /@ 
    Transpose@
     Partition[
      Table[{n, 
        FactorInteger[n] /. List[p_Integer, 0] :> HoldForm[p] /. 
           List[p_Integer, k_Integer] :> HoldForm[p^k] /. 
          List[x__] :> Times@x /. {} -> 1}, {n, 1, 256}], 16], 
   GridFrame -> True, RowLines -> True, ColumnLines -> True]]

result image enter image description here

result that I hope enter image description here

How to I divide 256 by pieces of four of horizontal 4 * vertical 16?

$\endgroup$
  • $\begingroup$ mathworld.wolfram.com/notebooks/PrimeNumbers/… $\endgroup$ – jlptrbsa Jan 18 '15 at 23:09
  • $\begingroup$ You edited your desired result to look different than it did. You want to print a series of "tables" down the page? $\endgroup$ – Mr.Wizard Jan 18 '15 at 23:32
  • $\begingroup$ Yes. I wish result of i.stack.imgur.com/qhRGq.png $\endgroup$ – jlptrbsa Jan 18 '15 at 23:34
  • $\begingroup$ Please edit the Answer. I wait for edited Answer. $\endgroup$ – jlptrbsa Jan 19 '15 at 0:25
  • $\begingroup$ Okay. People on this site answer questions voluntarily on their own time, therefore you should be patient. I shall revise my answer when I get around to it. $\endgroup$ – Mr.Wizard Jan 19 '15 at 0:29
4
$\begingroup$

New answer

Here is a modularized method. The first function is from Trying to write out the prime factorization of a number with CenterDot and Superscript, slightly modified.

Format[primeFactorForm[n_Integer]] := 
  Times @@ Superscript @@@ FactorInteger[n] /. _[x_] :> x

block[n_Integer] :=
  Join @@@ Array[{#, primeFactorForm@#} &[# + 16*#2] &, {16, 4}, {64 n - 63, 0}]

grid[m_?MatrixQ] := 
  With[{th = AbsoluteThickness[3]}, Grid[m, Dividers -> ({#, #} &@{th, {True}, th})]]

Array[grid @ block @ # &, 4] // Column

enter image description here


Old answer for original example

There is probably a cleaner way to write this but here's a start for you:

tab = Table[{n, 
    FactorInteger[n] /. List[p_Integer, 0] :> HoldForm[p] /. 
       List[p_Integer, k_Integer] :> HoldForm[p^k] /. List[x__] :> Times@x /. {} -> 
      1}, {n, 1, 256}];

eight   = Prepend[Table[True, {7}], AbsoluteThickness[3]];

sixteen = Prepend[Table[True, {15}], AbsoluteThickness[3]];

Grid[Flatten /@ Transpose@Partition[tab, 16], Dividers -> {{eight}, {sixteen}}, 
 ItemSize -> Full]
$\endgroup$
  • $\begingroup$ This looks really fun! $\endgroup$ – Chen Stats Yu Jan 19 '15 at 0:57
  • $\begingroup$ @ChenStatsYu :-P $\endgroup$ – Mr.Wizard Jan 19 '15 at 1:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.