1. ## numbers pattern

hello,

I am looking for some complicated pattern as output and there solution, can anyone know here where i can get these patterns

ex:--this is the simple one

1
1 2
1 2 3 4 5

but i want some complicated pattern and there solutions.

2. Huh?

actually these kind of questions comes in technical test. so i just wanted to see different patterns

4. What the hell... are you talking about

5. simshaun, if you don't understand leave it or ask properly. this forum is about to solve problems only,so one should get equal chance to ask the query, the way they are facing it. please use proper language here.

6. Perhaps simshaun posed the question poorly. In any case, I think perhaps deepson2 could have posed the question less ambiguously. My understanding is that deepson2 wants one or more PHP functions that model some classic mathematical series, for example, the fibonacci series:

Code:
```function fibonacci(\$terms = 20)
{
list(\$cur, \$nxt, \$inc, \$seq) = array(0, 1, 1, array());

do
{
\$inc++;
\$seq[] = \$cur;
\$cur = \$nxt;
}
while (\$inc <= \$terms);

return \$seq;
}

// First 50 terms in the fibonacci series
print_r(fibonacci(50));```

7. Originally Posted by deepson2
simshaun, if you don't understand leave it or ask properly. this forum is about to solve problems only,so one should get equal chance to ask the query, the way they are facing it. please use proper language here.
Perhaps you could try posting the question in a way that everyone can understand it... and by the way, my language is proper.

8. Thanks mmanders,

for understanding my question, you are right.you have written here function for fibonacci series like wise i was looking for different series.. Next time i will post my query with more proper description.

9. Deepson2, The issue is that the pattern you gave could have alot of different ways to accomplish it - and further down the sequence the outcomes can be very different.

Maybe it means for each new row, have the previous row count plus the total amount of existing numbers?

In which case the sequence would be, in a larger sense:
1
1 2
1 2 3 4 5
1 2 3 4 5 6 7 8 9 10 11 12 13
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34

Without knowing what you're actually looking for, it can be anyone's guess what the solution is

10. hey arkinstall, i am big fan of yours!!

actually i was showing one example like this. i think, my question was wrong.
now see, you have given the example of one sequence. so like that there are lots of series we can make. so i was just trying to ask here that can anyone knows more of diff series?

more ex:-
1
1 2

1 2 3

1 2

1

11. Originally Posted by deepson2
hey arkinstall, i am big fan of yours!!

actually i was showing one example like this. i think, my question was wrong.
now see, you have given the example of one sequence. so like that there are lots of series we can make. so i was just trying to ask here that can anyone no more of diff series?

more ex:-
1
1 2

1 2 3

1 2

1
For different kind of patterns there will be different functions and logic so i think you should post full details of series you would like to program with PHP

12. actually i am looking for different patterns only(may be with functions also). i know we can make it different patterns. but still if i get some pattern as example here that will be more appropriated.

13. Okkkk then.

Well, now you say it it's hard to think of any.

For the one you used:

PHP Code:
``` <?php function PrintPyramid(\$MaxNumber){     \$RowArray = Array();     For(\$i = 1; \$i <= \$MaxNumber; \$i++){         \$RowArray[] = range(1, \$i);     }     For(\$i -= 3; \$i >= 0; \$i--){         \$RowArray[] = \$RowArray[\$i];     }     ForEach(\$RowArray as \$Row){         echo implode("\t", \$Row) . '<br />';     } } PrintPyramid(40); ```

14. thanks for the code. but this is the function. i am looking for more patterns actually. but anyways, your code is helpful, with this i ll try different patterns by myself. thank you.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•