Can someone figure out the formula of this sequence?

yellowcakepie
I needed help figuring out the formula for a sequence with these conditions:
1. The first term is 1.
2. All terms are positive integers.
3. 3 times each term (3*a_n) must be greater than the sum of that term and all the terms before it, but no more than 3 greater.

Operators like ceil() and floor() are probably needed, but I'm not certain.
 
Last edited by a moderator:
Physics news on Phys.org
Did you find some elements manually? That will give an idea how a general formula might look like.

http://oeis.org can help as well if you have some elements.Edit: I moved the thread to our homework section.
 
Last edited:
  • Like
Likes yellowcakepie and arivero
yellowcakepie said:
4. Operators like ceil() and floor() are probably needed.
I think you are wrong in this point, note that there are no floats here, and you are not asking for an approximation.
so perhaps you are confused because you are looking how to use them... I mean, you can always use conditionals or so.
 
mfb said:
Did you find some elements manually? That will give an idea how a general formula might look like.

Yeah, I know a few terms of it.

1, 1, 2, 3, 4, 6, 10

On OEIS, it seems like this formula follows A130126, which seems quite complicated.

sqrt(Pi^2/2 + 4*log(phi)^2) * exp(sqrt((Pi^2 + 8*log(phi)^2)*(n/2))) / (4*Pi*n)
where phi is the golden ratio (1+sqrt(5))/2.

I'll check on this later. Thank you!
 
I still do not get your condition,
"3 times each term (3*a_n) must be greater than the sum of that term and all the terms before it", ok
3 a_n > a_1+... + a_n
"but no more than 3 greater."
?? What does that mean? 3 (a_1+...+a_n) > 3 a_n ?
 
arivero said:
I still do not get your condition,
"3 times each term (3*a_n) must be greater than the sum of that term and all the terms before it", ok
3 a_n > a_1+... + a_n
"but no more than 3 greater."
?? What does that mean? 3 (a_1+...+a_n) > 3 a_n ?

That means a_n must be the smallest integer possible where 3*a_n is still greater than ∑a_i from i=1 to i=n. So 3 >= 3*a_n - ∑a_i from i=1 to i=n > 0.
Sorry, I don't know how to format on this forum...

Using the sequence I wrote above, we can test it and use it as an example:
a_7 = 10. That means 3*a_7 = 30. It must be greater than the sum of itself and all the terms before it, but no more than 3 greater.

30 - (1 + 1 + 2 + 3 + 4 + 6 + 10) = 30 - (27) = 3, which is less than or equal to 3, so it is the only correct term for a_7. It cannot be any other number.
 
Do you have to find an explicit formula (you have one, it is just messy) or is a recursive formula sufficient?
 
maybe solve a simpler problem first?

your condition that

##3 a_n \gt \sum_{i=1}^n a_i##

can be more simply written as

##2 a_n \gt \sum_{i=1}^{n-1} a_i##

For example: the simpler problem would be: ##a_n \gt \sum_{i=1}^{n-1} a_i##

This suggests a sequence of doubling.

e.g. 1, 2, 4, 8, 16, 32...
 
mfb said:
Do you have to find an explicit formula (you have one, it is just messy) or is a recursive formula sufficient?

I plugged the explicit formula into a sequence plotter, but every term is a noninteger, and does not match my calculations for the first 7 terms. Very strange.

A recursive formula is okay as well.
 
  • #10
yellowcakepie said:
A recursive formula is okay as well.
That is much easier to find. If you have the first n values, can you write an equation including the next one? Or maybe inequalities first?
 
  • #11
mfb said:
That is much easier to find. If you have the first n values, can you write an equation including the next one? Or maybe inequalities first?

I think I already found it, but it's a little inconsistent.

a(n) = 1.5(a(n-1)-a(n-2)) + a(n-1)

Sometimes it is a decimal, 1 too high, or 1 too low.
 
  • #12
I get a different sequence, for example, 9 is the smallest number where 3x9 > sum {1,1,2,3,4,6,9}.

Code:
sequence: 1   1   2   3   4   6   9  14  21  31  47  70 105 158 237
sum:      1   2   4   7  11  17  26  40  61  92 139 209 314 472 709

There's a formula for the sum. I don't know if this could be converted into a formula for the sequence.

Code:
sum[i] = 1+⌊3(sum[i-1])/2⌋
seq[i] = sum[i]-sum[i-1]
 
Last edited:
  • #13
yellowcakepie said:
I needed help figuring out the formula for a sequence with these conditions:
1. The first term is 1.
2. All terms are positive integers.
3. 3 times each term (3*a_n) must be greater than the sum of that term and all the terms before it, but no more than 3 greater.

Operators like ceil() and floor() are probably needed, but I'm not certain.

People have asked you about the following, but you have refused to answer. Does the second condition mean
$$\text{(1) this:}\;\;\; 3a_n \leq \sum_{i=1}^n a_i + 3 $$
or
$$\text{(2) this:} \;\; 3 a_n \leq 3 \sum_{i=1}^n a_i?$$
Just tell us if it is (1) or (2).
 
  • #14
Ray Vickson said:
People have asked you about the following, but you have refused to answer. Does the second condition mean ...
I suggest changing the third condition to the smallest integer ##a_n## such that
$$3\ a_n \gt \sum_{i=1}^n a_i$$
or to "no more than 2 greater":
$$\sum_{i=1}^n a_i \lt \ 3\ a_n \le 2 \ + \ \sum_{i=1}^n a_i$$
Either of these conditions will produce the same sequence, and this eliminates the issue where the 7th term could be either 9 or 10.
 
Last edited:
  • #15
rcgldr said:
I get a different sequence, for example, 9 is the smallest number where 3x9 > sum {1,1,2,3,4,6,9}.

Code:
sequence: 1   1   2   3   4   6   9  14  21  31  47  70 105 158 237
sum:      1   2   4   7  11  17  26  40  61  92 139 209 314 472 709

There's a formula for the sum. I don't know if this could be converted into a formula for the sequence.

Code:
sum[i] = 1+⌊3(sum[i-1])/2⌋
seq[i] = sum[i]-sum[i-1]
Yeah, the sequence you made is correct. I screwed up some arithmetic when I was just trying to write my reply.
 
  • #16
Ray Vickson said:
People have asked you about the following, but you have refused to answer. Does the second condition mean
$$\text{(1) this:}\;\;\; 3a_n \leq \sum_{i=1}^n a_i + 3 $$
or
$$\text{(2) this:} \;\; 3 a_n \leq 3 \sum_{i=1}^n a_i?$$
Just tell us if it is (1) or (2).

(1), I think I answered that question a while ago with a reply to someone else.
 
  • #17
Looks like there no way to avoid having some type of second variable in order to generate this series:

https://oeis.org/A005428

Maybe the original third condition where 3an is no more than 3 greater as opposed to no more than 2 greater allows a single variable formula to be used for a different series, although with the condition being no more than 3 greater allows for variations, such at the 7th element being either 9 or 10.
 
Last edited:
  • #18
rcgldr said:
Looks like there no way to avoid having some type of second variable in order to generate this series:

https://oeis.org/A005428
Some observations...

Asymptotically, the ratio of consecutive terms must converge to 3/2.
It seems that for pairs in which the first is even the ratio is exact; where the first term is odd, it alternately rounds up and rounds down. E.g. 1 to 2 rounds up, 3 to 4 rounds down, 9 to 14 rounds up, 21 to 31 rounds down...
If that last observation could be characterised in terms of the value of the first of the pair (e.g. its value mod something) then the recurrence relation could be written without a summation.

Edit:
Looks like I have come close to characterising the rounding.
If a term is even, next term is exactly 3/2 times it, else
if it is 2, 3 or 5 mod 9 then round up, else
round down.
This works for the first 53 terms, but the 54th rounds the wrong way.

Curiously, no odd terms are 8 mod 9.
 
Last edited:

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
Replies
8
Views
1K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 12 ·
Replies
12
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 8 ·
Replies
8
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K