Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ================================================
- ecl1 - More Powerful Single-Sequence BMS System?
- ================================================
- A sequence is written as (x_1,x_2,x_3,x_4,...,x_n)[a] where a>0 is an integer and x_i >= 0 are integers.
- If the last number is 0, the normal BMS rule applies (remove it, square the number in the [] brackets).
- If the last number is not 0, then do these:
- ---- Let the last number be N.
- ---- Find the rightmost number strictly less than N, and call it K.
- ---- The part of the sequence including K and things to the left of K is the "left" part of the sequence.
- ---- The part of the sequence strictly to the right of K is the "right" part of the sequence.
- ---- Decrease the last number (N) by 1. Make this the new value of N.
- ---- Find the difference between N and K, call this D.
- (Note: if the ordinal is less than e0, D will always be equal to 0.)
- ---- Take the left part of the sequence, and concatenate sequences S_0, S_1, ... S_(a-1) to it.
- ---- S_i is defined as the right part of the sequence, where every term in it is incremented by D\*i.
- Example #1:
- (0,2,1,3)
- Left part = (0,2,1)
- Right part = (2) (after decrementing from 3)
- N = 2
- K = 1
- D = 2-1 = 1
- S_0 = (2) incremented by D*0 = 0
- S_1 = (2) incremented by D*1 = 1, which is (3).
- S_2 = (2) incremented by D*2 = 2, which is (4).
- etc etc...
- So the result is the left part (0,2,1) concatenated with (2),(3),(4),(5),.... etc
- which is (0,2,1,2,3,4,5,6,7,8,....)
- Example #2:
- (0,2,2)
- Left part = (0)
- Right part = (2,1) after decrementing
- N = 1
- K = 0
- D = 1-0 = 1
- S_0 = (2,1) incremented by D*0 = 0
- S_1 = (2,1) incremented by D*1 = 1, which is (3,2)
- S_2 = (2,1) incremented by D*2 = 2, which is (4,3)
- etc etc...
- So the result is (0,2,1,3,2,4,3,5,4,6,5....)
- Example #3:
- (0,4,7)
- Left part = (0,4)
- Right part = (6) after decrementing
- N = 6
- K = 4
- D = 6-4 = 2
- S_0 = (6) incremented by D*0 = 0
- S_1 = (6) incremented by D*1 = 2, which is (8)
- S_2 = (6) incremented by D*2 = 4, which is (10)
- etc etc...
- So the result is (0,4,6,8,10,12,14,......)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement