We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
  • Hackerrank Home
  • Prepare
    NEW
  • Certify
  • Compete
  • Career Fair
  • Hiring developers?
  1. All Contests
  2. ProjectEuler+
  3. Project Euler #156: Counting Digits
  4. Discussions

Project Euler #156: Counting Digits

Problem
Submissions
Leaderboard
Discussions

    You are viewing a single comment's thread. Return to all comments →

  • jbdfr_dnph
    6 years ago+ 2 comments

    As my code times out, I wonder how can we be sure that the sum s(d) is finite?

    For example, if I test the case b=10 and d=1, I get:

    f(n,1)=n for n=0

    f(n,1)=n for n=1

    f(n,1)=n for n=199981

    f(n,1)=n for n=199982

    f(n,1)=n for n=199983

    f(n,1)=n for n=199984

    f(n,1)=n for n=199985

    f(n,1)=n for n=199986

    f(n,1)=n for n=199987

    f(n,1)=n for n=199988

    f(n,1)=n for n=199989

    f(n,1)=n for n=199990

    f(n,1)=n for n=200000

    f(n,1)=n for n=200001

    f(n,1)=n for n=1599981

    ...

    f(n,1)=n for n=35199990

    f(n,1)=n for n=35200000

    f(n,1)=n for n=35200001

    ....

    0|
    Permalink
  • Contest Calendar
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy
  • Request a Feature