Search code examples
pythonregexmathsequences

Is there any pattern in this sequence?


I would like to know if anyone sees a pattern in the sequence given below. All I know is that the difference between any consecutive rows is 1 i.e.

(MQA (some operator) 1 = YwA)

and that the first row represents 1 or 0 in numeric order. My observations so far:

  • The last character increments by 4 (i.e. A+4=E, E+4=I) after every 5 rows
  • The second to last character is always Q and w alternating (not sure if this will change later in the sequence)

I am very interested in any other observations. Any suggestions?

MQA 
YwA
lQA
xwA
+QA
KwE
XQE
jwE
wQE
8wE
JQI
VwI
iQI
uwI
7QI
HwM
UQM
gwM
tQM
5wM
GQQ
SwQ
fQQ
rwQ
4QQ
EwU
RQU
dwU
qQU
2wU
DQY
PwY
cQY
owY
1QY
Bwc
OQc
awc
nQc
zwc
AQg
Mwg
ZQg
lwg
yQg
+wg
LQk
Xwk
kQk
wwk

Solution

  • Looks like an arithmetic sequence of numbers (increment 50), encoded in base64, but with the terminating "=" removed. When you add it and decode you get:

    $ sed -e 's/$/=/' test.txt | base64 -d | od -t u2
    0000000    49    99   149   199   249   299   349   399
    0000020   449   499   549   599   649   699   749   799
    0000040   849   899   949   999  1049  1099  1149  1199
    0000060  1249  1299  1349  1399  1449  1499  1549  1599
    0000100  1649  1699  1749  1799  1849  1899  1949  1999
    0000120  2049  2099  2149  2199  2249  2299  2349  2399
    0000140  2449  2499
    

    The first number, 49, corresponds to the ASCII code of "1".