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

  • SEARCH
  • Home
  • 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 6038817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T06:16:39+00:00 2026-05-23T06:16:39+00:00

I am having mathematics oriented question.Here i like to get the all possible combinations

  • 0

I am having mathematics oriented question.Here i like to get the all possible combinations
and looking to store in array.

For example:-

1 digit = 10 (0,1,2,3,....9) 
2 digit = 100 (00,01,02,03,...)

I am having formula to find number of possibilities i.e 10^n -1.But i don’t know how can i get the values.

function get_combinations(5){
//10^5 -1 = 99999 values 

} 

the function result should be

00000,00001,00010,00100,….

in array

not like

0,1,2,….00,01,03,…99999

EDIT

I also like to mix some alphabets with the number

results like

0000a,000a1,000z1,00001,00000,….

Thanks in advance

  • 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-05-23T06:16:40+00:00Added an answer on May 23, 2026 at 6:16 am
    $n = ???;
    $array = range(0, pow(10, $n)-1);
    

    yes, there is no integer start with zero

    so, dun bother to construct an array start with leading zero,
    when you need to output str_pad can be applied


    function get_combinations($n)
    {
      return range(0, pow(10, $n)-1);
    }
    
    $array = get_combinations(5);
    $pad   = strlen(max($array));
    
    // to output
    echo str_pad($array[0], $pad, 0, STR_PAD_LEFT);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having problems with asynchronous sequences on Flex/ActionScript. Here is an example: private function
First of all I am having trouble with the concept of a mathematical Vector
Having trouble with each function... Will try to explain by example... In my code,
Having a hard time with labels on a ggplot2 plot. Here's a similar plot
Having just added a new button in my web application, I get an error
I'm working on my thesis project on financial mathematics. One problem I'm having is
Having read this article F# Versus Mathematics: Part One - Getting Started with BLAS
Is it possible to do CAD/CAM software without having to use C++? My company
I would like to encode a pair of ints in a double. For example
I am having a problem where, after performing a simple mathematical operation on the

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.