Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8475331
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T17:51:50+00:00 2026-06-10T17:51:50+00:00

I want to convert a sequence of numbers to a single number which will

  • 0

I want to convert a sequence of numbers to a single number which will retain individual values as well as their position. e.g. the following sequence is provided-

1,6,7,8,9,45,67

here,take for example,if I apply simple addition i.e. 1+6+7+8+9+45+67 then a number will be generated. But from that no. we can’t extract the individual numbers with their ordering[i.e. 1,6,7,8,9,…].

Is there any way to achieve this feature without any ambiguous deduction [i.e only 1 unique set of numbers will be extracted from a number.]? Is there any mathematical function which will be helpful to get back the individual elements from that number?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T17:51:52+00:00Added an answer on June 10, 2026 at 5:51 pm

    You can convert this to a base-N number, where N is one larger than the largest value that will appear in your input sequence.

    UPDATE

    Based on the various comments, I would like to offer an alternative solution that may be easier to implement. You can consider the sequence to be a UTF-8 encoded string and use Huffman coding with a custom dictionary to achieve a compact representation.

    The custom dictionary allows you to store very common characters with very few bits (for example, the sequence separator ‘,’ and the individual characters ‘0’..’9′ can be stored with as few as 3 bits, but also other numbers that you find to be statistically likely to occur can be stored in a short bit sequence. For example, if you find that “42” occurs frequently, you could store “42” in just a few bits.

    If you only assign special codes to ‘,’ and ‘0’ to ‘9’, you will average less than 4 bits per character in the input string while retaining the comma separating sequence members. Finding common, multi-character substrings and adding them to the dictionary will only improve on that ratio.

    Using a custom dictionary also means that you do not have to store the dictionary in the header of the compressed data, since it is well-known to you.

    I did something just like this using SharpZipLib

    http://www.icsharpcode.net/opensource/sharpziplib/

    http://community.sharpdevelop.net/forums/p/8255/23219.aspx

    It is also easy to do with zlib

    Compressing small piece of data

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code which will convert a string to TitleCase. I would
I want to convert a column of numbers to numeric, but there are certain
I want to convert a number to hex and store the result in a
i want to convert sequence of images to video in android sdcard by using
I read in a sequence of numbers with np.array(f.read().split(),dtype=np.float64) Then I convert this to
I have a sequence of CvPoint2D32f points in CvSeq and I want to convert
I want to convert a string to formatted text in C# in WPF application,
I want to convert all the URLs in a javascript string to links, in
I want to convert a pointer *int to its real value int , in
I want to convert plaintext to link for an input I have. The HTML

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.