Problem 2342. Numbers spiral diagonals (Part 2)
23.74% Correct | 76.26% Incorrect
Last Solution submitted on Mar 14, 2023
Christian Schröder on 26 Sep 2022
Interesting problem! If I'm not mistaken, your description of the problem is not entirely accurate, however. For n = 1, the spiral matrix is just [ 1 ], for which the share of primes on the main diagonals is zero, below any given 0 < p < 1; so strictly speaking the correct answer to the problem as posed would be 1 for any p.
Dyuman Joshi on 26 Sep 2022
Nice observation, @Christian!
I have edited the question statement, it (now) asks for an odd integer greater than 1.
Problem Recent Solvers109
Find nearest prime number less than input number
Calculate the Number of Sign Changes in a Row Vector (No Element Is Zero)
Is this is a Tic Tac Toe X Win?
More from this Author43
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!