I'm trying to work out a formula to produce the number sequence starting with
1,3,10,35, 126 ...
I can't work it out even after a nice bottle of wine!
numerical sequence
numerical sequence
Windows 11, Manjaro, Raspberry Pi OS


Re: numerical sequence
Are those the only numbers you have got or do you have a few numbers more of the sequence ?
-
MachineCode
- Addict

- Posts: 1482
- Joined: Tue Feb 22, 2011 1:16 pm
Re: numerical sequence
Lots of Google hits for that number sequence... does this help? -> http://oeis.org/A001700
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
PureBasic: Born in 1998 and still going strong to this very day!
- Michael Vogel
- Addict

- Posts: 2867
- Joined: Thu Feb 09, 2006 11:27 pm
- Contact:
Re: numerical sequence
Hi,
for such sequences, you can produce any number of formulas you like (what also means, that it is impossible to get a single solution for the following number).
A simple possibility to calculate a simple polynom is to think about using the given values as points (1|1, 2|3, 3|10, 4|35, 5|126) and create a matrix to solve all given equations...
I downloaded a tool "Eigenmath" which is available for Mac and Windows PC's and wrote a short script to simplify the whole story (press 'edit script', paste the following lines and then click on 'run script')..
The result means y=26-655/12*x+973/24*x^2-149/12*x^3+35/24*x^4, which gives correct solutions for the given values. You can also calculate the next value by using Eigenmath, just enter x=6 and then 26-655/12*x+973/24*x^2-149/12*x^3+35/24*x^4 into the command line.
for such sequences, you can produce any number of formulas you like (what also means, that it is impossible to get a single solution for the following number).
A simple possibility to calculate a simple polynom is to think about using the given values as points (1|1, 2|3, 3|10, 4|35, 5|126) and create a matrix to solve all given equations...
I downloaded a tool "Eigenmath" which is available for Mac and Windows PC's and wrote a short script to simplify the whole story (press 'edit script', paste the following lines and then click on 'run script')..
Code: Select all
b=(1,3,10,35,126)
n=dim(b)
A=zero(n,n)
for(i,1,n,for(j,1,n,A[i,j]=i^(j-1)))
v=dot(inv(A),b)
vRe: numerical sequence
thanks guys
It was a pattern I noticed looking at an ascending sorted list of n elements.
the number of 1's = the number of permutations for the given number of n
2/3 3/10 ....
11 111
12 112
22 113
122
123
133
...
machinecode, thanks for the link that helps explains it
wilbert, yes I gave up after 5/126
Michael - thanks that will be helpful
It was a pattern I noticed looking at an ascending sorted list of n elements.
the number of 1's = the number of permutations for the given number of n
2/3 3/10 ....
11 111
12 112
22 113
122
123
133
...
machinecode, thanks for the link that helps explains it
wilbert, yes I gave up after 5/126
Michael - thanks that will be helpful
Windows 11, Manjaro, Raspberry Pi OS



