+ Reply to Thread
Results 1 to 2 of 2

Count number of unique X digits duplicate pairs from a number

  1. #1
    Registered User
    Join Date
    11-19-2019
    Location
    Abu Dhabi, UAE
    MS-Off Ver
    2016
    Posts
    6

    Count number of unique X digits duplicate pairs from a number

    For the first digits of pi:
    3.1415926535897932384626433832795028841971693993751
    after removing any non-numbers it become
    31415926535897932384626433832795028841971693993751
    This number has 50 digits in them which means there is 50*50 pairs = 2500
    but i don't need ALL pairs, for example (a, b) and (b, a) is a repeating pair so I need to neglect that.
    so the formula to find the pairs that will be calculated is:
    (50 * (50-1))/2 = 1,225 this means that there will be 1225 unique pairs that I need to check if they match or not.
    so first I start with 2 digits repeating numbers which are any numbers starting from 00 to 99 (100 options).
    because we are doing 2 digits, then in a number of length "50", there is 49 double digit numbers. e.g.:
    Please Login or Register  to view this content.
    using (49) the number of unique pairs to test is: (49 * (49 - 1)) / 2 = 1176

    so in the example above the first 2 digit pairs are (31, 14), then (31, 41), then (31, 15) all the way until we finish from the initial (31) and start from the second 2 digit number which is (14, 41) then (14, 15) etc... all the way to pair number "1176"

    In this case given above, out of 1176 pairs there are 10 matches.
    so if a person will input that number, the result formula should be "10"

    after that we will do the same for 3 digit numbers, 4, 5, 6 etc...
    so for 3 digits its the same, the pairs will be as follow:
    Please Login or Register  to view this content.
    but this time since it's 3 digits, then in a number of 50 digits there will be only 48 triple digit numbers. so only "1128" pairs to test and match.

    so basically the formula should have these inputs:
    "input number"
    "number of digits to test"

    so a "31415926535897932384626433832795028841971693993751" with "2" will return "10"
    and "31415926535897932384626433832795028841971693993751" with "3" will return "0" <- because there are no matches for this case...
    Last edited by SedoSan7; 11-19-2019 at 03:33 AM. Reason: clarifying the question

  2. #2
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: Count number of unique X digits duplicate pairs from a number

    apologies i posted this in the wrong thread
    Last edited by NickyC; 11-19-2019 at 04:10 AM. Reason: delete error

+ 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. Urgently trying to count unique pairs between 2 columns of text
    By rossh in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 12-19-2016, 03:01 PM
  2. Replies: 2
    Last Post: 06-05-2016, 08:49 AM
  3. [SOLVED] Formula to count the number of unique text values from a list.
    By PritishD in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-28-2015, 05:42 AM
  4. Replies: 5
    Last Post: 03-27-2015, 08:07 AM
  5. [SOLVED] Count Unique Pairs of Excel Entries Based on Criteria
    By DonFord81 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-22-2013, 01:12 PM
  6. Count number of pairs between 2 columns
    By Johnald in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 01-09-2013, 06:46 PM
  7. Count Number of Unique Names in a List
    By acewriter63 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 10-09-2012, 09:12 AM

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