+ Reply to Thread
Results 1 to 3 of 3

Reverse Triangle Number Algorithm

  1. #1
    Registered User
    Join Date
    12-24-2014
    Location
    Utrecht, Netherlands
    MS-Off Ver
    2010
    Posts
    4

    Question Reverse Triangle Number Algorithm

    Hi, can anyone help me reverse the Triangle Number algorithm please? The Triangle Number algorithm is A1*(A1+1)/2. This returns a cumulative result of 1, 3, 6, 10, 15, 21, etc...

    I need to reverse this... I have the number 21 and need to get the number 6 out of it (without a long string of if-then statements of course). Obviously the easiest way is to make it a Square Number first (and get the square root), so have to make that 21 a 36 first with the same algorithm that makes the 15 into a 25. At least, that seems the most obvious way... :/

  2. #2
    Registered User
    Join Date
    12-24-2014
    Location
    Utrecht, Netherlands
    MS-Off Ver
    2010
    Posts
    4

    Re: Reverse Triangle Number Algorithm

    I should comment that I'm currently using this algorithm, though it comes up with the right results, it only does so due to the rounding down as it generally returns a result of about 0.48 over the actual number.

    =ROUNDDOWN(SQRT(A1*2),0)

  3. #3
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,515

    Re: Reverse Triangle Number Algorithm

    Would you be willing to go all the way back to your algebra class and recall how to use the quadratic formula to solve 2nd degree polynomials: http://www.purplemath.com/modules/quadform2.htm The first example in this link should look very close to the kind of problem you have here.

    Wikipedia describes an equation for finding the "triangular root" of a number: http://en.wikipedia.org/wiki/Triangle_numbers
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Reverse Number Entry
    By Kaden265 in forum Excel General
    Replies: 1
    Last Post: 12-03-2014, 12:36 PM
  2. Drap color bar and triangle to display %, week number and date
    By Rocky2013 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-10-2013, 11:18 PM
  3. reverse a number
    By mwmark10 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-20-2007, 10:15 AM
  4. In VB how do I reverse a Negative number?
    By Rick in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-02-2006, 03:30 AM
  5. [SOLVED] reverse a number
    By Derek in forum Excel General
    Replies: 6
    Last Post: 07-19-2005, 01:05 PM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1