base-n series generator for a given number

for example if my input is 2,then series shuould be, 00,01,10,11,etc.,
if my input is 10,then series shuould be,1,2,3,4,5,etc.,

is there any general mechanism in mathematics to find these numbers so that I can program for that

Replies

  • Saandeep Sreerambatla
    Saandeep Sreerambatla
    In base 2 system using only 2 numbers you can get the maximum number as 3 which is 11.
    So my basic idea is ...
    using 4 digits as the number you can get the maximum number as 2[sup]4[/sup] - 1 = 15 using 4 numbers!

    Lets take 2 numbers only here..
    thus with base 2 system you can give numbers upto 2[sup]2[/sup] -1 = 3
    So the numbers are 00 , 01, 10, 11

    In base 3 system the maximum number we can represent is (22)[sub]3[/sub]
    thus the number is 3[sup]2[/sup]-1 = 8
    And this holds good for all the bases thus you can design a program which takes 2 inputs, the base and the number of digits which represent a number. By that you can design it.

    I hope you know how to convert numbers to any base system ?
  • silverscorpion
    silverscorpion
    If input is 2 you want 00,01,10 and 11 which are binary.
    If input is 10, you want 1,2,3 which is in decimal system.

    I'm confused.. Please clarify..
  • Morningdot Hablu
    Morningdot Hablu
    hey what you want to do.
    when input is decimal then output is binary series.
    and when input is binary output is decimal series.
    can you clearify your question.
  • Saandeep Sreerambatla
    Saandeep Sreerambatla
    silverscorpion
    If input is 2 you want 00,01,10 and 11 which are binary.
    If input is 10, you want 1,2,3 which is in decimal system.

    I'm confused.. Please clarify..

    @SS: As far as I understood , donot go with Decimal or binary naming conventions, the question is to get the numbers of the given base , infact the base -2 system is called Binary but that name is nothing to do with it!
    Since Decimal is called base -10 system , the question is to find the representation of numbers in given base.
  • Manish Goyal
    Manish Goyal
    why don't you use basic method of converting a no to any other base system

    ie by dividing no by n picking up remainder

You are reading an archived discussion.

Related Posts

CEans, We are inviting guest authors to contribute to VoiCE. Send your articles to admin [att] crazyengineers [dawt] com . Do not forget to write a short author biography which...
Discuss https://www.crazyengineers.com/forum/announcements/34184-inviting-guest-authors.html in this thread.
Hi Guys, I know lot of devices in the world use Resistors , capacitors and Inductors in their circuit designs with lot more devices though! We would be having a...
Who is on the steam turbine power plant of some papers? Thank you
London – May 18, 2010 – Attenda Limited, the Always On Managed Services company, today announced that it has signed a three year contract with Traffic Solutions for the provision...