首页 > 代码库 > Prime Numbers in a Grid素数网格

Prime Numbers in a Grid素数网格

&/@ Shorthand notation for Map

If[PrimeQ[#], Framed@Style[#, Orange, Bold, 15], #] & /@ Range[250]

Grid@Partition[If[PrimeQ[#],
Tooltip[Framed@Style[#, Orange, Bold, 15], "Prime!"], #] & /@Range[250],
10]

 

Prime Numbers in a Grid素数网格