+ 10
New Challenge Numbers Pattern
Try to develop a code in any language which calculate that numbers pattern and complete each row until five numbers per row 1-2-5-27- 2-3-11- 3-4-19- 4-5-29- 5-6-41- Good Luck!!!
13 odpowiedzi
+ 21
at least 2 full rows must be provided to identify the pattern correctly
//bcz 27 can also be brought by 5^2 + 2 or 2^5 - 5 any many other thousands of ways
+ 7
Shelly Kapoor
The game here is actually to try to understand it ... try to find a general way to get the next item in a line.
+ 6
https://code.sololearn.com/cWC6CH5gByHd/?ref=app
Here is my try :)
+ 5
I may be dumb but the pattern is not clear at all to me
+ 5
https://code.sololearn.com/W7g7xdEtHcAY/?ref=app
Thanku dear,you had brush up my concepts
+ 5
😊😊
+ 4
I get it
+ 3
I don't understand the patterns
+ 2
Is part of the challenge ;-)
+ 2
Well, I tried to fix some things.
You have to increase n by 1 every time.
Also ** doesn't exist in JS, you must to use Math.pow(base, exponent)
And then when you print in console you have to get back the pattern_5 to an empty list :)
Here is the new part of the code to help to you
pattern_5.push(Math.pow(pattern_5[n],2)+pattern_5[n-1]);
n = 1+n;
}
console.log(pattern_5);
pattern_5 = [];
}