Skip to main content
15-Moonstone
March 23, 2023
Solved

Moessner's theorem

  • March 23, 2023
  • 1 reply
  • 2531 views

A friendly hello in search of help,

Moessner's theorem is well known to me from number theory. It is vividly described in https://en.wikipedia.org/wiki/Moessner%27s_theorem and https://thatsmaths.com/2017/09/14/moessners-magical-method/. I would now like to experiment numerically with this sentence for a change in "practice". Starting from the sequence of natural numbers 1, 2, 3 ... a subsequence is removed from it according to an essentially arbitrary rule (e.g. every third number, square numbers, prime numbers, ...). The sequence of partial sums is formed from the remainder. With the sequence of the partial sums, the procedure is repeated with the same selection rule until it logically breaks off. And that's my programming problem. In MC14 I can't get a handle on the selection, the sequence of partial sums and the repetition as an algorithm, it was always vector nonsense that I don't want to publish here.

It would be helpful if I could get a program skeleton with hints using the example "Selection of every third natural number".

Kind regards, Alfred Flasshaar

Best answer by Werner_E

Here is a program which should do the job

Werner_E_2-1679578307371.png

 

Examples:

Werner_E_3-1679578345024.png

 

1 reply

Werner_E25-Diamond IAnswer
25-Diamond I
March 23, 2023

Here is a program which should do the job

Werner_E_2-1679578307371.png

 

Examples:

Werner_E_3-1679578345024.png

 

15-Moonstone
March 23, 2023

That's it, thanks a lot.

25-Diamond I
March 23, 2023

You are welcome!

 

I added a modification so the intermediate steps can be seen

Werner_E_0-1679582583998.png