Problem 1096. Largest Twin Primes
Solution Stats
Problem Comments
Solution Comments
-
1 Comment
Mattias
on 1 Jan 2015
Was able to reduce size a few times and finally got to this solution by borrowing tricks used by Grzegorz Knor and Dan.
-
2 Comments
Ryan
on 5 Dec 2012
Tim,
Can you explain what the +'01'-'0' is doing? I don't see how i+'01'-'0'=[i,i+1].
Thanks
J.R.! Menzinger
on 6 Dec 2012
'01 ' is a char vector of 2 positions: '0' ans '1'.
If you subtract '0' to it, it results a char vector with characters 0 and 1.
So '01'-'0' is the same as [0 1], but because of the '[]', it cost less operations.
Problem Recent Solvers385
Suggested Problems
-
Make the vector [1 2 3 4 5 6 7 8 9 10]
41406 Solvers
-
Back to basics 9 - Indexed References
412 Solvers
-
Set some matrix elements to zero
355 Solvers
-
374 Solvers
-
Deleting an element in a matrix
411 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!