# Ever shrinking number sequence

Below is a list of number sequences which follow a specific rule from one to the next. The first seven sequences are written out already. Can you deduce the next one?

1011111110111111011000
001111110011111001000
00111110001111000000
0111111001111100000
011111000111100000
01111000011100000
0111000001100000
???????????????


To assist in the solving process, I have made another sequence with a different beginning number.

1010010111101001001001
111011111111101101101
11001111111100100100
1000111111100000000
100111111110000000
10111111111000000
1111111111100000
???????????????


Hint:

Remember the base this puzzle uses, as well as another thing that involves parity.

The next value is:

111100001110000

Explanation:

We notice that most of the lines are simply the result of a bitwise AND operation of the successive digits of the prior line. For line 1 (1011111110111111011000), we have:
1&0 = 0
0&1 = 0
1&1 = 1
1&1 = 1
Continuing, we get line 2 in its entirety:
001111110011111001000
And line 3:
00111110001111000000
But then to get line 4, we must use OR:
0|0 = 0
0|1 = 1
1|1 = 1
Continuing we get line 4:
0111111001111100000
Back to AND for line 5:
011111000111100000
And line 6:
01111000011100000
And line 7:
0111000001100000

So what's the rule? Use AND unless we are parsing line 3?
This seems somewhat arbitrary. What else do we have?

The sequence began with a substring of pi's digits (1011111110111111011000 in base 2 is 3141592 in base 10)
Note that the the first few digits are mostly ODD, but digit # 3 is EVEN.
Since digit 7 is even (a 2), we should treat it like digit 3, and compute using OR.
Thus line 8, the mystery line, is the result of OR operations on the prior line:
0111000001100000 becomes:
111100001110000

This is not quite certain due to the limited size of the data set, but thanks to the second provided sequence, we can repeat the process and see that it checks out, using the even/odd parity of the second provided number. (Happens to be 2718281, OR-AND-AND-OR-etc.)

• Congratulations! : ) Nov 9, 2021 at 13:07
• Well done! I definitely did not see it this way. Nov 9, 2021 at 16:23

Edit: With the new information, I have an algorithm which seems to produce the right results in all cases, but is surely not what the author intended.

My rule is:

Compare the 2nd bit with the 15th bit in the sequence.
If they are both zero:
A => Replace substring 01 with 11 and then remove last bit.
Otherwise:
B => Replace substring 10 with 00 and then remove last bit.

Following this rule, the first set of sequences follow

B B A B B B

to produce the given sequences, and the last sequence

has to be B, so gives 011000000100000

The second set of sequences follows the pattern

A B B A A A

to produce the given sequences, and the last sequence

is again a B, so gives 111111111100000

Right now, my best guess is:

111100001110000

with the following rule:

On lines which are not multiples of 4, convert any 01 substring to 00 and then remove the leading digit of the sequence. On lines which are multiples of 4, convert any 01 substring to 11 and then remove the trailing digit of the sequence.

This is less an answer, and more a collection of observations, because I'm not sure where to go.

First, as per some comments, I noticed that

The first sequence is binary for the decimal number 3141592, but I can't find any other references to pi in the sequence.

This sequence is also strange because the change from one line to the next can easily be altered by a change of view. For example, for most steps:

We can change 10 to 00 and then remove trailing digit

OR

We can change 01 to 00 and then remove leading digit

I also notice that the title generally applies no matter how we look at the sequence, but then:

From line 3 to line 4, the sequence definitely increases in value if the sequences have numerical values, even if there are padding zeroes on either end, and even if the binary is big-endian or little-endian, but the sequence length itself is the only thing that's shorter/smaller

I've tried a number of solutions that involve:

subtracting a binary number and then either left-bitshifting the answer or right-bitshifting the subtrahend to go again, with mixed success, but this still doesn't account for the change from line 3 to line 4.

Is there a way to interpret the sequences so that line 4 is distinctly smaller than line 3 in a non-length way?

But also:

What causes line 4 to increase instead of decrease like all other lines?
Is it that it is line 4 (which lead to the "every fourth line" argument)?
Is it that in the first two lines, a set of 1's disappears, but line 3 doesn't manage that, so line 4 is punished? Why aren't any subsequent lines punished, then?

The next sequence is

111100001110000

Each sequence

replaces either the leading or trailing zero from each substring of $$1$$s. If the line number is evenly divisible by $$4$$ (e.g. $$n \mod 4 = 0$$) then the leading zero is replaced with a one (e.g. $$0011100$$ becomes $$011100$$). Otherwise, the trailing zero is replaced with a one (e.g. $$0011100$$ becomes $$0011110$$).

removes the last character from the sequence before it (e.g. $$0011100$$ becomes $$001110$$, if we ignore the additional work we're supposed to do).

If we do this line by line, we get:

1011111110111111011000
001111110011111001000
00111110001111000000
0111111001111100000
011111000111100000
01111000011100000
0111000001100000
111100001110000
11100000110000
1100000010000
100000000000
110000000000
10000000000
0000000000

From here, we can proceed no further since

line 14 is comprised of all zeros.

Additionally, line two, in particular, throws you off because

The last digit is dropped, and it makes it seem like the first $$1$$ was translated into a zero instead, but it wasn't.

Furthermore, line twelve is problematic because

it requires a leading $$1$$ to be added; I simply inferred that it should just push the entire value to the right. However, it could be that the line simply dropped the last value instead, in which case we'd reach all zeros on line 13 instead of line 14.

• This doesn't explain the transition from the third sequence to the fourth sequence. Nov 3, 2021 at 19:41
• @DanielMathias I've updated my answer based on that fact, and I believe I have the correct answer now. Nov 3, 2021 at 20:36
• According to your rule set, the number of 1s would continue to increase over time. However, this is not the case. This puzzle is slightly more mathematical, and it would be beneficial to consider what base your are using. Nov 3, 2021 at 22:08
{"ft_lang_label":"__label__en","ft_lang_prob":0.8956456,"math_prob":0.9576367,"size":2608,"snap":"2023-40-2023-50","text_gpt3_token_len":639,"char_repetition_ratio":0.1390169,"word_repetition_ratio":0.0480167,"special_character_ratio":0.24884969,"punctuation_ratio":0.098148145,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9822651,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-12-04T13:29:50Z\",\"WARC-Record-ID\":\"<urn:uuid:92338b98-32ba-4746-a8cd-c80113f336ae>\",\"Content-Length\":\"187813\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:180936d8-3bd1-4705-ad54-cfd60e087371>\",\"WARC-Concurrent-To\":\"<urn:uuid:cf9aae40-5012-43eb-9008-1ddfa28cc6b2>\",\"WARC-IP-Address\":\"104.18.43.226\",\"WARC-Target-URI\":\"https://puzzling.stackexchange.com/questions/112451/ever-shrinking-number-sequence\",\"WARC-Payload-Digest\":\"sha1:ZT4MVUGPDS3JPWHQOY5USFT6362BWFIP\",\"WARC-Block-Digest\":\"sha1:CLJZ6XQGJOWFOGWW4HX463QE66KKCDJM\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-50/CC-MAIN-2023-50_segments_1700679100529.8_warc_CC-MAIN-20231204115419-20231204145419-00641.warc.gz\"}"}