Problem 49778. Determine whether a number is a prime self number
Solution Stats
Problem Comments
-
2 Comments
J.R.! Menzinger
on 4 Aug 2021
Nice Problem!
but I found remarkable your syntax on test case Nr. 27:
a = arrayfun(@(k) isPrimeSelf(n(k)),1:length(n));
if you use 'arrayfun' you can actually parse the vector directly and you can avoid parsing the indices. The following expression would be more narrow:
a = arrayfun(@isPrimeSelf,n)
ChrisR
on 28 Aug 2021
Thanks for pointing that out. I've made the change.
Problem Recent Solvers11
Suggested Problems
-
Extract leading non-zero digit
1721 Solvers
-
387 Solvers
-
Fermat's Last Theorem - Fermat's conjecture
89 Solvers
-
Create the following sequence : 0 1 1 4 9 25 64 169 ...
120 Solvers
-
6510 Solvers
More from this Author185
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!