For e.g. any range of number 0 – n
[ 0, 1, 2, 3, 4, 5, 6 ]
to:
[ 0, 2, 4, 6, 4, 2, 0 ]
IS there a formula to calculate the first into the second? Quadratic?
Is there a name for this kind of formula or calculation?
EDIT: This should be in Javascript
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I don’t know what you mean by “quadratic-like” but the following javascript program prints something which looks like your sequence:
Output: