This is the car sale and the cars are arranged according to the pascal's Traingle.
1 0 0 0 0
1 1 0 0 0
1 2 1 0 0
1 3 3 1 0
1 4 6 4 1
Pattern like this so the car number is given like
n=10;
So,you have to create a pascal's traingle and add the numbers and you have to add like this:-
1 0 0 0 0
1 1 0 0 0
1 2 1 0 0
1 3 3 1 0
1 4 6 4 1
%You have to add the numbers on the traingle except the 0 and you will get a matrix like:-
1 0 0 0 0
2 3 0 0 0
4 6 7 0 0
8 11 14 15 0
16 20 26 30 31
So the number of the vehicle is given accoring to only positive numbers not 0 (Don't recognize zero when counting the vehical number!)
Following functions are not allowed!:-every function except eye,find,size
You have to output the pascal's traingle number you summed up on that particular row and column like
%if I asked
%input
n=10;
%Output Should be:-
y=15;
Wishing You luck!
Solution Stats
Problem Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers6
Suggested Problems
-
Find the longest sequence of 1's in a binary sequence.
6810 Solvers
-
7481 Solvers
-
506 Solvers
-
Sum of odd numbers in a matrix
620 Solvers
-
Find out total non zero element of matrix
287 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!