Problem 49778. Determine whether a number is a prime self number
Solution Stats
Problem Comments
-
2 Comments
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)
Thanks for pointing that out. I've made the change.
Solution Comments
Show commentsProblem Recent Solvers13
Suggested Problems
-
Find the peak 3n+1 sequence value
2167 Solvers
-
given 3 sides, find area of this triangle
786 Solvers
-
Calculate the area of a triangle between three points
2487 Solvers
-
Right Triangle Side Lengths (Inspired by Project Euler Problem 39)
1507 Solvers
-
Replace secondary diagonal elements of a square array
152 Solvers
More from this Author231
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!