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.
Roll the Dice!
Square Digits Number Chain Terminal Value (Inspired by Project Euler Problem 92)
Find out missing number from a vector of 9 elements
Golomb's self-describing sequence (based on Euler 341)
Chebyshev polynomials of the 2nd Kind
Test approximations of the prime counting function
Create a sequence of primes p such that p > n π(p)
List prime anagrams of a number
Compute the nth Pythagorean prime
Find the treasures in MATLAB Central and discover how the community can help you!
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office