#Octave, (削除) 49 (削除ここまで) 47 bytes
Octave, (削除) 49 (削除ここまで) 47 bytes
Just calculating the gcd of all pairs and counting.
@(n)mean(mean(gcd(c=kron(ones(n,1),1:n),c')<2))
The kronecker product is awesome.
#Octave, (削除) 49 (削除ここまで) 47 bytes
Just calculating the gcd of all pairs and counting.
@(n)mean(mean(gcd(c=kron(ones(n,1),1:n),c')<2))
The kronecker product is awesome.
Octave, (削除) 49 (削除ここまで) 47 bytes
Just calculating the gcd of all pairs and counting.
@(n)mean(mean(gcd(c=kron(ones(n,1),1:n),c')<2))
The kronecker product is awesome.