DatBoi
DatBoi

Reputation: 131

Replacing counter with a function

Let n be an odd number. Suppose we have the sequence s:=n,n+2,n+4,⋯. The goal is to associate this sequence with two other sequences, a and b. I will show how a and b are related to the original sequence with an example:

enter image description here

Both a and b act as some sort of a "counter": a counts from 0 to n−1 and resets back to 0 if it equals n. b starts from 1 and increases by 2 every time a resets.


Instead of having to depend on the previous values, I wish to find these counters as a function of s and n only.

As we notice, the sequence a is very similar to modulo, with a slight modification, i.e.,

enter image description here

Can b be found as a function f(s,n) too? I suspect that this would involve the quotients of s but I could not come up with any.

Upvotes: 1

Views: 61

Answers (0)

Related Questions