list-array construction
As you see from the comments and answers, the natural way to do it in Mathematica is to create a 2D array and then flatten it. A couple more examples of that approach:
Flatten[Table[i, {i, 4}, 4]]
Flatten[Array[# &, {4, 4}]]
For this specific case you could also do something like:
Ceiling[Range[16]/4]
You can also interpret this as an outer product:
Outer[Times, Range[4], ConstantArray[1, 4]] // Flatten
{1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4}
You can also use the 4-argument form of Array
:
Array[# &, {4, 4}, 1, Flatten @* List]
{1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4}
Array[Range @ 4 &, 4, 1, Sort @* Join]
{1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4}
Array[{1, 0, 0, 0} &, 4, 1, Accumulate @* Join]
{1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4}
And few additional methods:
Round[1/2 + 6 Range[16]/25]
Sort @ Mod[Range @ 16, 4, 1]
Join @@ Table @@@ Table[{i, 4}, {i, 4}]
1 + ⌊Most @ Subdivide[4, 16]⌋
Join @@ Accumulate @ Table[1, 4, 4]
Accumulate @ Upsample[{1, 1, 1, 1}, 4] (*thanks: Simon Woods *)
⌈ArrayResample[Range@4, 16, {"Bin", 1}]⌉
Internal`RepetitionFromMultiplicity @ Thread[{Range @ 4, 4}]