Please read the new rule regarding the restriction on the use of AI tools. ×

numbpy123's blog

By numbpy123, history, 5 years ago, In English

Given a number N, if you write down all the numbers from 1..N and put alternating + and — signs between every digit, what's the value?

Note how I said between every digit and not between every number. For example, if N = 12, we get,

1 — 2 + 3 — 4 + 5 — 6 + 7 — 8 + 9 — 1 + 0 — 1 + 1 — 1 + 2 = 5.

I tried to look on OEIS for such sequences, and I had no luck. I've also tried rewriting it in many ways, etc, but I had no luck. I'm guessing you can just stimulate the process, but I'm pretty sure it would be very expensive (especially for large numbers where you need to obtain the kth digit of the number).

I was wondering if anyone has a solution better than mine (which is just stimulation).

Full text and comments »

  • Vote: I like it
  • -2
  • Vote: I do not like it