MATL, 22 bytes
1e6HiI$YrZ1e6Hi3$YrZ}Zd1=Ym6w/X^
1e6 % Push 1e6
H % Push 2
i % PusnPush input, N
I$Yr3$Yr % ×ばつN matrix of uniformly random integer values between 1 and 1e6
Z} % Split ontointo its two rows. Gives two ×ばつN arrays
Zd % GCD, element-wise. Gives a ×ばつN array
1= % Compare each entry with 1. Sets 1 to 0, and other values to 0
Ym % Mean of the array
6w/ % 6 divided by that
X^ % Square root. Implicitly display
MATL, 22 bytes
1e6HiI$YrZ}Zd1=Ym6w/X^
1e6 % Push 1e6
H % Push 2
i % Pusn input, N
I$Yr % ×ばつN matrix of uniformly random integer values between 1 and 1e6
Z} % Split onto its two rows
Zd % GCD, element-wise
1= % Compare each entry with 1. Sets 1 to 0, and other values to 0
Ym % Mean of the array
6w/ % 6 divided by that
X^ % Square root. Implicitly display
MATL, 22 bytes
1e6Hi3$YrZ}Zd1=Ym6w/X^
1e6 % Push 1e6
H % Push 2
i % Push input, N
3$Yr % ×ばつN matrix of uniformly random integer values between 1 and 1e6
Z} % Split into its two rows. Gives two ×ばつN arrays
Zd % GCD, element-wise. Gives a ×ばつN array
1= % Compare each entry with 1. Sets 1 to 0, and other values to 0
Ym % Mean of the array
6w/ % 6 divided by that
X^ % Square root. Implicitly display
MATL, 2122 bytes
6iH1e6I$YrZ1e6HiI$YrZ}Zd1=YmZd1=Ym6w/X^
6 1e6 % Push 6
i % Input N1e6
H % Push 2
1e6i % PushPusn 1e6input, N
I$Yr % ×ばつ1e6×ばつN matrix of uniformly random integer values between 1 and N1e6
Z} % Split onto its two rows
Zd % GCD, element-wise
1= % Compare each entry with 1. Sets 1 to 0, and other values to 0
Ym % Mean of the array
6w/ % Divide 6 bydivided theby resultthat
X^ % Square root. Implicitly display
MATL, 21 bytes
6iH1e6I$YrZ}Zd1=Ym/X^
6 % Push 6
i % Input N
H % Push 2
1e6 % Push 1e6
I$Yr % ×ばつ1e6 matrix of uniformly random integer values between 1 and N
Z} % Split onto its two rows
Zd % GCD, element-wise
1= % Compare each entry with 1. Sets 1 to 0, and other values to 0
Ym % Mean of the array
/ % Divide 6 by the result
X^ % Square root. Implicitly display
MATL, 22 bytes
1e6HiI$YrZ}Zd1=Ym6w/X^
1e6 % Push 1e6
H % Push 2
i % Pusn input, N
I$Yr % ×ばつN matrix of uniformly random integer values between 1 and 1e6
Z} % Split onto its two rows
Zd % GCD, element-wise
1= % Compare each entry with 1. Sets 1 to 0, and other values to 0
Ym % Mean of the array
6w/ % 6 divided by that
X^ % Square root. Implicitly display
MATL, 21 bytes
6iH1e6I$YrZ}Zd1=Ym/X^
6 % Push 6
i % Input N
H % Push 2
1e6 % Push 1e6
I$Yr % ×ばつ1e6 matrix of uniformly random integer values between 1 and N
Z} % Split onto its two rows
Zd % GCD, element-wise
1= % Compare each entry with 1. Sets 1 to 0, and other values to 0
Ym % Mean of the array
/ % Divide 6 by the result
X^ % Square root. Implicitly display
MATL, 21 bytes
6iH1e6I$YrZ}Zd1=Ym/X^
6 % Push 6
i % Input N
H % Push 2
1e6 % Push 1e6
I$Yr % ×ばつ1e6 matrix of uniformly random integer values between 1 and N
Z} % Split onto its two rows
Zd % GCD, element-wise
1= % Compare each entry with 1. Sets 1 to 0, and other values to 0
Ym % Mean of the array
/ % Divide 6 by the result
X^ % Square root. Implicitly display
Loading