Can You Count the Zeros Between Two Numbers?

  • Thread starter whatever84
  • Start date
In summary, the mathematician looked into ways to calculate the number of zeros between two integers. They found that math theories could be the answer for this problem.
  • #1
whatever84
3
0
Dear all,

Can anybody tell me if there is any mathematical way to know how many zeros between a and b, where we should consider all the numbers between them (inclusive).

E.g.

a = 10,
b = 12,

numbers in between: 10, 11, 12

Thus, the answer is --> 1

I made a simple program to do this for me by looping and incrementing, but as the numbers become bigger, it take "long" time to get the result.

Thus, math theories might be the solution for such problem.

Thanks
 
Physics news on Phys.org
  • #2
Yes, and it is simple. Use a combinatorial aproach.
 
  • #3
whatever84 said:
Dear all,

Can anybody tell me if there is any mathematical way to know how many zeros between a and b, where we should consider all the numbers between them (inclusive).

E.g.

a = 10,
b = 12,

numbers in between: 10, 11, 12

Thus, the answer is --> 1

I made a simple program to do this for me by looping and incrementing, but as the numbers become bigger, it take "long" time to get the result.

Thus, math theories might be the solution for such problem.

Thanks
I don't understand what you mean. When you say "zeros" I assume you mean the zeroes of some function, but your example appears to be how many integers there are between two given integers.
 
  • #4
whatever84 said:
Dear all,

Can anybody tell me if there is any mathematical way to know how many zeros between a and b, where we should consider all the numbers between them (inclusive).

E.g.

a = 10,
b = 12,

numbers in between: 10, 11, 12

Thus, the answer is --> 1

I made a simple program to do this for me by looping and incrementing, but as the numbers become bigger, it take "long" time to get the result.

Thus, math theories might be the solution for such problem.

Thanks
If you mean look at each number as a string and count how many characters are zero I think you should try for solving in general generate a(n) = the number of zeros in [1, n] then [b,c] = a(c) - a(b-1). See http://www.research.att.com/~njas/sequences/A061217
 
Last edited by a moderator:
  • #5
Oh, zero digits.
 

1. How do you count the number of zeros between two numbers?

To count the number of zeros between two numbers, you need to first subtract the smaller number from the larger number. Then, you can count the number of zeros in the resulting number. For example, if you are counting the zeros between 100 and 1000, you would first subtract 100 from 1000, resulting in 900. There are two zeros in 900, so there are two zeros between 100 and 1000.

2. Do you include the zeros at the beginning and end when counting?

No, when counting the zeros between two numbers, you do not include the zeros at the beginning and end. For example, if you are counting the zeros between 10 and 100, you would not include the zeros in 10 or 100. You would only count the zero in 100, resulting in one zero between 10 and 100.

3. Can you count the zeros between negative numbers?

Yes, you can count the zeros between negative numbers. The process is the same as counting the zeros between positive numbers. For example, if you are counting the zeros between -100 and -1000, you would first subtract -100 from -1000, resulting in -900. There are two zeros in -900, so there are two zeros between -100 and -1000.

4. How do you handle decimals when counting zeros?

When counting zeros between two numbers that include decimals, you need to count the zeros after the decimal point. For example, if you are counting the zeros between 1.01 and 10.1, you would first subtract 1.01 from 10.1, resulting in 9.09. There are two zeros after the decimal point in 9.09, so there are two zeros between 1.01 and 10.1.

5. Can you have a negative number of zeros between two numbers?

No, you cannot have a negative number of zeros between two numbers. The number of zeros between two numbers will always be a positive value, even if the resulting number from subtracting the two numbers is negative. If the resulting number is negative, you would simply count the zeros in the absolute value of that number. For example, if you are counting the zeros between 1000 and 100, you would first subtract 100 from 1000, resulting in 900. There are two zeros in 900, so there are two zeros between 1000 and 100.

Similar threads

  • Programming and Computer Science
Replies
10
Views
723
Replies
7
Views
3K
  • Set Theory, Logic, Probability, Statistics
Replies
6
Views
1K
Replies
20
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
3
Views
1K
  • Introductory Physics Homework Help
Replies
2
Views
298
Replies
5
Views
2K
  • Precalculus Mathematics Homework Help
Replies
1
Views
507
  • Precalculus Mathematics Homework Help
Replies
2
Views
1K
  • Linear and Abstract Algebra
Replies
4
Views
2K
Back
Top