Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

Sum of alternating digits

Правка en1, от numbpy123, 2019-09-29 16:59:20

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).

Теги #number theory, #math

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский numbpy123 2019-09-29 16:59:20 785 Initial revision (published)