2
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?

m_goldberg
  • 107,779
  • 16
  • 103
  • 257
jlptrbsa
  • 41
  • 3

1 Answers1

4

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]
Mr.Wizard
  • 271,378
  • 34
  • 587
  • 1,371