Interview Question

Software Engineer Interview Berkeley, CA

Count the number of even-digit numbers below 10^9 that are

  divisible by 7 and 13.
Answer

Interview Answer

1 Answer

1

First, The number which is divisible by 7 and 13 will be multiple of (7*13=91) 91.
so X=10^9-(10^9 % 91) will give the largest number lessthan 10^9 which is divisible by both 7 and 13.
X/91=10989010 will give the number of digit which is divisible by 7 and 13.
since we need only even number lets divide it by two (10989010 / 2= 5494505)

so it has 5494505 even-digit below 10^9 that are divisible by 7 and 13.

Prakash Perumal on Apr 11, 2014

Add Answers or Comments

To comment on this, Sign In or Sign Up.