1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Can someone figure out the formula of this sequence?

  1. Oct 20, 2017 #1
    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: Oct 20, 2017
  2. jcsd
  3. Oct 20, 2017 #2

    mfb

    User Avatar
    2016 Award

    Staff: Mentor

    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: Oct 21, 2017
  4. Oct 20, 2017 #3

    arivero

    User Avatar
    Gold Member

    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.
     
  5. Oct 20, 2017 #4
    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!
     
  6. Oct 20, 2017 #5

    arivero

    User Avatar
    Gold Member

    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 ?
     
  7. Oct 20, 2017 #6
    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.
     
  8. Oct 20, 2017 #7

    mfb

    User Avatar
    2016 Award

    Staff: Mentor

    Do you have to find an explicit formula (you have one, it is just messy) or is a recursive formula sufficient?
     
  9. Oct 20, 2017 #8

    StoneTemplePython

    User Avatar
    Gold Member

    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...
     
  10. Oct 20, 2017 #9
    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.
     
  11. Oct 24, 2017 #10

    mfb

    User Avatar
    2016 Award

    Staff: Mentor

    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?
     
  12. Oct 24, 2017 #11
    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.
     
  13. Oct 25, 2017 #12

    rcgldr

    User Avatar
    Homework Helper

    I get a different sequence, for example, 9 is the smallest number where 3x9 > sum {1,1,2,3,4,6,9}.

    Code (Text):

    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 (Text):

    sum[i] = 1+⌊3(sum[i-1])/2⌋
    seq[i] = sum[i]-sum[i-1]
     
     
    Last edited: Oct 25, 2017
  14. Oct 25, 2017 #13

    Ray Vickson

    User Avatar
    Science Advisor
    Homework Helper

    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).
     
  15. Oct 25, 2017 #14

    rcgldr

    User Avatar
    Homework Helper

    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: Oct 25, 2017
  16. Oct 26, 2017 #15
    Yeah, the sequence you made is correct. I screwed up some arithmetic when I was just trying to write my reply.
     
  17. Oct 26, 2017 #16
    (1), I think I answered that question a while ago with a reply to someone else.
     
  18. Oct 26, 2017 #17

    rcgldr

    User Avatar
    Homework Helper

    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: Oct 26, 2017
  19. Oct 29, 2017 #18

    haruspex

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member
    2016 Award

    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: Oct 29, 2017
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted



Similar Discussions: Can someone figure out the formula of this sequence?
  1. I can't figure it out (Replies: 1)

Loading...