Home > Mobile >  What sort of Math series is this, what's the equation?
What sort of Math series is this, what's the equation?

Time:01-09

I'm not able to figure out what the actual formula or name for this series is:

3 : 5; 4 : 10 ; 5 : 15; etc..

Here is the code:

        i = 4
        n = 2
        while i <= granularity and i != 3:
            if (i == granularity):
                return 5 * n

            n  = 1
            i  = 1
        return 5

HERE IS MORE OF THE CODE I USED TO SOLVE THIS SERIES:

    def getChartData(self, sym, timescale="last_day", intraday="Y", granularity="3", ytdate="False", extdhrs="n"):
    dateMin = ""
    dateMax = ""
    alt = "hi" if timescale == "last_hi" else "lo" if timescale == "last_lo" else "cl" if timescale == "last_cl" else ""
    href = ""
    content = ""
    sorted_content = {}

    def granFac():
        gran = int(granularity)
        i = 4
        n = 2
        while i <= gran and i != 3:
            if (i == gran):
                return (dt.now() - td(minutes=(5 * n))).strftime("%Y/%m/%d-%H:%M:%S")

            n  = 1
            i  = 1
    
    return (dt.now() - td(minutes=5)).strftime("%Y/%m/%d-%H:%M:%S")

CodePudding user response:

The sequence 5, 10, 15, 20, 25, 30, ... can be described as an arithmetic sequence.

  •  Tags:  
  • Related