title: 99 Varieties of Dosa

text:
# Question
Title: 99 Varieties of Dosa
99 Varieties of Dosa is a popular chain of roadside dosa stalls across South India. This is inspired by a combination of this chain and the classic CodeGolf challenge "99 Bottles of Beer".

Recreate the variant of the menu of the popular '99 Varieties of Dosa' listed below.

*(Note: Despite the name, the list contains 103 varieties and not exactly 99)*

The desired output is the following list (in any order):

```
Sada Dosa
Cheese Sada Dosa
Paneer Sada Dosa
Paneer Cheese Sada Dosa
Schezwan Sada Dosa
Cheese Schezwan Sada Dosa
Paneer Schezwan Sada Dosa
Paneer Cheese Schezwan Sada Dosa
Onion Sada Dosa
Cheese Onion Sada Dosa
Paneer Onion Sada Dosa
Paneer Cheese Onion Sada Dosa
Chutney Dosa
Cheese Chutney Dosa
Paneer Chutney Dosa
Paneer Cheese Chutney Dosa
Tomato Onion Dosa
Cheese Tomato Onion Dosa
Paneer Tomato Onion Dosa
Paneer Cheese Tomato Onion Dosa
Schezwan Onion Dosa
Cheese Schezwan Onion Dosa
Paneer Schezwan Onion Dosa
Paneer Cheese Schezwan Onion Dosa
Jain Dosa
Jain Cheese Dosa
Jain Paneer Dosa
Jain Paneer Cheese Dosa
Masala Dosa
Cheese Masala Dosa
Paneer Masala Dosa
Paneer Cheese Masala Dosa
Onion Masala Dosa
Onion Paneer Masala Dosa
Cheese Onion Masala Dosa
Paneer Cheese Onion Masala Dosa
Schezwan Masala Dosa
Cheese Schezwan Masala Dosa
Paneer Schezwan Masala Dosa
Paneer Cheese Schezwan Masala Dosa
Mysore Masala Dosa
Paneer Mysore Masala Dosa
Cheese Mysore Masala Dosa
Paneer Cheese Mysore Masala Dosa
Paneer Cheese Schezwan Mysore Masala Dosa
Kerala Dosa
Kerala Cheese Dosa
Paneer Kerala Dosa
Paneer Cheese Kerala Dosa
Pav Bhaji Dosa
Pav Bhaji Cheese Dosa
Pav Bhaji Paneer Dosa
Pav Bhaji Cheese Paneer Dosa
Spring Vegetable Dosa
Spring Paneer Vegetable Dosa
Spring Cheese Vegetable Dosa
Spring Paneer Cheese Vegetable Dosa
Sweet Corn Dosa
Sweet Corn Cheese Dosa
Sweet Corn Paneer Dosa
Sweet Corn Paneer Cheese Dosa
Sweet Corn Schezwan Dosa
Sweet Corn Schezwan Paneer Dosa
Sweet Corn Schezwan Cheese Dosa
Sweet Corn Schezwan Paneer Cheese Dosa
Sweet Corn Mushroom Dosa
Sweet Corn Mushroom Paneer Dosa
Sweet Corn Mushroom Cheese Dosa
Sweet Corn Mushroom Paneer Cheese Dosa
Mushroom Dosa
Mushroom Cheese Dosa
Mushroom Paneer Dosa
Mushroom Paneer Cheese Dosa
Schezwan Mushroom Dosa
Schezwan Mushroom Paneer Dosa
Schezwan Mushroom Cheese Dosa
Schezwan Corn Mushroom Paneer Cheese Dosa
Paneer Chilli Dosa
Paneer Chilli Cheese Dosa
Mushroom Chilli Dosa
Mushroom Chilli Cheese Dosa
Mushroom Chilli Paneer Dosa
Mushroom Chilli Paneer Cheese Dosa
Sada Uttappam Dosa
Sada Uttappam Cheese Dosa
Sada Uttappam Paneer Dosa
Sada Uttappam Paneer Cheese Dosa
Onion Uttappam Dosa
Onion Uttappam Cheese Dosa
Onion Uttappam Paneer Dosa
Onion Uttappam Paneer Cheese Dosa
Masala Uttappam Dosa
Masala Uttappam Cheese Dosa
Masala Uttappam Paneer Dosa
Masala Uttappam Paneer Cheese Dosa
Mysore Uttappam Dosa
Mysore Uttappam Cheese Dosa
Mysore Uttappam Paneer Dosa
Mysore Uttappam Paneer Cheese Dosa
Mixed Uttappam Dosa
Mixed Uttappam Cheese Dosa
Mixed Uttappam Paneer Dosa
Mixed Uttappam Paneer Cheese Dosa

```

# Answer
# Python 2, ~~503~~ ~~496~~ ~~487~~ ~~485~~ ~~479~~ 476 bytes

```
for l in[a+'86'[i<2:1+i%2][::2*('v'in a)-1]+b for i in(0,1,2,3)for a,b in[l.split('~')for l in('~11~'[i<2::2]+'0|Spring ~Vegetable |73~|13~|03~|:3~|Mixed 3~|~7|~27|~17|;4~|;42~|;45~|~Tomato 1|~21|~Chutney |2'+'45~|~20|~:0|~0|Jain ~|Pav Bhaji ~|5~|59~|'[i<3:]+'<~~<'[i%2::2]).split('|')]]+['682:0','69','698']:
 for i in range(13):l=l.replace(chr(48+i),'Masala Onion Schezwan Uttappam Corn Mushroom Paneer Sada Cheese Chilli Mysore Sweet Kerala'.split()[i]+' ')
 print l+'Dosa'

```

Try it online!

Every dosa is of the form `a [Paneer, Cheese] b Dosa`

Each dosa is then encoded in a list of tuples of `(a,b)`. There are many dosa where `a` or `b` is empty.

For each of these tuples, every combination of `Paneer`and `Cheese` is added in between them.

* `.. '86'[i<2:1+i%2] .. for i in(0,1,2,3) ..`

The few special cases which are slightly different are:

* `Kerala Dosa`, `Kerala Cheese Dosa` vs `Paneer Kerala Dosa`, `Paneer Cheese Kerala Dosa`
    + `Kerala` is moved from `a` to `b` if we have `Paneer`
    + `.. '<~~<'[i%2::2] ..` which gives `['Kerala','']` or `['','Kerala']`
* `Schezwan Corn Mushroom Paneer Cheese Dosa`
    + `Corn` is inserted if we have `Paneer Cheese`
    + `.. '4..'[i<3:] ..`
* `Onion Masala Dosa`, `Onion Paneer Masala Dosa` vs `Cheese Onion Masala Dosa`, `Paneer Cheese Onion Masala Dosa`
    + `Onion` is moved from `a` to `b` if we have `Cheese`
    + `.. '~11~'[i<2::2] ..`, similar to `Kerala` above
* `Pav Bhaji Cheese Paneer Dosa`
    + `Paneer` and `Cheese` are swapped if `a` is `Pav Bhaji`
    + `.. '86'[i<2:1+i%2][::2*('v'in a)-1] ..`
* `Paneer Cheese Schezwan Mysore Masala`,`Paneer Chilli`,`Paneer Chilli Cheese`
    + These are too different to account for, and are just added to the list at the end.
    + `.. +['682:0','69','698']`

At the end, the numbers are replaced with the correct words:

`0123456789:;<` -\> `Masala Onion Schezwan Uttappam Corn Mushroom Paneer Sada Cheese Chilli Mysore Sweet Kerala`
> 9 votes

# Answer
# Retina 0.8.2, 339 bytes

```

19¶149¶169¶1Chutney ¶1Tomato 6¶146¶Jain 1¶13¶163¶143¶183¶/-483¶;0¶/0;¶Pav Bhaji 1¶Spring 1Vegetable ¶71¶741¶751¶51¶450¶45/¶4Corn 5/-¶/:0¶5:1¶92¶62¶32¶82¶Mixed 2
%(`$
Dosa
2
Uttappam 1
1
0$'¶$`/0
0
$%'¶$%`-
/63
6/3
i /-
i -/
/
Paneer
-
Cheese
;
Kerala
:
Chilli
9
Sada
8
Mysore
7
Sweet Corn
6
Onion
5
Mushroom
4
Schezwan
3
Masala

```

Try it online! This was 299 bytes before I discovered the edge cases...
> 3 votes

# Answer
# Python 2, 436 bytes

```
00000000: 2363 6f64 696e 673a 3433 370a 696d 706f  #coding:437.impo
00000010: 7274 207a 6c69 620a 7072 696e 7420 7a6c  rt zlib.print zl
00000020: 6962 2e64 6563 6f6d 7072 6573 7328 2278  ib.decompress("x
00000030: da8d 554b 72c3 200c ddf7 14be 9a92 6862  ..UKr. .......hb
00000040: 52db 780c 499a 9ebe ed04 1309 3d91 eeec  R.x.I.......=...
00000050: f705 e1c1 894e 349c 62a2 8fe3 c89c 7848  .....N4.b.....xH
00000060: 1558 6961 de2c 6084 e917 f9be d35c 22a0  .Xia.,`......\".
00000070: 5d63 993d d565 7c6b 5c42 0425 2d5c 5c72  ]c.=.e|k\B.%-\\r
00000080: 1cd8 311d c76b 5ef8 a182 1556 ed08 b3f2  ..1..k^....V....
00000090: 1c67 cab1 d4c8 504b 9414 9770 8d75 44b6  .g....PK...p.uD.
000000a0: 0551 ede4 dd26 a4b8 5090 4f45 f902 4a82  .Q...&..P.OE..J.
000000b0: 01a4 70a6 4493 3e3b 0915 0780 80f8 b934  ..p.D.>;.......4
000000c0: 8b80 1075 e27e bae5 eb1c 401a e4da 09fb  ...u.~....@.....
000000d0: 6550 323f 52dc f04c 2cb3 cfc4 f5fc 57f0  eP2?R..L,.....W.
000000e0: 5a8a 557e f2d6 3ecb 032d 4152 a5b3 3573  Z.U~..>..-AR..5s
000000f0: 1b0e 235d 42fb aa13 7754 7e50 462b c9b4  ..#]B...wT~PF+..
00000100: 6e61 390f 373e 73a6 c3c4 5c6e 2d42 4c96  na9.7>s...\n-BL.
00000110: b0ae d3d1 dc99 f370 8cdb 62de e56e 04ac  .......p..b..n..
00000120: 566c 60c7 548f c625 9cd8 cabf 0bee f7cf  Vl`.T..%........
00000130: d734 6e31 ce3e e1f4 57fe 5d30 ba25 5429  .4n1.>..W.]0.%T)
00000140: 4c82 f5bd ccd7 37ae 7764 60b5 1fc3 c2c8  L.....7.wd`.....
00000150: b71b aa50 98a6 8020 b835 296f c19e 018e  ...P... .5)o....
00000160: 4473 6a1b 7f7f c06b ceb4 ae34 23c8 17ab  Dsj....k...4#...
00000170: 5921 465a 9fb7 ab2e 6ab0 8e5c 5661 5c6e  Y!FZ....j..\Va\n
00000180: fc67 7459 0bf6 0c6a 8698 53f6 e7c5 d9f4  .gtY...j..S.....
00000190: 3560 cfa0 fa30 a7ec e18b 4f6d 9dc6 3a72  5`...0....Om..:r
000001a0: 5506 2961 fe01 a6fe babb 2229 2e74 6974  U.)a......").tit
000001b0: 6c65 2829                                le()

```

Decompresses the string `sada dosa\ncheese sada dosa\n…\n`, and prints the result in title case.

Here is a Bash script that creates the program, prints its size and hexdump, and runs it.
> 2 votes

# Answer
# 05AB1E, 380 bytes

```
“³ŽÞÄæžŽ¹ÕÂŸÊÃÅ¦«“ð.•.ÚÜāÚÕuƒÚ·@â¥αmæ©½â…]M<.žk¦L0ηβ½ζ‰I°¸6þÈÑÈ)º#θ›34ù±q
œƒé•J™#
•yÊ£‰RÒ‡¨ÃιUÄŽn¾₅&p’ûüL1Ç*¶‡A¶„Ωðw#õqλ₆µŸÜ∊∊îà½Í*üÞ–´YΛæz…ć<þ‹Ž¡‡wBćèú₃Pjæ
†Oò;ÊāxµÏŒSv>H£Yœ<нΘ—[é”B‹āÕ×r₁t‡ù@l4ÐθÃ-R¨„“gt–å¶
∍»´₂*N§¨н∊í6ζ`pzÈ’v,q/äwájιìÆ¤”G₅Qαbbi'M?–’fт¥V2ÍÓ‡Žý+2≠Sf)A—+7-ù¯>v:ÍµK‘?˜6·Å₂!1 ćæQ1|iт†Ä"тë₄æ~…àÉÃùpû›ã~[и/±ÌðQÔāoĆ¹β«"CÜŽ›0∊/pâŒlλMÃ”Σ»<ˆŸcÎ‘€øPΛʒ=Ā5æVŽĆæ•23B'M¡€S22öè»

```

Try it online!
> 2 votes

# Answer
# JavaScript (Node.js), 602 bytes

thanks for @Shaggy for updating according to new menu and usage of base 36 + array split :)

```
_=>`0
10
20
210
30
130
230
2130
40
140
240
2140
5
15
25
215
64
164
264
2164
34
134
234
2134
7
71
72
721
8
18
28
218
48
428
148
2148
38
138
238
2138
98
298
198
2198
21398
a
a1
2a
21a
b
b1
b2
b12
cd
c2d
c1d
c21d
f
f1
f2
f21
f3
f32
f31
f321
fg
fg2
fg1
fg21
g
g1
g2
g21
3g
3g2
3g1
3eg21
2h
2h1
gh
gh1
gh2
gh21
0i
0i1
0i2
0i21
4i
4i1
4i2
4i21
8i
8i1
8i2
8i21
9i
9i1
9i2
9i21
ji
ji1
ji2
ji21`.replace(/.|$/mg,x=>x?`Sada,Cheese,Paneer,Schezwan,Onion,Chutney,Tomato,Jain,Masala,Mysore,Kerala,Pav Bhaji,Spring,Vegetable,${c=`Corn`},Sweet ${c},Mushroom,Chilli,Uttappam,Mixed`.split`,`[parseInt(x,20)]+` `:`Dosa`)

```

Try it online!
> 1 votes

# Answer
# Deadfish~, 19533 bytes

```
{{i}dd}iiic{i}iiiiciiicdddc{dddddd}dddddc{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{iiiiii}dddc{iiii}dddcdddcc{i}iiiic{d}ddddc{{d}iii}ic{iiiii}ic{i}iiiiciiicdddc{dddddd}dddddc{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}c{ii}dddc{i}iiic{d}icc{i}iiic{{d}ii}ddc{iiiii}ic{i}iiiiciiicdddc{dddddd}dddddc{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}c{ii}dddc{i}iiic{d}icc{i}iiic{{d}ii}ddc{iii}iiiiic{iiii}dddcdddcc{i}iiiic{d}ddddc{{d}iii}ic{iiiii}ic{i}iiiiciiicdddc{dddddd}dddddc{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}iiic{i}iiiiiiciiiiicdddc{ii}icdddc{dd}ddc{i}iiic{{d}ii}iic{iiiii}ic{i}iiiiciiicdddc{dddddd}dddddc{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{iiiiii}dddc{iiii}dddcdddcc{i}iiiic{d}ddddc{{d}iii}ic{iiiii}ic{i}iiiiiiciiiiicdddc{ii}icdddc{dd}ddc{i}iiic{{d}ii}iic{iiiii}ic{i}iiiiciiicdddc{dddddd}dddddc{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}c{ii}dddc{i}iiic{d}icc{i}iiic{{d}ii}ddc{iiiii}ic{i}iiiiiiciiiiicdddc{ii}icdddc{dd}ddc{i}iiic{{d}ii}iic{iiiii}ic{i}iiiiciiicdddc{dddddd}dddddc{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}c{ii}dddc{i}iiic{d}icc{i}iiic{{d}ii}ddc{iii}iiiiic{iiii}dddcdddcc{i}iiiic{d}ddddc{{d}iii}ic{iiiii}ic{i}iiiiiiciiiiicdddc{ii}icdddc{dd}ddc{i}iiic{{d}ii}iic{iiiii}ic{i}iiiiciiicdddc{dddddd}dddddc{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}dc{iii}icdddddciiiiiicdc{{d}ii}iic{iiiii}ic{i}iiiiciiicdddc{dddddd}dddddc{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{iiiiii}dddc{iiii}dddcdddcc{i}iiiic{d}ddddc{{d}iii}ic{iiiii}dddc{iii}icdddddciiiiiicdc{{d}ii}iic{iiiii}ic{i}iiiiciiicdddc{dddddd}dddddc{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}c{ii}dddc{i}iiic{d}icc{i}iiic{{d}ii}ddc{iiiii}dddc{iii}icdddddciiiiiicdc{{d}ii}iic{iiiii}ic{i}iiiiciiicdddc{dddddd}dddddc{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}c{ii}dddc{i}iiic{d}icc{i}iiic{{d}ii}ddc{iii}iiiiic{iiii}dddcdddcc{i}iiiic{d}ddddc{{d}iii}ic{iiiii}dddc{iii}icdddddciiiiiicdc{{d}ii}iic{iiiii}ic{i}iiiiciiicdddc{dddddd}dddddc{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{iiiiii}dddc{iiii}dddc{i}iiicdcddddddc{d}ic{ii}c{{d}i}ic{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{iiiiii}dddc{iiii}dddcdddcc{i}iiiic{d}ddddc{{d}iii}ic{iii}iiiiic{iiii}dddc{i}iiicdcddddddc{d}ic{ii}c{{d}i}ic{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}c{ii}dddc{i}iiic{d}icc{i}iiic{{d}ii}ddc{iii}iiiiic{iiii}dddc{i}iiicdcddddddc{d}ic{ii}c{{d}i}ic{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}c{ii}dddc{i}iiic{d}icc{i}iiic{{d}ii}ddc{iii}iiiiic{iiii}dddcdddcc{i}iiiic{d}ddddc{{d}iii}ic{iii}iiiiic{iiii}dddc{i}iiicdcddddddc{d}ic{ii}c{{d}i}ic{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}iiiic{iii}dddcddc{d}ddc{ii}dcdddddc{{d}ii}ic{iiiii}dddc{iii}icdddddciiiiiicdc{{d}ii}iic{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{iiiiii}dddc{iiii}dddcdddcc{i}iiiic{d}ddddc{{d}iii}ic{iiiii}iic{iii}dddcddc{d}ddc{ii}dcdddddc{{d}ii}ic{iiiii}dddc{iii}icdddddciiiiiicdc{{d}ii}iic{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}c{ii}dddc{i}iiic{d}icc{i}iiic{{d}ii}ddc{iiiii}iic{iii}dddcddc{d}ddc{ii}dcdddddc{{d}ii}ic{iiiii}dddc{iii}icdddddciiiiiicdc{{d}ii}iic{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}c{ii}dddc{i}iiic{d}icc{i}iiic{{d}ii}ddc{iii}iiiiic{iiii}dddcdddcc{i}iiiic{d}ddddc{{d}iii}ic{iiiii}iic{iii}dddcddc{d}ddc{ii}dcdddddc{{d}ii}ic{iiiii}dddc{iii}icdddddciiiiiicdc{{d}ii}iic{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}iiic{i}iiiiiiciiiiicdddc{ii}icdddc{dd}ddc{i}iiic{{d}ii}iic{iiiii}dddc{iii}icdddddciiiiiicdc{{d}ii}iic{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{iiiiii}dddc{iiii}dddcdddcc{i}iiiic{d}ddddc{{d}iii}ic{iiiii}ic{i}iiiiiiciiiiicdddc{ii}icdddc{dd}ddc{i}iiic{{d}ii}iic{iiiii}dddc{iii}icdddddciiiiiicdc{{d}ii}iic{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}c{ii}dddc{i}iiic{d}icc{i}iiic{{d}ii}ddc{iiiii}ic{i}iiiiiiciiiiicdddc{ii}icdddc{dd}ddc{i}iiic{{d}ii}iic{iiiii}dddc{iii}icdddddciiiiiicdc{{d}ii}iic{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}c{ii}dddc{i}iiic{d}icc{i}iiic{{d}ii}ddc{iii}iiiiic{iiii}dddcdddcc{i}iiiic{d}ddddc{{d}iii}ic{iiiii}ic{i}iiiiiiciiiiicdddc{ii}icdddc{dd}ddc{i}iiic{{d}ii}iic{iiiii}dddc{iii}icdddddciiiiiicdc{{d}ii}iic{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{iiiiii}iiiic{ii}iiic{i}ddciiiiic{{d}ii}iic{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{iiiiii}iiiic{ii}iiic{i}ddciiiiic{{d}ii}iic{iii}iiiiic{iiii}dddcdddcc{i}iiiic{d}ddddc{{d}iii}ic{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{iiiiii}iiiic{ii}iiic{i}ddciiiiic{{d}ii}iic{iiiii}ddc{ii}dddc{i}iiic{d}icc{i}iiic{{d}ii}ddc{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{iiiiii}iiiic{ii}iiic{i}ddciiiiic{{d}ii}iic{iiiii}ddc{ii}dddc{i}iiic{d}icc{i}iiic{{d}ii}ddc{iii}iiiiic{iiii}dddcdddcc{i}iiiic{d}ddddc{{d}iii}ic{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}dddc{ii}c{ii}ddc{dd}iic{i}ic{d}dc{dddddd}dddddc{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{iiiiii}dddc{iiii}dddcdddcc{i}iiiic{d}ddddc{{d}iii}ic{iiii}iiiiic{ii}c{ii}ddc{dd}iic{i}ic{d}dc{dddddd}dddddc{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}c{ii}dddc{i}iiic{d}icc{i}iiic{{d}ii}ddc{iiii}iiiiic{ii}c{ii}ddc{dd}iic{i}ic{d}dc{dddddd}dddddc{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}c{ii}dddc{i}iiic{d}icc{i}iiic{{d}ii}ddc{iii}iiiiic{iiii}dddcdddcc{i}iiiic{d}ddddc{{d}iii}ic{iiii}iiiiic{ii}c{ii}ddc{dd}iic{i}ic{d}dc{dddddd}dddddc{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}dc{iii}icdddddciiiiiicdc{{d}ii}iic{iiii}iiiiic{ii}c{ii}ddc{dd}iic{i}ic{d}dc{dddddd}dddddc{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}dc{iii}icdddddciiiiiicdc{{d}ii}iic{iiiii}ddc{ii}dddc{i}iiic{d}icc{i}iiic{{d}ii}ddc{iiii}iiiiic{ii}c{ii}ddc{dd}iic{i}ic{d}dc{dddddd}dddddc{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{iiiiii}dddc{iiii}dddcdddcc{i}iiiic{d}ddddc{{d}iii}ic{iiiii}dddc{iii}icdddddciiiiiicdc{{d}ii}iic{iiii}iiiiic{ii}c{ii}ddc{dd}iic{i}ic{d}dc{dddddd}dddddc{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}c{ii}dddc{i}iiic{d}icc{i}iiic{{d}ii}ddc{iii}iiiiic{iiii}dddcdddcc{i}iiiic{d}ddddc{{d}iii}ic{iiiii}dddc{iii}icdddddciiiiiicdc{{d}ii}iic{iiii}iiiiic{ii}c{ii}ddc{dd}iic{i}ic{d}dc{dddddd}dddddc{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}iiic{i}iiiiiiciiiiicdddc{ii}icdddc{dd}ddc{i}iiic{{d}ii}iic{iiii}iiiiic{ii}c{ii}ddc{dd}iic{i}ic{d}dc{dddddd}dddddc{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{iiiiii}dddc{iiii}dddcdddcc{i}iiiic{d}ddddc{{d}iii}ic{iiiii}ic{i}iiiiiiciiiiicdddc{ii}icdddc{dd}ddc{i}iiic{{d}ii}iic{iiii}iiiiic{ii}c{ii}ddc{dd}iic{i}ic{d}dc{dddddd}dddddc{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}c{ii}dddc{i}iiic{d}icc{i}iiic{{d}ii}ddc{iiiii}ic{i}iiiiiiciiiiicdddc{ii}icdddc{dd}ddc{i}iiic{{d}ii}iic{iiii}iiiiic{ii}c{ii}ddc{dd}iic{i}ic{d}dc{dddddd}dddddc{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}c{ii}dddc{i}iiic{d}icc{i}iiic{{d}ii}ddc{iii}iiiiic{iiii}dddcdddcc{i}iiiic{d}ddddc{{d}iii}ic{iiiii}ic{i}iiiiiiciiiiicdddc{ii}icdddc{dd}ddc{i}iiic{{d}ii}iic{iiii}iiiiic{ii}c{ii}ddc{dd}iic{i}ic{d}dc{dddddd}dddddc{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}dddc{iiii}iiiicddddddcddddciiic{d}dddc{{d}iii}ic{iiii}iiiiic{ii}c{ii}ddc{dd}iic{i}ic{d}dc{dddddd}dddddc{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}c{ii}dddc{i}iiic{d}icc{i}iiic{{d}ii}ddc{iiii}iiiiic{iiii}iiiicddddddcddddciiic{d}dddc{{d}iii}ic{iiii}iiiiic{ii}c{ii}ddc{dd}iic{i}ic{d}dc{dddddd}dddddc{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{iiiiii}dddc{iiii}dddcdddcc{i}iiiic{d}ddddc{{d}iii}ic{iiii}iiiiic{iiii}iiiicddddddcddddciiic{d}dddc{{d}iii}ic{iiii}iiiiic{ii}c{ii}ddc{dd}iic{i}ic{d}dc{dddddd}dddddc{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}c{ii}dddc{i}iiic{d}icc{i}iiic{{d}ii}ddc{iii}iiiiic{iiii}dddcdddcc{i}iiiic{d}ddddc{{d}iii}ic{iiii}iiiiic{iiii}iiiicddddddcddddciiic{d}dddc{{d}iii}ic{iiii}iiiiic{ii}c{ii}ddc{dd}iic{i}ic{d}dc{dddddd}dddddc{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}c{ii}dddc{i}iiic{d}icc{i}iiic{{d}ii}ddc{iii}iiiiic{iiii}dddcdddcc{i}iiiic{d}ddddc{{d}iii}ic{iiiii}ic{i}iiiiiiciiiiicdddc{ii}icdddc{dd}ddc{i}iiic{{d}ii}iic{iiii}iiiiic{iiii}iiiicddddddcddddciiic{d}dddc{{d}iii}ic{iiii}iiiiic{ii}c{ii}ddc{dd}iic{i}ic{d}dc{dddddd}dddddc{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{iiiiii}iiiiic{ii}iiiiiic{i}iiic{dd}iiic{i}ic{d}dc{dddddd}dddddc{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{iiiiii}iiiiic{ii}iiiiiic{i}iiic{dd}iiic{i}ic{d}dc{dddddd}dddddc{iii}iiiiic{iiii}dddcdddcc{i}iiiic{d}ddddc{{d}iii}ic{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}c{ii}dddc{i}iiic{d}icc{i}iiic{{d}ii}ddc{iiii}iiic{ii}iiiiiic{i}iiic{dd}iiic{i}ic{d}dc{dddddd}dddddc{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}c{ii}dddc{i}iiic{d}icc{i}iiic{{d}ii}ddc{iii}iiiiic{iiii}dddcdddcc{i}iiiic{d}ddddc{{d}iii}ic{iiii}iiic{ii}iiiiiic{i}iiic{dd}iiic{i}ic{d}dc{dddddd}dddddc{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}c{ii}dddc{ii}ic{{d}ii}ddddddc{iii}iiiic{iiii}ddc{d}iiic{i}dcdc{{d}iii}dddc{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}c{ii}dddc{ii}ic{{d}ii}ddddddc{iii}iiiic{iiii}ddc{d}iiic{i}dcdc{{d}iii}dddc{iii}iiiiic{iiii}dddcdddcc{i}iiiic{d}ddddc{{d}iii}ic{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}c{ii}dddc{ii}ic{{d}ii}ddddddc{iii}iiiic{iiii}ddc{d}iiic{i}dcdc{{d}iii}dddc{iiiii}ddc{ii}dddc{i}iiic{d}icc{i}iiic{{d}ii}ddc{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}c{ii}dddc{ii}ic{{d}ii}ddddddc{iii}iiiic{iiii}ddc{d}iiic{i}dcdc{{d}iii}dddc{iii}iiiiic{iiii}dddcdddcc{i}iiiic{d}ddddc{{d}iii}ic{iiiii}ddc{ii}dddc{i}iiic{d}icc{i}iiic{{d}ii}ddc{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}iiic{iii}dciic{d}iciiiiic{d}iiic{{d}iii}dc{iiiii}iiiic{i}iiiiiciicddc{i}iiiiic{dd}icic{i}c{d}iiic{{d}iii}ic{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}iiic{iii}dciic{d}iciiiiic{d}iiic{{d}iii}dc{iiiii}ddc{ii}dddc{i}iiic{d}icc{i}iiic{{d}ii}ddc{iiiii}iiiic{i}iiiiiciicddc{i}iiiiic{dd}icic{i}c{d}iiic{{d}iii}ic{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}iiic{iii}dciic{d}iciiiiic{d}iiic{{d}iii}dc{iii}iiiiic{iiii}dddcdddcc{i}iiiic{d}ddddc{{d}iii}ic{iiiii}iiiic{i}iiiiiciicddc{i}iiiiic{dd}icic{i}c{d}iiic{{d}iii}ic{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}iiic{iii}dciic{d}iciiiiic{d}iiic{{d}iii}dc{iiiii}ddc{ii}dddc{i}iiic{d}icc{i}iiic{{d}ii}ddc{iii}iiiiic{iiii}dddcdddcc{i}iiiic{d}ddddc{{d}iii}ic{iiiii}iiiic{i}iiiiiciicddc{i}iiiiic{dd}icic{i}c{d}iiic{{d}iii}ic{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}iiic{iii}iiiiiic{dd}iicc{i}iiiiic{{d}ii}ddddc{iii}iiiiic{iiii}iiiiciiicddddc{{d}ii}iic{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}iiic{iii}iiiiiic{dd}iicc{i}iiiiic{{d}ii}ddddc{iii}iiiiic{iiii}iiiiciiicddddc{{d}ii}iic{iii}iiiiic{iiii}dddcdddcc{i}iiiic{d}ddddc{{d}iii}ic{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}iiic{iii}iiiiiic{dd}iicc{i}iiiiic{{d}ii}ddddc{iii}iiiiic{iiii}iiiiciiicddddc{{d}ii}iic{iiiii}ddc{ii}dddc{i}iiic{d}icc{i}iiic{{d}ii}ddc{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}iiic{iii}iiiiiic{dd}iicc{i}iiiiic{{d}ii}ddddc{iii}iiiiic{iiii}iiiiciiicddddc{{d}ii}iic{iiiii}ddc{ii}dddc{i}iiic{d}icc{i}iiic{{d}ii}ddc{iii}iiiiic{iiii}dddcdddcc{i}iiiic{d}ddddc{{d}iii}ic{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}iiic{iii}iiiiiic{dd}iicc{i}iiiiic{{d}ii}ddddc{iii}iiiiic{iiii}iiiiciiicddddc{{d}ii}iic{iiiii}ic{i}iiiiiiciiiiicdddc{ii}icdddc{dd}ddc{i}iiic{{d}ii}iic{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}iiic{iii}iiiiiic{dd}iicc{i}iiiiic{{d}ii}ddddc{iii}iiiiic{iiii}iiiiciiicddddc{{d}ii}iic{iiiii}ic{i}iiiiiiciiiiicdddc{ii}icdddc{dd}ddc{i}iiic{{d}ii}iic{iiiii}ddc{ii}dddc{i}iiic{d}icc{i}iiic{{d}ii}ddc{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}iiic{iii}iiiiiic{dd}iicc{i}iiiiic{{d}ii}ddddc{iii}iiiiic{iiii}iiiiciiicddddc{{d}ii}iic{iiiii}ic{i}iiiiiiciiiiicdddc{ii}icdddc{dd}ddc{i}iiic{{d}ii}iic{iii}iiiiic{iiii}dddcdddcc{i}iiiic{d}ddddc{{d}iii}ic{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}iiic{iii}iiiiiic{dd}iicc{i}iiiiic{{d}ii}ddddc{iii}iiiiic{iiii}iiiiciiicddddc{{d}ii}iic{iiiii}ic{i}iiiiiiciiiiicdddc{ii}icdddc{dd}ddc{i}iiic{{d}ii}iic{iiiii}ddc{ii}dddc{i}iiic{d}icc{i}iiic{{d}ii}ddc{iii}iiiiic{iiii}dddcdddcc{i}iiiic{d}ddddc{{d}iii}ic{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}iiic{iii}iiiiiic{dd}iicc{i}iiiiic{{d}ii}ddddc{iii}iiiiic{iiii}iiiiciiicddddc{{d}ii}iic{iiii}iiiiic{iiii}cddc{d}dc{i}cdddccddc{{d}ii}iiic{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}iiic{iii}iiiiiic{dd}iicc{i}iiiiic{{d}ii}ddddc{iii}iiiiic{iiii}iiiiciiicddddc{{d}ii}iic{iiii}iiiiic{iiii}cddc{d}dc{i}cdddccddc{{d}ii}iiic{iiiii}ddc{ii}dddc{i}iiic{d}icc{i}iiic{{d}ii}ddc{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}iiic{iii}iiiiiic{dd}iicc{i}iiiiic{{d}ii}ddddc{iii}iiiiic{iiii}iiiiciiicddddc{{d}ii}iic{iiii}iiiiic{iiii}cddc{d}dc{i}cdddccddc{{d}ii}iiic{iii}iiiiic{iiii}dddcdddcc{i}iiiic{d}ddddc{{d}iii}ic{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}iiic{iii}iiiiiic{dd}iicc{i}iiiiic{{d}ii}ddddc{iii}iiiiic{iiii}iiiiciiicddddc{{d}ii}iic{iiii}iiiiic{iiii}cddc{d}dc{i}cdddccddc{{d}ii}iiic{iiiii}ddc{ii}dddc{i}iiic{d}icc{i}iiic{{d}ii}ddc{iii}iiiiic{iiii}dddcdddcc{i}iiiic{d}ddddc{{d}iii}ic{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}dddc{iiii}cddc{d}dc{i}cdddccddc{{d}ii}iiic{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}dddc{iiii}cddc{d}dc{i}cdddccddc{{d}ii}iiic{iii}iiiiic{iiii}dddcdddcc{i}iiiic{d}ddddc{{d}iii}ic{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}dddc{iiii}cddc{d}dc{i}cdddccddc{{d}ii}iiic{iiiii}ddc{ii}dddc{i}iiic{d}icc{i}iiic{{d}ii}ddc{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}dddc{iiii}cddc{d}dc{i}cdddccddc{{d}ii}iiic{iiiii}ddc{ii}dddc{i}iiic{d}icc{i}iiic{{d}ii}ddc{iii}iiiiic{iiii}dddcdddcc{i}iiiic{d}ddddc{{d}iii}ic{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}iiic{i}iiiiiiciiiiicdddc{ii}icdddc{dd}ddc{i}iiic{{d}ii}iic{iiii}iiiiic{iiii}cddc{d}dc{i}cdddccddc{{d}ii}iiic{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}iiic{i}iiiiiiciiiiicdddc{ii}icdddc{dd}ddc{i}iiic{{d}ii}iic{iiii}iiiiic{iiii}cddc{d}dc{i}cdddccddc{{d}ii}iiic{iiiii}ddc{ii}dddc{i}iiic{d}icc{i}iiic{{d}ii}ddc{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}iiic{i}iiiiiiciiiiicdddc{ii}icdddc{dd}ddc{i}iiic{{d}ii}iic{iiii}iiiiic{iiii}cddc{d}dc{i}cdddccddc{{d}ii}iiic{iii}iiiiic{iiii}dddcdddcc{i}iiiic{d}ddddc{{d}iii}ic{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}iiic{i}iiiiiiciiiiicdddc{ii}icdddc{dd}ddc{i}iiic{{d}ii}iic{iii}iiiiic{iiii}iiiiciiicddddc{{d}ii}iic{iiii}iiiiic{iiii}cddc{d}dc{i}cdddccddc{{d}ii}iiic{iiiii}ddc{ii}dddc{i}iiic{d}icc{i}iiic{{d}ii}ddc{iii}iiiiic{iiii}dddcdddcc{i}iiiic{d}ddddc{{d}iii}ic{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}c{ii}dddc{i}iiic{d}icc{i}iiic{{d}ii}ddc{iii}iiiiic{iiii}dddciciiiccdddc{{d}iii}dddc{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}c{ii}dddc{i}iiic{d}icc{i}iiic{{d}ii}ddc{iii}iiiiic{iiii}dddciciiiccdddc{{d}iii}dddc{iii}iiiiic{iiii}dddcdddcc{i}iiiic{d}ddddc{{d}iii}ic{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}dddc{iiii}cddc{d}dc{i}cdddccddc{{d}ii}iiic{iii}iiiiic{iiii}dddciciiiccdddc{{d}iii}dddc{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}dddc{iiii}cddc{d}dc{i}cdddccddc{{d}ii}iiic{iii}iiiiic{iiii}dddciciiiccdddc{{d}iii}dddc{iii}iiiiic{iiii}dddcdddcc{i}iiiic{d}ddddc{{d}iii}ic{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}dddc{iiii}cddc{d}dc{i}cdddccddc{{d}ii}iiic{iii}iiiiic{iiii}dddciciiiccdddc{{d}iii}dddc{iiiii}ddc{ii}dddc{i}iiic{d}icc{i}iiic{{d}ii}ddc{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}dddc{iiii}cddc{d}dc{i}cdddccddc{{d}ii}iiic{iii}iiiiic{iiii}dddciciiiccdddc{{d}iii}dddc{iiiii}ddc{ii}dddc{i}iiic{d}icc{i}iiic{{d}ii}ddc{iii}iiiiic{iiii}dddcdddcc{i}iiiic{d}ddddc{{d}iii}ic{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}iiic{i}iiiiciiicdddc{dddddd}dddddc{iiiii}iiic{iii}icc{dd}ic{i}iiiiicc{d}dddddc{i}iic{{d}ii}iiic{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}iiic{i}iiiiciiicdddc{dddddd}dddddc{iiiii}iiic{iii}icc{dd}ic{i}iiiiicc{d}dddddc{i}iic{{d}ii}iiic{iii}iiiiic{iiii}dddcdddcc{i}iiiic{d}ddddc{{d}iii}ic{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}iiic{i}iiiiciiicdddc{dddddd}dddddc{iiiii}iiic{iii}icc{dd}ic{i}iiiiicc{d}dddddc{i}iic{{d}ii}iiic{iiiii}ddc{ii}dddc{i}iiic{d}icc{i}iiic{{d}ii}ddc{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}iiic{i}iiiiciiicdddc{dddddd}dddddc{iiiii}iiic{iii}icc{dd}ic{i}iiiiicc{d}dddddc{i}iic{{d}ii}iiic{iiiii}ddc{ii}dddc{i}iiic{d}icc{i}iiic{{d}ii}ddc{iii}iiiiic{iiii}dddcdddcc{i}iiiic{d}ddddc{{d}iii}ic{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}dc{iii}icdddddciiiiiicdc{{d}ii}iic{iiiii}iiic{iii}icc{dd}ic{i}iiiiicc{d}dddddc{i}iic{{d}ii}iiic{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}dc{iii}icdddddciiiiiicdc{{d}ii}iic{iiiii}iiic{iii}icc{dd}ic{i}iiiiicc{d}dddddc{i}iic{{d}ii}iiic{iii}iiiiic{iiii}dddcdddcc{i}iiiic{d}ddddc{{d}iii}ic{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}dc{iii}icdddddciiiiiicdc{{d}ii}iic{iiiii}iiic{iii}icc{dd}ic{i}iiiiicc{d}dddddc{i}iic{{d}ii}iiic{iiiii}ddc{ii}dddc{i}iiic{d}icc{i}iiic{{d}ii}ddc{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}dc{iii}icdddddciiiiiicdc{{d}ii}iic{iiiii}iiic{iii}icc{dd}ic{i}iiiiicc{d}dddddc{i}iic{{d}ii}iiic{iiiii}ddc{ii}dddc{i}iiic{d}icc{i}iiic{{d}ii}ddc{iii}iiiiic{iiii}dddcdddcc{i}iiiic{d}ddddc{{d}iii}ic{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}dddc{ii}c{ii}ddc{dd}iic{i}ic{d}dc{dddddd}dddddc{iiiii}iiic{iii}icc{dd}ic{i}iiiiicc{d}dddddc{i}iic{{d}ii}iiic{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}dddc{ii}c{ii}ddc{dd}iic{i}ic{d}dc{dddddd}dddddc{iiiii}iiic{iii}icc{dd}ic{i}iiiiicc{d}dddddc{i}iic{{d}ii}iiic{iii}iiiiic{iiii}dddcdddcc{i}iiiic{d}ddddc{{d}iii}ic{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}dddc{ii}c{ii}ddc{dd}iic{i}ic{d}dc{dddddd}dddddc{iiiii}iiic{iii}icc{dd}ic{i}iiiiicc{d}dddddc{i}iic{{d}ii}iiic{iiiii}ddc{ii}dddc{i}iiic{d}icc{i}iiic{{d}ii}ddc{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}dddc{ii}c{ii}ddc{dd}iic{i}ic{d}dc{dddddd}dddddc{iiiii}iiic{iii}icc{dd}ic{i}iiiiicc{d}dddddc{i}iic{{d}ii}iiic{iiiii}ddc{ii}dddc{i}iiic{d}icc{i}iiic{{d}ii}ddc{iii}iiiiic{iiii}dddcdddcc{i}iiiic{d}ddddc{{d}iii}ic{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}dddc{iiii}iiiicddddddcddddciiic{d}dddc{{d}iii}ic{iiiii}iiic{iii}icc{dd}ic{i}iiiiicc{d}dddddc{i}iic{{d}ii}iiic{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}dddc{iiii}iiiicddddddcddddciiic{d}dddc{{d}iii}ic{iiiii}iiic{iii}icc{dd}ic{i}iiiiicc{d}dddddc{i}iic{{d}ii}iiic{iii}iiiiic{iiii}dddcdddcc{i}iiiic{d}ddddc{{d}iii}ic{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}dddc{iiii}iiiicddddddcddddciiic{d}dddc{{d}iii}ic{iiiii}iiic{iii}icc{dd}ic{i}iiiiicc{d}dddddc{i}iic{{d}ii}iiic{iiiii}ddc{ii}dddc{i}iiic{d}icc{i}iiic{{d}ii}ddc{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}dddc{iiii}iiiicddddddcddddciiic{d}dddc{{d}iii}ic{iiiii}iiic{iii}icc{dd}ic{i}iiiiicc{d}dddddc{i}iic{{d}ii}iiic{iiiii}ddc{ii}dddc{i}iiic{d}icc{i}iiic{{d}ii}ddc{iii}iiiiic{iiii}dddcdddcc{i}iiiic{d}ddddc{{d}iii}ic{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}dddc{iii}ddc{i}iiiiic{dd}icdc{{d}iii}iic{iiiii}iiic{iii}icc{dd}ic{i}iiiiicc{d}dddddc{i}iic{{d}ii}iiic{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}dddc{iii}ddc{i}iiiiic{dd}icdc{{d}iii}iic{iiiii}iiic{iii}icc{dd}ic{i}iiiiicc{d}dddddc{i}iic{{d}ii}iiic{iii}iiiiic{iiii}dddcdddcc{i}iiiic{d}ddddc{{d}iii}ic{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}dddc{iii}ddc{i}iiiiic{dd}icdc{{d}iii}iic{iiiii}iiic{iii}icc{dd}ic{i}iiiiicc{d}dddddc{i}iic{{d}ii}iiic{iiiii}ddc{ii}dddc{i}iiic{d}icc{i}iiic{{d}ii}ddc{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic{{i}ddd}dddc{iii}ddc{i}iiiiic{dd}icdc{{d}iii}iic{iiiii}iiic{iii}icc{dd}ic{i}iiiiicc{d}dddddc{i}iic{{d}ii}iiic{iiiii}ddc{ii}dddc{i}iiic{d}icc{i}iiic{{d}ii}ddc{iii}iiiiic{iiii}dddcdddcc{i}iiiic{d}ddddc{{d}iii}ic{iii}iiiiiic{iiii}iiiciiiic{dd}iic{{d}i}iiic

```
> 1 votes

# Answer
# ///, 540 bytes

```
/=/0\/\///;/-=`/<21//./5=,/3=>/2=</9=:/1=~/ \/\///0/Dosa
//1/Cheese~2/Paneer~3/Sada~4/Schezwan~5/Onion~6/Chutney~7/Tomato~8/Jain~9/Masala~!/Mysore~@/Kerala~#/Pav Bhaji~$/Spring~%/Vegetable~*/Corn~^/Sweet *//&/Mushroom~|/Chilli~-/Uttappam~_/Mixed /,1,2,21,4,14,24,214,5,15,25,215,6016026021607.17.27.217.4.14.24.214.808:8>82:<1<2`<5<52<15`5<4<14<24`4<!<2!<1!`!`4!<@0@:2@021@0#0#:#>#1>$%0$2%0$1%0$21%0^0^:^>^2:^40^4>^4:^42:^&0^&>^&:^&2:&0&:&>&2:4&04&>4&:4*&2:2|02|:&|0&|:&|>&|2:3;3-:3->3-2:5;5-:5->5-2:9;9-:9->9-2:!;!-:!->!-2:_;_-:_->_-21Dosa

```

Try it online!

Not the most amazing compression but still.
> 0 votes

# Answer
# PHP, ~~425~~ 421 bytes

beating Python again. happy.

```
foreach([_10,_8,_2,"_Chutney ","_Tomato 2",_82,"Jain ",_3,_23,_83,_63,"_Kerala ","Pav Bhaji ","Spring _Vegetable ",7,78,75,5,85,"5X ",100,20,30,60,"Mixed 0"]as$i=>$t){[$a,$b]=explode(_,$t);echo strtr($a.($c=$b."9$a")."1${c}4$c".($i-12?41:14).$b.($i-10?$i-18?9:"98Corn 54194X 94X 19":9418639),["Uttappam ","Cheese ","Onion ","Masala ","Paneer ","Mushroom ","Mysore ","Sweet Corn ","Schezwan ","Dosa
","Sada ",X=>Chilli]);}

```

Run with `-nr` or try it online.
> 0 votes

# Answer
# Ruby, 448 bytes

```
00000000  72 65 71 75 69 72 65 20  27 7a 6c 69 62 27 0a 70  |require 'zlib'.p|
00000010  75 74 73 20 5a 6c 69 62  3a 3a 49 6e 66 6c 61 74  |uts Zlib::Inflat|
00000020  65 2e 69 6e 66 6c 61 74  65 28 44 41 54 41 2e 72  |e.inflate(DATA.r|
00000030  65 61 64 29 0a 5f 5f 45  4e 44 5f 5f 0a 78 da 8d  |ead).__END__.x..|
00000040  55 cd 4e c3 30 0c be f3  14 7d 16 c6 09 34 81 54  |U.N.0....}...4.T|
00000050  e0 6e 98 b5 06 75 cd d4  76 1b e3 e9 11 5a 9a d9  |.n...u..v....Z..|
00000060  f1 e7 8c 5b fb fd 26 4e  95 b6 b4 a1 e6 21 4e 74  |...[..&N.....!Nt|
00000070  b7 ea 98 27 6e da 0c bc  d0 c0 3c 5a c0 08 db cf  |...'n.....<Z....|
00000080  8e 7f 4e 34 08 68 d1 58  66 49 75 19 df fa 3c 84  |..N4.h.XfIu...<.|
00000090  08 4a 4a 38 e5 38 b0 63  5a 75 87 79 e0 b3 0a 56  |.JJ8.8.cZu.y...V|
000000a0  58 b6 23 cc ca 5f e3 8e  e6 98 6a 64 a8 25 52 8a  |X.#.._....jd.%R.|
000000b0  4b b8 c6 3c 22 db 82 a8  72 f2 6e 13 52 3c 52 90  |K..<"...r.n.R<R.|
000000c0  4f 49 79 05 52 82 01 a4  70 4d 13 f5 fa ec 24 94  |OIy.R...pM....$.|
000000d0  1c 00 02 e2 cb d2 2c 02  42 d4 89 fb e9 96 cf 73  |......,.B......s|
000000e0  00 69 90 2b 27 ec 97 41  c9 fa 3c c5 11 cf c4 32  |.i.+'..A..<....2|
000000f0  cb 4c 5c cf 7f 05 d7 a5  58 e5 13 8f e5 b3 3c d0  |.L\.....X.....<.|
00000100  14 24 55 3a 5b 33 c7 e6  be a3 af 50 be ea c4 05  |.$U:[3.....P....|
00000110  95 1f 94 d1 4a b2 dd 8f  61 d8 36 ef bc e5 99 3e  |....J...a.6....>|
00000120  7a 56 68 12 62 32 85 55  9d 8e e6 c4 3c 37 ab 38  |zVh.b2.U....<7.8|
00000130  0e e6 5d ee 46 c0 6a c5  06 76 4c f9 68 5c c2 89  |..].F.j..vL.h\..|
00000140  cd fc ad e0 7a ff fa 30  75 63 8c 3b 9f 70 fa 33  |....z..0uc.;.p.3|
00000150  7f 2b 18 dd 12 aa 14 26  c1 fa 5a e6 f5 1b d7 3b  |.+.....&..Z....;|
00000160  32 b0 da 8f 61 61 e4 cd  0d 65 28 f4 7d 40 10 dc  |2...aa...e(.}@..|
00000170  9a 94 97 60 cd 00 47 a2  39 b5 8d bf 3f e0 db 3c  |...`..G.9...?..<|
00000180  d3 7e 4f 3b 04 f9 62 35  2b c4 48 eb e5 76 d5 45  |.~O;..b5+.H..v.E|
00000190  05 56 91 cb 2a 4c 81 ff  8c 2e 2b c1 9a 41 cd 10  |.V..*L....+..A..|
000001a0  73 ca 7e b9 38 8b be 02  ac 19 54 1f e6 94 3d 7c  |s.~.8.....T...=||
000001b0  f3 a6 ac d3 58 45 ae ca  20 25 cc bf fa c0 88 fb  |....XE.. %......|

```
> 0 votes

---
Tags: code-golf, kolmogorov-complexity
---


title: Print "Hey Jude" from The Beatles

text:
# Question
Title: Print "Hey Jude" from The Beatles
Your task is to write a program which prints following four verses extracted from the lyrics from The Beatles' song "Hey Jude" (© Sony/ATV Music Publishing LLC):

```
Hey Jude, don't make it bad\n
Take a sad song and make it better\n
Remember to let her into your heart\n
Then you can start to make it better\n
\n
Hey Jude, don't be afraid\n
You were made to go out and get her\n
The minute you let her under your skin\n
Then you begin to make it better\n
\n
Hey Jude, don't let me down\n
You have found her, now go and get her\n
Remember to let her into your heart\n
Then you can start to make it better\n
\n
Hey Jude, don't make it bad\n
Take a sad song and make it better\n
Remember to let her under your skin\n
Then you'll begin to make it\n
\n

```

**BUT**

The only input you are allowed to use to construct these four verses is this list of tokens:

```
"Hey Jude, don't"
" make it bad"
" be afraid"
" let me down"
"Take a sad song and make it better"
"You"
" were made to go out"
" and get her"
" have found her, now go"
"Remember to"
"The minute you"
" let her"
" into your heart"
" under your skin"
"Then"
" you"
" can start"
"'ll"
" begin"
" to make it"
" better"

```

Note that some tokens have a space preceded and that enclosing quotes are not part of the tokens. You are free to use any format for the list and to rearrange the order of the tokens.

Your generated output has to **exactly** match the above four verses. Note that`\n` is used for newlines and an **extra newline** is added after each verse. You can use this file (MD5: `4551829c84a370fc5e6eb1d5c854cbec`) to check your output against.

You can use following railroad diagram to understand the structure of the verses (each element represents a token):

Shortest code in bytes wins. Happy golfing.

# Answer
# Jelly, 42 bytes

```
;⁷“Ṙç€ṘḋḷŒø|Ṁ2kḤ⁽⁼SƁẒVṿẎj]ð⁵ṀƒƤ)÷Ƒ¦Ẋ½Iɠ⁻’ṃ

```

Try it online!

Hardcoding version.

Input:

```
["Hey Jude, don't", ' make it bad', 'Take a sad song and make it better', 'Remember to', ' let her', ' into your heart', 'Then', ' you', ' can start', ' to make it', ' better', ' be afraid', 'You', ' were made to go out', ' and get her', 'The minute you', ' under your skin', ' begin', ' let me down', ' have found her, now go', "'ll"]

```
> 9 votes

# Answer
# JavaScript (ES6), 108 bytes

```
a=>`01
4
9bc
efgjk

02
567
abd
efijk

03
587
9bc
efgjk

01
4
9bd
efhij

`.replace(/./g,n=>a[parseInt(n,36)])

```

Try it online!

---

# Alternate version, 114 bytes

A slightly better compression, but sadly ruined by the larger decompression code.

```
a=>`835fc3cbbd3
84db3db4bbdb3
85cd1cc3cbbd3
835fc4bbcb3

`.replace(/./g,n=>a[n='0x'+n,i=n%8&&n%8-2+i]+[`
`[n>>3]])

```

Try it online!
> 17 votes

# Answer
# Ruby \+ `-p`, ~~177~~ ~~136~~ ~~120~~ ~~118~~ ~~115~~ 109 bytes (full program)

```
$_="abvevjlmvopqtuvvacvfghvklnvopstuvvadvfihvjlmvopqtuvvabvevjlnvoprstv".gsub(/./){|c|(eval$_)[c.ord-97]||$/}

```

Try it online!

-41 bytes: Switch from using variables to using characters as array indexes

-16 bytes: Switch to a more convenient input format

-1 byte: No space needed between `puts` and `"abv...`

-1 byte: Use `$/` global instead of `?\n` literal

-3 bytes: Use `gsub(/./)` instead of `.chars.map`

-6 bytes: Call with `-p` and make use of `$_`. *Thanks Pavel!*

Each character in the magic string represents an index into the input array. ~~I need the variable `z` so that I only read from STDIN once.~~

I could save some cost from IO by writing a lambda accepting an array and returning a string. This requires an extra `v` at the end, because it's not getting a free newline from `-p`.

# Ruby, ~~162~~ ~~110~~ ~~108~~ 105 bytes (function)

```
->z{"abvevjlmvopqtuvvacvfghvklnvopstuvvadvfihvjlmvopqtuvvabvevjlnvoprstvv".gsub(/./){|c|z[c.ord-97]||$/}}

```

Try it online!
> 7 votes

# Answer
# Java 8, ~~241~~ ~~233~~ ~~141~~ ~~140~~ 138 bytes

```
a->{a.add("\n");"01E4E9;<E>?@CDEE02E567E:;=E>?@CDEE03E587E91<E>?@CDEE01E4E91=E>?ABCEE".chars().forEach(i->System.out.print(a.get(i-48)));}

```

**Explanation:**

Try it online.

```
a->{                  // Method with ArrayList<String> parameter and no return-type
 a.add("\n");         //  Add a new-line as last item (index 21) to the input-List
 "01E4E9;<E>?@CDEE02E567E:;=E>?@CDEE03E587E91<E>?@CDEE01E4E91=E>?ABCEE".chars().forEach(i->
                      //  Loop over the bytes of this String above
   System.out.print(  //   Print:
     a.get(i-48)));}  //    The String in the list at index `i-48`

```

It basically converts the ASCII characters `0` (48) through `E` (69) to the 0-indexed indices `0` through `21` with the `i-48`.
> 4 votes

# Answer
# 05AB1E, ~~142~~ ~~68~~ ~~66~~ 65 bytes

```
`¶)•7/è¸ĀuVI{è:÷MDS.₁bö¼d@ÉÃƶõî›Λðë’OŒβι"žHƒö>“ÃaÈǝõöÓ∍¿þœθÀ•2ôèJ

```

Try it online!

-74 bytes thanks to EriktheOutgolfer, using a base-255 compressed string.

-2 bytes by reversing the compressed string to prevent having to concatenate three 0's

-1 byte thanks to EriktheOutgolfer, by switching two items in the input array in order to avoid the leading 0's, and thus removing the Reverse *R* command.
> 4 votes

# Answer
# Python 3, ~~162~~ ~~147~~ ~~144~~ ~~142~~ ~~138~~ 127 bytes

```
lambda k,x=b'ABVCVDEFVGHIJKVVALVMNOVPEWQVGHRJKVASVVMTOV':"".join([(k+['\n',' '])[i-65]for i in x+x[5:16]+x[:4]+b'VDEWQVGHURJ'])

```

Try It Online

Special thanks to user202729 and Pavel.
> 4 votes

# Answer
# Retina 0.8.2, 115 bytes

```
^
12F5F:<=F?@ADEFF13F678F;<>F?@CDEFF14F698F:<=F?@ADEFF12F5F:<>F?@BCDF¶
{`1(?=.*¶(.*))
$1
^(.*)¶.*
$1
}T`1-E`0-D
F
¶

```

Try it online! Takes input as a newline-delimited list of strings.
> 2 votes

# Answer
# Stax, 59 58 bytes

```
îòÖ╥╬╬╞:,y╓ønä⌠╦╒ï╦≤x◘‼ε╩ⁿ◙ΓZ►e«qpôr╡"╣Ü≥┤╢┴;╡ÑkAú0:=;m╠╠x

```

Run and debug it

The corresponding ascii representation of the same program is this.

```
`ORIpY$T&z{m6Y=>mR)_ .VQ)eN70e[:0yO8j$^RN[ Bp{IN/$|"3^;G#^&lv!`FAx+@]p

```

``ORIpY$T&z{m6Y=>mR)_ .VQ)eN70e[:0yO8j$^RN[ Bp{IN/$|"3^;G#^&lv!`` is a compressed literal with a value of `"CDBGBLNOBQRSVWBBCEBHIJBMNPBQRUVWBBCFBHKJBLNOBQRSVWBBCDBGBLNPBQRTUVBB"`. The characters represent indexes into the token table. This program adds another token to represent a newline. It's not in the input, but added during execution. The rest of the program works like this.

```
F           for each character, execute the rest of the program
 A          integer literal 10, character code of newline
  x+        append 10 to the input array
    @       get element at index, using wrap-around
                the list is size 22, and B is 66, so B gets the first token
     ]      wrap the result in a singleton array.
                this effectively turns 10 into "\n"
      p     print without newline

```
> 2 votes

# Answer
# C (gcc) function, 139 bytes

```
i,m;f(char**s){for(i=0;i<68;)m="AB@E@JLM@OPQTU@@AC@FGH@KLN@OPSTU@@AD@FIH@JLM@OPQTU@@AB@E@JLN@OPRST@@"[i++],printf(m^64?"%s":"\n",s[m-65]);}

```

Try it online!
> 2 votes

# Answer
# Red, 133 bytes

```
foreach c{abzezjlmzopqtuzzaczfghzklnzopstuzzadzfihzjlmzopqtuzzabzezjlnzoprstzz}[prin either c =#"z"["^/"][t/(to-integer c -#"a"+ 1)]]

```

Try it online!

Ungolfed

`t` is a block with the list of tokens

```
s:{abzezjlmzopqtuzzaczfghzklnzopstuzzadzfihzjlmzopqtuzzabzezjlnzoprstzz}
foreach c s[                           ; for each character in s
    prin either c = #"z"               ; if it's a 'z'
        ["^/"]                         ; print CR
        [t/(to-integer c - #"a" + 1)]  ; otherwise find which token to print
]                                      ; by mapping its offset to the alphabet

```
> 1 votes

# Answer
# , 166 bytes

```
import std.algorithm,std.range;T f(T)(T[]s){return"abvevjlmvopqtuvvacvfghvklnvopstuvvadvfihvjlmvopqtuvvabvevjlnvoprstvv".map!((int a){return(s~["\n"])[a-97];}).join;}

```

Try it online!
> 1 votes

# Answer
# Mathematica, 102 bytes

```
""<>Append[#,"
"][[36^^ajikrj7lg8pya7wgtt43pvrilsik1dea1uht6mx3go33m4mjj02hb4wi9w3~IntegerDigits~23]]&

```

Pure function. Takes a list of strings as input and returns a string as output. Just encodes all the token indices, similarly to other answers.
> 1 votes

# Answer
# Ruby, 97 bytes

```
->a{112.times{|i|$><<a[i%7-1+i%28/7*5]*("0@Xg(44k$,Xg0@Tz"[i/7].ord>>~i%7&1)+$/*(i%7/6+i%28/27)}}

```

Try it online!

Saved a few bytes with a different approach to most other answers.

The number of possible tokens in each line is as follows

```
Line number   Tokens
1             4
2             5
3             5
4             7

```

The magic string contains one character per line, which is interpreted as a bitmap of which of up to 7 available tokens is to be printed for each of the 16 lines of the song.

`a[i%7-1+i%28/7*5]` iterates through the tokens of each line, shifting by 5 for each new line, and with an offset of 1 to account for the fact that the first line has only 4 tokens.

For lines 1-3 only the 64's through 4's bits are used - not using the 2's and 1's bits avoids printing tokens from the next line. for line 4, all 7 bits from 64's to 1's are used.
> 1 votes

# Answer
# Deadfish~, 4275 bytes

```
{{i}ddd}iic{iii}dc{ii}c{{d}i}ic{iiii}iic{iiii}iiic{dd}iiicic{dddddd}iiic{d}ddc{{i}ddd}ddc{i}icdc{{d}iii}dc{{i}dd}dddc{{d}ii}ddddc{{i}dd}dddc{d}ddc{i}cddddddc{{d}iii}ic{{i}ddd}iiic{i}ic{{d}ii}ddddc{iiiiii}iiiiiicdciiic{{d}i}c{{i}ddd}iiiic{i}iiic{i}cddddddc{{d}iii}ic{iiiiii}iiiiic{dddddd}dddddc{{i}dd}iiic{dd}iiciiic{{d}iii}iic{{i}dd}iiicddddcdc{d}iiic{{d}iii}dc{iiiiii}iiiiic{i}iiic{d}c{{d}iii}iic{{i}dd}dddc{d}ddc{i}cddddddc{{d}iii}ic{{i}ddd}iiic{i}ic{{d}ii}ddddc{iiiiii}iiiiiiciiic{i}iiiiicc{d}dddddc{i}iiic{{d}}ddddc{{i}ddd}iic{ii}dc{i}ddc{d}iic{i}ddc{d}dciiic{i}iiic{{d}ii}ddc{{i}dd}iiiicdddddc{{d}ii}ic{{i}ddd}iiiiiic{d}iiic{i}iiiiic{{d}ii}ddddc{{i}ddd}iicdddc{i}iiic{{d}ii}ddc{{i}ddd}iiiciiiiiciiiiiicdddddc{{d}ii}ic{{i}d}dc{d}ciiiiiicdddc{{d}ii}ddc{{i}ddd}iicdddcddddc{ii}dddciic{{d}}ddddddc{{i}ddd}iiiic{ii}cdddc{i}dc{{d}ii}iic{{i}d}dc{d}ciiiiiic{{d}ii}dddddc{{i}ddd}dddcddc{i}iiic{{d}ii}iic{{i}dd}iiicic{dd}ic{ii}dddciic{{d}ii}ddddc{{i}dd}iiiicdddddc{{d}ii}ic{{i}dd}dddc{d}ddc{i}cddddddc{{d}iii}ic{{i}ddd}iiic{i}ic{{d}ii}ddddc{iiiiii}iiiiiiciiic{i}iiiiicc{d}dddddc{i}iiic{{d}}ddddcc{iiiiii}iic{iii}dc{ii}c{{d}i}ic{iiii}iic{iiii}iiic{dd}iiicic{dddddd}iiic{d}ddc{{i}ddd}ddc{i}icdc{{d}iii}dc{{i}dd}dddc{{d}ii}ddddc{iiiiii}iiiiiiciiic{{d}iii}ic{iiiiii}iiiiiciiiiic{i}iic{dd}iiic{i}ddcdddddc{{d}i}c{{i}dd}dc{ii}iiciiiiiic{{d}ii}dddddc{{i}d}dddc{dd}iic{i}iiic{d}dddc{{d}iii}ic{{i}dd}dddc{d}ddciiicic{{d}iii}ic{{i}dd}iiiicdddddc{{d}ii}ic{{i}ddd}ic{i}ddc{{d}ii}ic{{i}dd}dciiiiiicdc{{d}ii}ddddc{iiiiii}iiiiic{i}iiic{d}c{{d}iii}iic{{i}ddd}icddc{i}iiiiic{{d}ii}ddddc{{i}ddd}iicdddc{i}iiic{{d}}ddddc{{i}ddd}iiiic{ii}cdddc{{d}iii}ic{{i}dd}dddcddddciiiiic{i}dddcdc{d}dddddc{{d}iii}ic{{i}d}dc{d}ciiiiiic{{d}ii}dddddc{{i}ddd}iiiiiic{d}iiic{i}iiiiic{{d}ii}ddddc{{i}ddd}iicdddc{i}iiic{{d}ii}ddc{{i}dd}iiiiic{d}iiic{d}cic{i}iiic{{d}ii}ddc{{i}d}dc{d}ciiiiiicdddc{{d}ii}ddc{{i}dd}iiic{d}iicddciiiiic{{d}}c{{i}ddd}iiiic{ii}cdddc{i}dc{{d}ii}iic{{i}d}dc{d}ciiiiiic{{d}ii}dddddc{iiiiii}iiiiiiciiiciiciiciiiiic{{d}ii}iic{{i}dd}iiiicdddddc{{d}ii}ic{{i}dd}dddc{d}ddc{i}cddddddc{{d}iii}ic{{i}ddd}iiic{i}ic{{d}ii}ddddc{iiiiii}iiiiiiciiic{i}iiiiicc{d}dddddc{i}iiic{{d}}ddddcc{iiiiii}iic{iii}dc{ii}c{{d}i}ic{iiii}iic{iiii}iiic{dd}iiicic{dddddd}iiic{d}ddc{{i}ddd}ddc{i}icdc{{d}iii}dc{{i}dd}dddc{{d}ii}ddddc{{i}ddd}iiiiiic{d}iiic{i}iiiiic{{d}ii}ddddc{{i}dd}dddc{d}iic{{d}iii}ic{{i}ddd}ddc{i}ic{i}ddc{d}ic{{d}}c{{i}dd}dc{ii}iiciiiiiic{{d}ii}dddddc{{i}ddd}iic{d}iiic{ii}ic{dd}iiic{{d}iii}ic{{i}ddd}c{i}dciiiiiic{d}iiic{d}c{{d}iii}iic{{i}ddd}iicdddc{i}iiic{{d}iii}c{d}ddc{{i}dd}ddcic{i}ddc{{d}i}iiic{{i}ddd}ic{i}ddc{{d}ii}ic{iiiiii}iiiiic{i}iiic{d}c{{d}iii}iic{{i}ddd}icddc{i}iiiiic{{d}ii}ddddc{{i}ddd}iicdddc{i}iiic{{d}}ddddc{{i}ddd}iic{ii}dc{i}ddc{d}iic{i}ddc{d}dciiic{i}iiic{{d}ii}ddc{{i}dd}iiiicdddddc{{d}ii}ic{{i}ddd}iiiiiic{d}iiic{i}iiiiic{{d}ii}ddddc{{i}ddd}iicdddc{i}iiic{{d}ii}ddc{{i}ddd}iiiciiiiiciiiiiicdddddc{{d}ii}ic{{i}d}dc{d}ciiiiiicdddc{{d}ii}ddc{{i}ddd}iicdddcddddc{ii}dddciic{{d}}ddddddc{{i}ddd}iiiic{ii}cdddc{i}dc{{d}ii}iic{{i}d}dc{d}ciiiiiic{{d}ii}dddddc{{i}ddd}dddcddc{i}iiic{{d}ii}iic{{i}dd}iiicic{dd}ic{ii}dddciic{{d}ii}ddddc{{i}dd}iiiicdddddc{{d}ii}ic{{i}dd}dddc{d}ddc{i}cddddddc{{d}iii}ic{{i}ddd}iiic{i}ic{{d}ii}ddddc{iiiiii}iiiiiiciiic{i}iiiiicc{d}dddddc{i}iiic{{d}}ddddcc{iiiiii}iic{iii}dc{ii}c{{d}i}ic{iiii}iic{iiii}iiic{dd}iiicic{dddddd}iiic{d}ddc{{i}ddd}ddc{i}icdc{{d}iii}dc{{i}dd}dddc{{d}ii}ddddc{{i}dd}dddc{d}ddc{i}cddddddc{{d}iii}ic{{i}ddd}iiic{i}ic{{d}ii}ddddc{iiiiii}iiiiiicdciiic{{d}i}c{{i}ddd}iiiic{i}iiic{i}cddddddc{{d}iii}ic{iiiiii}iiiiic{dddddd}dddddc{{i}dd}iiic{dd}iiciiic{{d}iii}iic{{i}dd}iiicddddcdc{d}iiic{{d}iii}dc{iiiiii}iiiiic{i}iiic{d}c{{d}iii}iic{{i}dd}dddc{d}ddc{i}cddddddc{{d}iii}ic{{i}ddd}iiic{i}ic{{d}ii}ddddc{iiiiii}iiiiiiciiic{i}iiiiicc{d}dddddc{i}iiic{{d}}ddddc{{i}ddd}iic{ii}dc{i}ddc{d}iic{i}ddc{d}dciiic{i}iiic{{d}ii}ddc{{i}dd}iiiicdddddc{{d}ii}ic{{i}ddd}iiiiiic{d}iiic{i}iiiiic{{d}ii}ddddc{{i}ddd}iicdddc{i}iiic{{d}ii}ddc{{i}dd}iiiiic{d}iiic{d}cic{i}iiic{{d}ii}ddc{{i}d}dc{d}ciiiiiicdddc{{d}ii}ddc{{i}dd}iiic{d}iicddciiiiic{{d}}c{{i}ddd}iiiic{ii}cdddc{i}dc{{d}ii}iic{{i}d}dc{d}ciiiiiic{{d}ii}iic{{i}ddd}dcc{{d}iii}ddddddc{iiiiii}iiiiiiciiiciiciiciiiiic{{d}ii}iic{{i}dd}iiiicdddddc{{d}ii}ic{{i}dd}dddc{d}ddc{i}cddddddc{{d}iii}ic{{i}ddd}iiic{i}ic

```
> 0 votes

---
Tags: code-golf, kolmogorov-complexity
---


# Question
Title: A Zealous "Quick Brown Fox" "Jumped" Along the Groovy Spiral
# Introduction

Write a program to output the outgoing spiral of the famous pangram following given rules.

# Challenge

A pangram is a sentence using every letter of a given alphabet at least once. One of the most famous pangrams is the one used extensively in Windows font viewer, namely "The quick brown fox jumps over the lazy dog". The challenge is to output a spiral based on this text.

Your task is output this exact text:

```
heeeeellllllllllllazzzzzzzzzzz
hummmmmmmmmmmmmppppppppppppppy
hubrrrrrrrrrrrrrrrrrrooooooosy
hukyddddoooooooooooooooggggwsy
hukyveeeeerrrrrrrrrrrrrrrrtwsy
hukyvxjjjjjjjjjjuuuuuuuuuttwsy
hukyvxkbbrrrrrrrrrrrrrrrmttwsy
hukyvxkogggggggttttttttomttwsy
tukyvokoellllllllllllahomttwsy
tukyvokoeovvvvvvvvvvvzhomttwsy
tukyvocoeoummmmmmmmmezhomttwsy
tukyvocoeoufooooooopezhomttwsy
tukyvocohoufroooooxpezhomttwsy
tukyvoiohoufrquuuwxpezhomttwsy
tucyvoiohoufbqttiwxpezhomttwsy
tucyvoiohoufbeehiwxprzhomttwsy
tucyvoiohoufkccciwxprzeomttwsy
tjiyvoidhounnnnnnwxprzeomttwsy
tjiyvoidhojjjjjjjjxprzeomttwsy
tjiyvoidhssssssssssprzeopttwsy
tjiyvoidttttttttttttrzeopttwsy
tjiyvoiyyyyyyyyyyyyyyzqopttwoy
tjiyvouuuuuuuuuuuuuuuuqwpttwoy
tjiyvffffnnnnnnnnnnnnnnwpttwoy
tjiyossssssssssssssssssspthwoy
tjizzzzalllllllllllleeeeehhwoy
tjuuqqqqqqqqqqqqqqqqqeeeeehnod
txxxxxoooooooooooooooffffffnod
reeeeevvvvvvvvvvvvvvvvvvvvvvod
       gggggggoooooooooooooood

```

Here is how it is generated,

* There was a zealous fox who enjoyed the pangram "The quick brown fox jumps over the lazy dog". One day he was in the center of an outward spiral and decided to jump in it and paint along.
* He would like to go through the pangram from the beginning to the end, and if a letter is the n-th letter in the alphabet he would like to paint it n times.
* However, the fox was not very good at making turns on corners, so upon reaching each corner he also had to stop and switch to the next letter.
* He also decided to repeat the pangram thrice to emphasize that he is **the** quick brown fox.
* Your job is to show how the spiral would look like after the fox painted all those letters.

(Plain version without story-telling)

* The famous pangram "The quick brown fox jumps over the lazy dog" is repeated thrice, with the spaces removed and all letters in lower case, to generate

```
thequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydog

```
* The spiral starts from the center and begins with the letter "t", it starts by going to the right, and goes outward clockwise. If the current character is the n-th letter in the alphabet, then it switches to the next character whenever

+ the spiral reaches a corner, or
    + the current letters is printed exactly n times.

To better illustrate it, I will explain how the spiral related to the first three words "thequickbrown" is generated.

```
 rooooo
 rquuuw
 bqttiw
 beehiw
 kccciw
nnnnnnw

```

The fox starts from "t", goes right, reaches the 1st corner, paints it **with the "t" and then switches** to "h" and goes down, reaches the 2nd corner, switches to "e" and goes left, reaches the 3rd corner, switches to "q" and goes up, reaches the 4th corner, switches to "u" and goes right, reaches a corner and switches to "i", goes down, reaches a corner and switches to "c", goes left, successfully **paints 3 "c"s before reaching the next corner**, switches to "k" and **goes on to the left**, reaches a corner right away, switches to "b" and goes up, **paints 2 "b"s** before reaching the next corner, switches to "r" and **goes on upwards**, reaches a corner and switches to "o", goes right, then "w", down, "n", left.

# Specs

* You can take an optional input that contains any standard form of the string

```
thequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydog

```
* Your output must be formatted as a string, and must go to STDOUT instead of files or STDERR, with newlines placed correctly. Heading and trailing empty lines do not matter. Heading and trailing spaces in each line are allowed, but need to be be consistent. So if you add 5 spaces before one line of the given text, you'll need to add exactly 5 spaces before each line so that the spiral looks the same.
* This is , the lowest number of bytes wins.
* As usual, default loopholes apply here.

---

 Explanations are welcome, although not necessary.

 Title edited to make it a pangram per comment by caird coinheringaahing.

 The lazy dog is too lazy to appear in the story.

 I am aiming at creating a string challenge in which the letter to output cannot be computed by simple functions of the coordinates.

# Answer
> 6 votes
# Stax, 35 34 33 32 bytes

```
é╛îá%ⁿ┌○iê}→Ug=╩◙╘Ç⌐)QX↑L╓₧╗▌╧▬q

```

Run and debug it online

Stax is a language I've been working on for about 6 months. This is the first public golfing with it. Let's get down to business.

Stax is normally written in the printable ASCII character set. This 34 byte submission is packed into a variant of the CP437 character set. The corresponding ascii representation is

```
't],{]_96-*~cHT,+nh%^(XUs&xH{rM}MF|<mr

```

Stax is a stack based language, but it has two data stacks, "main" and "input". Most operations use the main stack, but input starts on the input stack. Stax instructions are mostly one or two character ascii sequences. Most of them are overloaded, meaning their behavior is determined by the top few values on the stack(s).

At a high level, this program builds a grid by repeatedly appending strings to the last row. When the last row fills up, it rotates the grid clockwise. At the end, it mirrors the grid horizontally. In more detail, the program works like this.

```
't],{]_96-*~cHT,+nh%^(XUs&xH{rM}MF|<mr
't]                                         ["t"]
   ,                                        Pop from input, push to main ("thequick...")
    {                            F          For each character in input, execute block...
     ]_96-*                                 Produce string using character appropriate
                                                number of times (a=1, b=2, etc)
           ~                                Pop from main, push to input for use later
            cH                              Copy last row from grid.
              T                             Right-trim whitespace
               ,+                           Pop from input stack and append
                 nh%                        Get the width of the first row of the grid
                    ^                       Add 1
                     (                      Right-pad/truncate string to this length
                      X                     Store in the x register
                       Us&                  Overwrite last row of the grid with new value.
                          xH                Get the last element from x.
                                                Basically, the lower right corner.
                             {  }M         Conditionally execute block.  This will happen
                                                when the bottom right corner isn't a space.
                              rM            Reverse and transpose (aka rotate clockwise)
                                  |<        Left-justify grid; give all rows equal size.
                                     m      For each row, execute the rest of the program
                                               and then print the result to output
                                      r     Reverse the row

```

# Answer
> 12 votes
# Charcoal, ~~66~~ ~~40~~ 36 bytes

```
≔²ηＦＳ«Ｆ¬η«¶↷⊞υη≔⊕÷Ｌυ²η¶»Ｆ⊕⌕βι¿η«≦⊖ηι

```

Try it online! Link is to verbose version of code. Edit: Saved 16 bytes by taking the text as input. Explanation:

```
≔²η

```

Start with 2 `t`s for some reason.

```
ＦＳ«

```

Loop over all the letters in the pangram.

```
Ｆ¬η«

```

Have we reached a corner yet?

Move down (or whatever the next direction will be) one line.

Rotate the print direction 90° clockwise.

```
⊞υη≔⊕÷Ｌυ²η

```

Calculate the length of the next side.

```
¶»

```

Finish fixing up the cursor position. (Charcoal would have preferred the side to end just before the corner, so that you rotated on the corner itself.)

```
Ｆ⊕⌕βι

```

Loop as many times as the current letter's position in the alphabet.

```
¿η«

```

If we haven't reached the corner,

```
≦⊖ηι

```

Decrement the count and print the current letter.

# Answer
> 2 votes
# Ruby, ~~217~~ ~~212~~ ~~209~~ 208 bytes

```
->s{s+=' '*8
x=0
a=[""]*30
i=14
a[i]=?t
l=->{a[i]=s[x]+a[i]}
r=->{a[i]+=s[x]}
(0..58).map{|g|c=0
(0..g/2).map{c>s[x].ord-97&&(x+=1;c=0)
c+=1
eval %w{r i+=1;r l i-=1;l}[g%4]+"[]"}
x+=1}
a[-1].slice!0
$><<a*$/}

```

Try it online!

Spends a fair amount of time managing pointers, so there may be room for more golfing.

-5 bytes: Triple the pangram *before* inputting. Thanks to Weijun Zhou.

-3 bytes: Pad the input string and trim the last leg, instead of generating the last leg from scratch.

-1 bytes: Use `&&` instead of a ternary operator with a throwaway value.

Explanation:

```
->s{
  s += " " * 8                             # These spaces will show on the bottom row
  x = 0                                    # x is a pointer into s
  a = [""] * 30                            # a is an array of row strings
  i = 14                                   # i is a pointer into a
  a[i] = ?t                                # "Starts with two t's for some reason"
  l = ->{ a[i] = s[x]+a[i] }               # lambda to prepend char x to row i
  r = ->{ a[i] += s[x] }                   # lambda to append char x to row i
  (0..57).map{|g|                          # There are 58 "legs" to the spiral
    c = 0                                  # c is the print count of s[x]
    (0..g/2).map{                          # Leg g has g/2+1 characters
      c > s[x].ord-97 && (x+=1;c=0)        # Possibly switch to next letter
      c += 1
      eval %w{r i+=1;r l i-=1;l}[g%4]+"[]" # Call the appropriate lambda
    }
    x += 1                                 # Definitely switch to next letter
  }
  a[-1].slice!0                            # Remove the first char from the bottom row
  $> << a*$/                               # Join with newlines and print
}

```

# Answer
> 0 votes
# Deadfish~, 3360 bytes

```
{i}cc{{i}d}iiiicdddccccc{i}ddd{c}cc{d}dc{ii}iiiii{c}c{{d}}{d}ddc{{i}d}iiiic{i}iiic{d}ii{c}ccciii{c}cccc{i}dc{{d}}{d}dc{{i}d}iiiic{i}iiic{dd}ic{i}iiiiii{c}ccccccccdddccccccciiiiciiiiiic{{d}}{d}dc{{i}d}iiiic{i}iiic{d}c{i}iiiic{dd}dcccc{i}i{c}ccccc{d}iicccc{i}iiiiiicddddciiiiiic{{d}}{d}dc{{i}d}iiiic{i}iiic{d}c{i}iiiicdddc{dd}iiiccccc{i}iii{c}cccccciiciiicddddciiiiiic{{d}}{d}dc{{i}d}iiiic{i}iiic{d}c{i}iiiicdddciic{d}dddd{c}{i}icccccccccdcciiicddddciiiiiic{{d}}{d}dc{{i}d}iiiic{i}iiic{d}c{i}iiiicdddciic{d}dddc{d}icc{i}iiiiii{c}cccccdddddc{i}dddcciiicddddciiiiiic{{d}}{d}dc{{i}d}iiiic{i}iiic{d}c{i}iiiicdddciic{d}dddciiiic{d}iiccccccc{i}iiiccccccccdddddcddc{i}dddcciiicddddciiiiiic{{d}}{d}dc{{i}}iiiiiicic{d}c{i}iiiicdddc{d}iiicddddciiiic{d}c{i}ddd{c}cc{d}dc{i}dddc{i}dddcddc{i}dddcciiicddddciiiiiic{{d}}{d}dc{{i}}iiiiiicic{d}c{i}iiiicdddc{d}iiicddddciiiic{d}c{i}c{i}ddd{c}ciiiic{dd}iic{i}dddcddc{i}dddcciiicddddciiiiiic{{d}}{d}dc{{i}}iiiiiicic{d}c{i}iiiicdddc{d}iiic{d}ddc{i}iic{d}c{i}ciiiiiic{d}iiccccccccc{d}iic{ii}ic{dd}iic{i}dddcddc{i}dddcciiicddddciiiiiic{{d}}{d}dc{{i}}iiiiiicic{d}c{i}iiiicdddc{d}iiic{d}ddc{i}iic{d}c{i}ciiiiiic{d}dddddc{i}dcccccccic{d}dc{ii}ic{dd}iic{i}dddcddc{i}dddcciiicddddciiiiiic{{d}}{d}dc{{i}}iiiiiicic{d}c{i}iiiicdddc{d}iiic{d}ddc{i}iic{d}iiic{i}dddciiiiiic{d}dddddc{i}iicdddccccc{i}dc{d}iic{d}dc{ii}ic{dd}iic{i}dddcddc{i}dddcciiicddddciiiiiic{{d}}{d}dc{{i}}iiiiiicic{d}c{i}iiiicdddc{d}iiicddddddciiiiiic{d}iiic{i}dddciiiiiic{d}dddddc{i}iicdciiiiccciicic{d}iic{d}dc{ii}ic{dd}iic{i}dddcddc{i}dddcciiicddddciiiiiic{{d}}{d}dc{{i}}iiiiiicic{dd}iic{ii}iicdddc{d}iiicddddddciiiiiic{d}iiic{i}dddciiiiiic{d}dddddcddddc{i}iiiiiciiicc{d}dc{i}iiiicic{d}iic{d}dc{ii}ic{dd}iic{i}dddcddc{i}dddcciiicddddciiiiiic{{d}}{d}dc{{i}}iiiiiicic{dd}iic{ii}iicdddc{d}iiicddddddciiiiiic{d}iiic{i}dddciiiiiic{d}dddddcddddciiicciiicic{i}iiiicic{d}iiciic{i}ddc{dd}iic{i}dddcddc{i}dddcciiicddddciiiiiic{{d}}{d}dc{{i}}iiiiiicic{dd}iic{ii}iicdddc{d}iiicddddddciiiiiic{d}iiic{i}dddciiiiiic{d}dddddciiiiic{d}iiccciiiiiic{i}iiiicic{d}iiciic{i}ddc{dd}dc{i}cddc{i}dddcciiicddddciiiiiic{{d}}{d}dc{{i}}iiiiiic{d}cdc{i}iiiiiicdddc{d}iiicddddddcdddddciiiic{i}dddciiiiiic{d}iiicccccc{i}dcic{d}iiciic{i}ddc{dd}dc{i}cddc{i}dddcciiicddddciiiiiic{{d}}{d}dc{{i}}iiiiiic{d}cdc{i}iiiiiicdddc{d}iiicddddddcdddddciiiic{i}dddcdddddcccccccc{i}iiiic{d}iiciic{i}ddc{dd}dc{i}cddc{i}dddcciiicddddciiiiiic{{d}}{d}dc{{i}}iiiiiic{d}cdc{i}iiiiiicdddc{d}iiicddddddcdddddciiiic{i}i{c}dddciic{i}ddc{dd}dc{i}ciciiiicciiicddddciiiiiic{{d}}{d}dc{{i}}iiiiiic{d}cdc{i}iiiiiicdddc{d}iiicddddddcdddddc{i}iiiiii{c}ccddc{i}ddc{dd}dc{i}ciciiiicciiicddddciiiiiic{{d}}{d}dc{{i}}iiiiiic{d}cdc{i}iiiiiicdddc{d}iiicddddddc{i}iiiiii{c}ccccic{d}icddciciiiicciiic{d}iic{i}c{{d}}{d}dc{{i}}iiiiiic{d}cdc{i}iiiiiicdddc{d}iiiciiiiii{c}ccccccddddciiiiiic{d}iiiciiiicciiic{d}iic{i}c{{d}}{d}dc{{i}}iiiiiic{d}cdc{i}iiiiiicdddc{d}ddddddcccc{i}dd{c}cccc{i}dc{d}iiiciiiicciiic{d}iic{i}c{{d}}{d}dc{{i}}iiiiiic{d}cdc{i}iiiiiic{d}ciiii{c}cccccccccdddciiiic{d}ddc{i}iiiiic{d}iic{i}c{{d}}{d}dc{{i}}iiiiiic{d}cdc{ii}dddcccc{dd}dddddc{i}i{c}cc{d}iiiccccciiicc{i}iiiiic{d}iic{i}c{{d}}{d}dc{{i}}iiiiiic{d}c{i}iccdddd{c}ccccccc{d}ddccccciiiciiiiiicic{d}dc{{d}i}c{{i}}iiiiiiciiiiccccc{d}i{c}ccccc{d}icccccc{i}ddcic{d}dc{{d}i}c{{i}}iiiic{d}dddccccc{ii}ddd{cc}cc{d}iiic{d}dc{{d}i}c{ii}iiccccccc{{i}ddd}iccccccc{i}dd{c}ccccc{d}dc{{d}i}c

```

---
Tags: code-golf, string, kolmogorov-complexity, pangram
---


# Question
Title: List all palindromic prime dates between 0000-01-01 and 99999-12-31
You know what a **palindrome**, a **prime** and a **date** are.

> Your task is to list all dates in 100 thousands of years that fulfill all three characteristics.

Nevermind anything but the numbers, use the following formats: **YYYYMMDD** and **YYYYYMMDD**.

Dates between 0000-01-01 and 9999-12-31 should be printed as **8 digit** palindromes dates (If there is any?) and dates between 10000-01-01 and 99999-12-31 should be printed as **9 digit** palindromes.

It's not mandatory to list the dates in chronological order.

**Example part of valid output.**

First three 9 digit prime palindromic dates:

```
...
100111001
100131001
100161001
...

```

**Rules**

Standard loopholes apply.

# Answer
> 5 votes
# Ruby, ~~144~~ 141 bytes (134+7 for the `-rprime` flag)

Saved 3 bytes thanks to benj2240!

```
('01'..'12').map{|m|('01'..'31').map{|d|(?0..?9).map{|k|q=m+d
y=q.reverse+k
r=y+q
Time.new(y,m,d).day==d.to_i&&r.to_i.prime?&&(p r)}}}

```

Try it online!

The algorithm:

* generate all possible MMDD combinations, from "0101" to "1231"
* generate all years for that date that would result in a palindrome, by reversing the MMDD string and adding in the middle, in turn, all chars in the (0..9) range
* check if that is a valid date by creating a `Time` instance with the given `y`, `m`, `d` values. If the resulting time object has a `#day` value equal to `d`, then that was a valid date. Otherwise, it would shift the date (for example, `Time.new 2018,2,30` returns `2018-03-02`).
* check if the valid palindrome date is also a prime and display it if it is.

The inner loop was initially a function that was called for each element in the `(?0..?9)` range, as well as for the empty string.

Since the empty string produced no results (there are no valid 8 digit prime palindromes), I decided to remove it and refactor to this version.

# Answer
> 4 votes
# Python 2, ~~116~~ ~~107~~ ~~128~~ ~~122~~ 119 bytes

```
def g(n=9**8):
 while n<1e9:
  n+=2;m=n/100%100
  if 0<m<13and n%100<31+(m+m/8)%2and`n`[::-1]==`n`and 2**n%n==2:print n

```

The second half of the 4th line is inspired by mxdsp's answer here to another golf question.

## Explanation

The function `g()` takes an argument only to initialize the `n` variable using its default value. The initial value is an odd number that's as short as possible and as large as possible while still being less than the first valid answer 100111001.

Loop until `n` reaches the end of the date range 109. Increment `n` by 2. `m` is the month of date `n`.

If `n` is a valid date, palindrome and prime, print it:

* Date:
    + `0 < m < 13` checks that `m` is a valid month.
    + `n % 100 < 31 + (m+m/8)%2` checks that `n`'s day of the month is valid. `(m+m/8)%2` adds `1` for all months with 31 days. Credit for that goes to ArmanX's answer. There are no primes for February 29-30.
* Palindrome: ``n`[::-1] == `n``. The backticks stringify `n`. `[::-1]` reverses the string.
* Prime: `2**n % n == 2` is a Fermat primality test. That test is only probabilistic. There are also non-primes that match. But not in the range of numbers we're looking at.

# Answer
> 3 votes
# APL (Dyalog Unicode), 155 bytes

```
⎕CY'dfns'
n←⍕x
m←(⍎2↑¯4↑n)
d←(⍎¯2↑n)
:If n≡⌽n
:AndIf 1 pco x
:AndIf m<13
:AndIf d<32
:If m d≡2 29
:AndIf (400|⍎((≢n)-4)↑n)=0
⎕←x
f x+72
:End
⎕←x
:End
f x+1

```

Try it online!

This is a Tradfn (**trad**itional **f**unctio**n**) that takes one argument `arg = yyyymmdd` or `arg = yyyyymmdd`. Usage is `f arg`.

This will not output anything when the argument starts at `10000101` because it doesn't find a prime palindrome date in 60 seconds.

Here is a less golfed approach that will output the OP's example output of

```
100111001
100131001
100161001

```

(Try it Online!)

Notice that both codes are the exact same until right before calling the function recursively for the next date. While the golfed version just calls it as `f arg+1`, the less golfed code jumps from day `31` to day `01` and from month `12` to month `01`, which speeds it up quite a bit.

### How it works:

```
⎕CY'dfns'                   ⍝ Copy (⎕CY) all dfns to enable the use of pco.
n←⍕x                        ⍝ Assign (←) the input to the variable n.
m←(⍎2↑¯4↑n)                 ⍝ Take (↑) the last 4 (¯4) elements of n, then take the first 2 elements of that and assign to m.
d←(⍎¯2↑n)                   ⍝ Take the last 2 (¯2) elements of n, and assign to d.
:If n≡⌽n                    ⍝ If n matches (≡) its reverse (⌽) (is a palindrome)
:AndIf 1 pco x              ⍝ And a prime (1 pco)
:AndIf m<13                 ⍝ And month < 13
:AndIf d<32                 ⍝ And day < 32
:If m d≡2 29                ⍝ If it is 2/29
:AndIf (400|⍎((≢n)-4)↑n)=0  ⍝ And the year mod 400 = 0
⎕←x                         ⍝ Print x
f x+72                      ⍝ call f with arg year0301
:End
⎕←x                         ⍝ Print x
:End
f x+1                       ⍝ call f for the next date.

```

# Answer
> 2 votes
# Java 10, ~~329~~ ~~327~~ ~~320~~ ~~318~~ ~~312~~ ~~308~~ ~~307~~ 264 bytes

```
v->{for(int y=9999,m,d;++y<1e5;)for(m=0;++m<13;)for(d=0;++d<32;)try{java.time.LocalDate.of(y,m,d);var t=y+"".format("%02d%02d",m,d);long n=new Long(t),x=1;for(;n%++x%n>0;);if(t.contains(new StringBuffer(t).reverse())&n==x)System.out.println(t);}finally{continue;}}

```

-1 byte thanks to *@assylias*.

**Explanation:**

Try it online (note: the prime-checking part has been replaced with a more efficient separated method, although even with that it still times out after 60 seconds, only outputting the first ~115 palindromic prime dates).
Pastebin of all 197 outputs from a local run.

```
v->{                           // Method without empty unused parameter and no return-type
  for(int y=9999,m,d;++y<1e5;) //  Loop over the years in the range [1000,9999]:
    for(m=0;++m<13;)           //   Inner loop over the months in the range [1,12]:
      for(d=0;++d<32;){        //    Inner loop over the days in the range [1,31]:
        try{java.time.LocalDate.of(y,m,d);
                               //     If it's a valid date:
          var t=y+"".format("%02d%02d",m,d);
                               //      Convert the numbers to a String in format "yyyyyMMdd"
          long n=new Long(t),  //      Convert this String to a long
          x=1;for(;n%++x%n>0;);//      Prime-checking loop
          if(t.contains(new StringBuffer(t).reverse())
                               //      If the string is palindromic
             &n==x)            //      and the long is a prime:
            System.out.println(t);
                               //       Print the string with trailing newline
        }finally{              //     If it isn't a valid date:
          continue;}}}         //      Continue to the next iteration of the inner-most loop

```

# Answer
> 2 votes
# WolframLanguage (Mathematica) 187 bytes

There may be some reduction in size to be found. Explanation to follow...

```
t=ToString;p=PadLeft;d=DateObject;Cases[""<>{t/@p[#,If[Length@#<5,4, 5]],t/@ p[#2,2],t/@p[#3,2]}&@@@(IntegerDigits/@#[[1]]&/@DayRange[d@#,d@#2]),x_/;PalindromeQ@x&&PrimeQ@ToExpression@x]&

```

**Test cases**

```
t = ToString; p = PadLeft; d = DateObject;
Cases["" <> {t /@ p[#, If[Length@# < 5, 4, 5]], t /@ p[#2, 2],
   t /@ p[#3, 2]} & @@@ (IntegerDigits /@ #[[1]] & /@ DayRange[d@#, d@#2]),
   x_ /; PalindromeQ@x && PrimeQ@ToExpression@x] &[{10011, 10, 1}, {10017, 1, 1}]

```

(\* {"100111001", "100131001", "100161001"} \*)

**Explanation of code**

`DayRange[d@#,d@#2]` returns all of the dates between `{10011, 10, 1}`and `{10017, 1, 1}`. In this case, it returns approximately 5 years, 4 months of dates (precisely 1920 dates). Leap years are taken into account.

The dates are returned in Wolfram-standard formatting. For example, the first date will appear as `DateObject[List[1,1,1],"Day","Gregorian",-5.`\]\`

`#[[1]] & /@` will remove the part of the date, in each date, that concerns us. In the example, `DateObject[List[1,3,7],"Day","Gregorian",-5.]` returns the abbreviated date, `{1,3,7}`.

`t/@p[#3,2]}` or `ToString/@Padleft[#3,2]` pads the third element, namely, the 7 standing "for 7th day of the month" as `"07"`. Similar padding is provided for the single digit symbol for the month of March, namely, `3` is returned as `"03"`.

`p[#, If[Length@# < 5, 4, 5]]` pads the year with zeros to reach the length of a 4 or 5 digit string. In this case, January, namely `1`, is returned as \`"00001"'.

`"" <>...` joins the strings. In this case, it returns `"000010307"`.

`Cases[...x_ /; PalindromeQ@x && PrimeQ@ToExpression@x]` returns those cases, among the 1920 dates, that are palindromes and primes.

# Answer
> 2 votes
# Python 3, 163 bytes

```
r=range
for m in r(1,13):
 for d in r(1,31+(m%2==(m<8))-2*(m==2)):
  t="%02d"*2%(m,d)
  for i in r(10):x=int(t[::-1]+str(i)+t);all(x%i for i in r(2,x))and print(x)

```

Solution is fairly long (and probably can get improved upon), but doesn't use any built-in functions for prime/date/palindrome checking. A somewhat ungolfed version for clarity:

```
for month in range(1,13):
    for day in range(1,31 + (month%2==(month<8)) - 2*(month==2)):
        t = "%02d%02d" % (month, day)
        for i in range(10):
            x = int(t[::-1] + str(i) + t)
            if all(x%i for i in range(2,x)):print(x)

```

Valid dates are generated by choosing a month and day. As commented before, only size 9 need be considered. Also note that leap years aren't considered. This isn't required because of the lucky coincidence that palindrome primes of length 9 which end on 0229 simply don't exist (other date anomalies like the 30th February of 1712 can be discarded for the same reason).

Next the middle digit is chosen freely, and a prime test is performed. Because of the prime test had to be as short as possible, it is very naive and thus cripplingly slow. Using an external library could solve this (and save some bytes), but as mentioned before I didn't want to use any.

# Answer
> 2 votes
## Javascript, ~~187~~ 177

Assumptions: no matching 4 digit years; no matching days in February between 29-30

```
p=n=>(n<10?'0':'')+n;f=n=>n[3]+n[2]+n[1]+n[0];for(m=13;--m;)for(d=31+(m+(0|m/8))%2;--d;){for(y=10;y--;){z=p(m)+p(d);Y=+(f(z)+y+z);for(i=2;Y%i&&i*i<Y;i++);if(Y%i)console.log(Y)}}

```

It works like this:

```
p=n=>(n<10?'0':'')+n;       //Prepend a 0 for 1-digit numbers and convert to a string
f=n=>n[3]+n[2]+n[1]+n[0];   //Flip four digits
for(m=13;--m;)              //Month loop, from 12 to 1
 for(d=
       31+(m+(0|m/8))%2     //Calculate the days in the month, allowing  Feb. 29 & 30
                       ;--d;){ //Day loop
  for(y=10;y--;){           //Middle digit loop
   z=p(m)+p(d);             //Prepend zeros to the month and day
   Y=+(f(z)+y+z);           //Flip the digits; append the middle digit,
                            //month, and day; convert back to an integer
   for(i=2;Y%i&&i*i<Y;i++); //Check if it's a prime
    if(Y%i)console.log(Y)}} //If it doesn't divide evenly, it's not prime. Print it!

```

History:

* 187 to 177: There are no prime palindrome dates that fall on Feb. 29 or 30, so we can pretend Feb. has 30 days and save 10 characters.

Notes:

Through testing, I found there are no valid matches that are 4-digit years or fall on Feb. 29 or 30. There are, unfortunately for the sake of the code, exactly five (invalid) results that fall on the 31st of various months that only have 31 days.

# Answer
> 1 votes
# VBA, 347

```
Sub PalindromeDate()
Dim DateString As String
For i = 0 To 9999
    For j = 1 To 12
        For k = 1 To 31
        DateString = Format(i, "0000") & Format(j, "00") & Format(k, "00")
        If DateString = StrReverse(DateString) Then
        Debug.Print DateString
        Else
        End If
        Next k
        Next j
        Next i

End Sub

```

# Answer
> 1 votes
# Deadfish~, 10529 bytes

```
{iiiii}dcdcicdciiicdddcicdcic{dddd}ic{iiii}dcdcicdciiiiiicddddddcicdcic{dddd}ic{iiii}icdddcicdciiiiicdddddcicdciiic{dddd}dc{iiii}iiiiic{d}iiicicdcccicdc{i}dddc{dddd}dddddc{iiiii}dddc{d}icicdciiiiiicddddddcicdc{i}dc{ddddd}iiic{iiii}dcccdcicdciccc{dddd}ic{iiii}dcccdciicddciccc{dddd}ic{iiii}dcccdciiiiicdddddciccc{dddd}ic{iiii}dcccdc{i}dddc{d}iiiciccc{dddd}ic{iiii}iiiiicddddddccdciicddcicciiiiiic{dddd}dddddc{iiiii}dddc{d}iiccdc{i}dc{d}icicc{i}ddc{ddddd}iiic{iiii}dcicdcdc{i}ddc{d}iicicicdc{dddd}ic{iiii}iiiiicdddddcdcdciiicdddciciciiiiic{dddd}dddddc{iiii}iiiiicdddddcdcdc{i}ddc{d}iiciciciiiiic{dddd}dddddc{iiiii}dddc{d}iiicdcdciiiiicdddddcicic{i}dddc{ddddd}iiic{iiii}dciicddcdciiicdddciciicddc{dddd}ic{iiii}dcdciicddciiiicddddciicddcic{dddd}ic{iiii}dcdciicddc{i}dddc{d}iiiciicddcic{dddd}ic{iiii}icdddciicddciiicdddciicddciiic{dddd}dc{iiii}icdddciicddc{i}dddc{d}iiiciicddciiic{dddd}dc{iiii}iiiiic{d}iiiciicddcicdciicddc{i}dddc{dddd}dddddc{iiii}iiiiic{d}iiiciicddc{i}dddc{d}iiiciicddc{i}dddc{dddd}dddddc{iiii}iiiiic{d}iiiciicddc{i}ddc{d}iiciicddc{i}dddc{dddd}dddddc{iiii}dccicddciiicdddciicdcc{dddd}ic{iiii}dccicddciiiiiicddddddciicdcc{dddd}ic{iiii}icddcicddciicddciicdciic{dddd}dc{iiii}icddcicddciiiicddddciicdciic{dddd}dc{iiii}icddcicddciiiiicdddddciicdciic{dddd}dc{iiii}icddcicddc{i}ddc{d}iiciicdciic{dddd}dc{iiii}iiiiicddddddcicddccciicdciiiiiic{dddd}dddddc{iiii}iiiiicddddddcicddciicddciicdciiiiiic{dddd}dddddc{iiii}iiiiicddddddcicddciiicdddciicdciiiiiic{dddd}dddddc{iiii}dciccddciiiicddddciiccdc{dddd}ic{iiii}icdccddciiicdddciiccic{dddd}dc{iiii}icdccddc{i}ddc{d}iiciiccic{dddd}dc{iiii}iiiiicdddddccddciiicdddciicciiiiic{dddd}dddddc{iiii}dcdciiicdddccciiicdddcic{dddd}ic{iiii}dcdciiicdddciiiiiicddddddciiicdddcic{dddd}ic{iiii}icdddciiicdddciiiiicdddddciiicdddciiic{dddd}dc{iiii}iiiiic{d}iiiciiicdddccciiicdddc{i}dddc{dddd}dddddc{iiii}iiiiic{d}iiiciiicdddciiiiiicddddddciiicdddc{i}dddc{dddd}dddddc{iiiii}dddc{d}iciiicdddciicddciiicdddc{i}dc{ddddd}iiic{iiii}dcciicdddciiicdddciiicddcc{dddd}ic{iiii}dcciicdddc{i}dc{d}iciiicddcc{dddd}ic{iiii}icddciicdddciicddciiicddciic{dddd}dc{iiii}iiiiicddddddciicdddcicdciiicddciiiiiic{dddd}dddddc{iiii}iiiiicddddddciicdddciiiiiicddddddciiicddciiiiiic{dddd}dddddc{iiii}iiiiicddddddciicdddc{i}dddc{d}iiiciiicddciiiiiic{dddd}dddddc{iiiii}dddc{d}iiciicdddciiiiicdddddciiicddc{i}ddc{ddddd}iiic{iiii}icdcicdddc{i}dddc{d}iiiciiicdcic{dddd}dc{iiii}icdcicdddc{i}dc{d}iciiicdcic{dddd}dc{iiii}iiiiicdddddcicdddciicddciiicdciiiiic{dddd}dddddc{iiiii}dddc{d}iiicicdddciiiicddddciiicdc{i}dddc{ddddd}iiic{iiiii}dddc{d}iiicicdddc{i}dddc{d}iiiciiicdc{i}dddc{ddddd}iiic{iiii}dciiccdddciicddciiiccddc{dddd}ic{iiii}dciiccdddciiiiiicddddddciiiccddc{dddd}ic{iiii}dcdciiiicddddccciiiicddddcic{dddd}ic{iiii}dcdciiiicddddciiicdddciiiicddddcic{dddd}ic{iiii}dcdciiiicddddciiiicddddciiiicddddcic{dddd}ic{iiii}icdddciiiicddddciiiiicdddddciiiicddddciiic{dddd}dc{iiii}icdddciiiicddddc{i}dc{d}iciiiicddddciiic{dddd}dc{iiii}iiiiic{d}iiiciiiicddddc{i}dddc{d}iiiciiiicddddc{i}dddc{dddd}dddddc{iiii}iiiiic{d}iiiciiiicddddc{i}dc{d}iciiiicddddc{i}dddc{dddd}dddddc{iiiii}dddc{d}iciiiicddddc{i}ddc{d}iiciiiicddddc{i}dc{ddddd}iiic{iiiii}dddc{d}iciiiicddddc{i}dc{d}iciiiicddddc{i}dc{ddddd}iiic{iiii}dcciiicddddciiiicddddciiiicdddcc{dddd}ic{iiii}iiiiicddddddciiicddddciiiicddddciiiicdddciiiiiic{dddd}dddddc{iiii}iiiiicddddddciiicddddc{i}ddc{d}iiciiiicdddciiiiiic{dddd}dddddc{iiii}dciciicddddccciiiicddcdc{dddd}ic{iiii}dciciicddddc{i}ddc{d}iiciiiicddcdc{dddd}ic{iiii}icdciicddddciiiiicdddddciiiicddcic{dddd}dc{iiii}icdciicddddc{i}dddc{d}iiiciiiicddcic{dddd}dc{iiiii}dddc{d}iiiciicddddciicddciiiicddc{i}dddc{ddddd}iiic{iiiii}dddc{d}iiiciicddddc{i}dddc{d}iiiciiiicddc{i}dddc{ddddd}iiic{iiiii}dddc{d}iiiciicddddc{i}ddc{d}iiciiiicddc{i}dddc{ddddd}iiic{iiii}icdddciiiiicdddddc{i}dc{d}iciiiiicdddddciiic{dddd}dc{iiiii}dddc{d}iciiiiicdddddciiicdddciiiiicdddddc{i}dc{ddddd}iiic{iiiii}dddc{d}iciiiiicdddddc{i}dc{d}iciiiiicdddddc{i}dc{ddddd}iiic{iiii}dcciiiicdddddccciiiiicddddcc{dddd}ic{iiii}dcciiiicdddddciicddciiiiicddddcc{dddd}ic{iiii}dcciiiicdddddciiiiiicddddddciiiiicddddcc{dddd}ic{iiii}icddciiiicdddddcicdciiiiicddddciic{dddd}dc{iiii}icddciiiicdddddciiiiicdddddciiiiicddddciic{dddd}dc{iiii}icddciiiicdddddc{i}dddc{d}iiiciiiiicddddciic{dddd}dc{iiii}iiiiicddddddciiiicdddddciiiiicdddddciiiiicddddciiiiiic{dddd}dddddc{iiiii}dddc{d}iiciiiicdddddcicdciiiiicddddc{i}ddc{ddddd}iiic{iiiii}dddc{d}iiciiiicdddddciiiiicdddddciiiiicddddc{i}ddc{ddddd}iiic{iiii}dciciiicdddddccciiiiicdddcdc{dddd}ic{iiii}dciciiicdddddcicdciiiiicdddcdc{dddd}ic{iiii}icdciiicdddddciiiiiicddddddciiiiicdddcic{dddd}dc{iiii}icdciiicdddddc{i}ddc{d}iiciiiiicdddcic{dddd}dc{iiii}icdciiicdddddc{i}dc{d}iciiiiicdddcic{dddd}dc{iiii}iiiiicdddddciiicdddddciiiicddddciiiiicdddciiiiic{dddd}dddddc{iiii}dciiciicdddddcicdciiiiicddcddc{dddd}ic{iiii}dciiciicdddddciiiicddddciiiiicddcddc{dddd}ic{iiii}dcdciiiiiicddddddciiiiiicddddddciiiiiicddddddcic{dddd}ic{iiii}icdddciiiiiicddddddc{i}ddc{d}iiciiiiiicddddddciiic{dddd}dc{iiii}dcciiiiicddddddccciiiiiicdddddcc{dddd}ic{iiii}dcciiiiicddddddcicdciiiiiicdddddcc{dddd}ic{iiii}dcciiiiicddddddciiiicddddciiiiiicdddddcc{dddd}ic{iiii}icddciiiiicddddddccciiiiiicdddddciic{dddd}dc{iiii}iiiiicddddddciiiiicddddddciiiicddddciiiiiicdddddciiiiiic{dddd}dddddc{iiiii}dddc{d}iiciiiiicddddddccciiiiiicdddddc{i}ddc{ddddd}iiic{iiiii}dddc{d}iiciiiiicddddddciiiiiicddddddciiiiiicdddddc{i}ddc{ddddd}iiic{iiii}iiiiicdddddciiiicddddddciicddciiiiiicddddciiiiic{dddd}dddddc{iiiii}dddc{d}iiiciiiicddddddccciiiiiicddddc{i}dddc{ddddd}iiic{iiiii}dddc{d}iiiciiiicddddddciiiicddddciiiiiicddddc{i}dddc{ddddd}iiic{iiii}dcdc{i}dddc{d}iiiccc{i}dddc{d}iiicic{dddd}ic{iiii}dcdc{i}dddc{d}iiic{i}dddc{d}iiic{i}dddc{d}iiicic{dddd}ic{iiii}icdddc{i}dddc{d}iiiciiiiicdddddc{i}dddc{d}iiiciiic{dddd}dc{iiiii}dddc{d}ic{i}dddc{d}iiiccc{i}dddc{d}iiic{i}dc{ddddd}iiic{iiii}dcciiiiiic{d}iiic{i}dddc{d}iiic{i}dddcddddddcc{dddd}ic{iiii}icddciiiiiic{d}iiiciiiiiicddddddc{i}dddcddddddciic{dddd}dc{iiii}iiiiicddddddciiiiiic{d}iiiciiiiicdddddc{i}dddcddddddciiiiiic{dddd}dddddc{iiiii}dddc{d}iiciiiiiic{d}iiiccc{i}dddcddddddc{i}ddc{ddddd}iiic{iiiii}dddc{d}iiciiiiiic{d}iiic{i}dc{d}ic{i}dddcddddddc{i}ddc{ddddd}iiic{iiii}dciciiiiic{d}iiiciiiiiicddddddc{i}dddcdddddcdc{dddd}ic{iiii}dciciiiiic{d}iiic{i}dc{d}ic{i}dddcdddddcdc{dddd}ic{iiii}icdciiiiic{d}iiiciiiiicdddddc{i}dddcdddddcic{dddd}dc{iiii}dciiciiiic{d}iiiciiicdddc{i}dddcddddcddc{dddd}ic{iiii}dciiciiiic{d}iiiciiiicddddc{i}dddcddddcddc{dddd}ic{iiii}dciiciiiic{d}iiiciiiiiicddddddc{i}dddcddddcddc{dddd}ic{iiii}dciiciiiic{d}iiic{i}dc{d}ic{i}dddcddddcddc{dddd}ic{iiii}dcdc{i}ddc{d}iic{i}dddc{d}iiic{i}ddc{d}iicic{dddd}ic{iiii}iiiiic{d}iiic{i}ddc{d}iiciiiicddddc{i}ddc{d}iic{i}dddc{dddd}dddddc{iiii}iiiiic{d}iiic{i}ddc{d}iiciiiiicdddddc{i}ddc{d}iic{i}dddc{dddd}dddddc{iiiii}dddc{d}ic{i}ddc{d}iiccc{i}ddc{d}iic{i}dc{ddddd}iiic{iiiii}dddc{d}ic{i}ddc{d}iiciiiiiicddddddc{i}ddc{d}iic{i}dc{ddddd}iiic{iiiii}dddc{d}ic{i}ddc{d}iic{i}dddc{d}iiic{i}ddc{d}iic{i}dc{ddddd}iiic{iiii}icddc{i}dddc{d}iicicdc{i}ddc{d}iiiciic{dddd}dc{iiii}icddc{i}dddc{d}iiciiiiicdddddc{i}ddc{d}iiiciic{dddd}dc{iiii}icddc{i}dddc{d}iic{i}ddc{d}iic{i}ddc{d}iiiciic{dddd}dc{iiii}iiiiicddddddc{i}dddc{d}iiccc{i}ddc{d}iiiciiiiiic{dddd}dddddc{iiii}iiiiicddddddc{i}dddc{d}iic{i}dc{d}ic{i}ddc{d}iiiciiiiiic{dddd}dddddc{iiiii}dddc{d}iic{i}dddc{d}iiciicddc{i}ddc{d}iiic{i}ddc{ddddd}iiic{iiii}dciciiiiiic{d}iic{i}dddc{d}iiic{i}ddcddddddcdc{dddd}ic{iiii}dciciiiiiic{d}iic{i}dc{d}ic{i}ddcddddddcdc{dddd}ic{iiii}icdciiiiiic{d}iiccc{i}ddcddddddcic{dddd}dc{iiii}icdciiiiiic{d}iiciiicdddc{i}ddcddddddcic{dddd}dc{iiii}iiiiicdddddciiiiiic{d}iiciiicdddc{i}ddcddddddciiiiic{dddd}dddddc{iiiii}dddc{d}iiiciiiiiic{d}iiciicddc{i}ddcddddddc{i}dddc{ddddd}iiic{iiii}dciiciiiiic{d}iiciiiicddddc{i}ddcdddddcddc{dddd}ic{iiii}dcdc{i}dc{d}iccc{i}dc{d}icic{dddd}ic{iiii}icdddc{i}dc{d}icicdc{i}dc{d}iciiic{dddd}dc{iiii}icdddc{i}dc{d}ic{i}dddc{d}iiic{i}dc{d}iciiic{dddd}dc{iiii}icdddc{i}dc{d}ic{i}ddc{d}iic{i}dc{d}iciiic{dddd}dc{iiii}iiiiic{d}iiic{i}dc{d}iciiiiiicddddddc{i}dc{d}ic{i}dddc{dddd}dddddc{iiii}iiiiic{d}iiic{i}dc{d}ic{i}ddc{d}iic{i}dc{d}ic{i}dddc{dddd}dddddc{iiiii}dddc{d}ic{i}dc{d}ic{i}dddc{d}iiic{i}dc{d}ic{i}dc{ddddd}iiic{iiii}dcc{i}ddc{d}icicdc{i}dc{d}iicc{dddd}ic{iiii}icddc{i}ddc{d}iciiiiicdddddc{i}dc{d}iiciic{dddd}dc{iiii}icddc{i}ddc{d}ic{i}dc{d}ic{i}dc{d}iiciic{dddd}dc{iiii}iiiiicddddddc{i}ddc{d}icicdc{i}dc{d}iiciiiiiic{dddd}dddddc{iiiii}dddc{d}iic{i}ddc{d}ic{i}ddc{d}iic{i}dc{d}iic{i}ddc{ddddd}iiic{iiii}dcic{i}dddc{d}ic{i}ddc{d}iic{i}dc{d}iiicdc{dddd}ic{iiii}iiiiicdddddc{i}dddc{d}ic{i}ddc{d}iic{i}dc{d}iiiciiiiic{dddd}dddddc{iiii}dcdccicccdccic{dddd}ic{iiii}dcdcciciicddcdccic{dddd}ic{iiii}dcdcciciiiiicdddddcdccic{dddd}ic{iiii}icdddccicdcicdcciiic{dddd}dc{iiii}icdddcciciiiicddddcdcciiic{dddd}dc{iiii}icdddccic{i}dddc{d}iiicdcciiic{dddd}dc{iiii}dccdcicccdcicc{dddd}ic{iiii}icddcdciciicddcdciciic{dddd}dc{iiii}dcicddcic{i}ddc{d}iicdciicdc{dddd}ic{iiii}icdcddciciiicdddcdciicic{dddd}dc{iiii}icdcddciciiiicddddcdciicic{dddd}dc{iiii}iiiiicdddddcddcicdcicdciiciiiiic{dddd}dddddc{iiiii}dddc{d}iiicddcicccdciic{i}dddc{ddddd}iiic{iiii}dciicdddciciiicdddcdciiicddc{dddd}ic{iiii}dciicdddciciiiiiicddddddcdciiicddc{dddd}ic{iiii}dcdcicciiicdddccdcic{dddd}ic{iiii}dcdcicciiiiiicddddddccdcic{dddd}ic{iiii}icdddcicccccdciiic{dddd}dc{iiii}iiiiic{d}iiicicciiicdddccdc{i}dddc{dddd}dddddc{iiii}iiiiic{d}iiicicciiiicddddccdc{i}dddc{dddd}dddddc{iiiii}dddc{d}icicciicddccdc{i}dc{ddddd}iiic{iiii}dcccc{i}dddc{d}iiicccc{dddd}ic{iiii}dcccc{i}ddc{d}iicccc{dddd}ic{iiii}iiiiicddddddccciicddccciiiiiic{dddd}dddddc{iiii}iiiiicddddddccciiiiicdddddccciiiiiic{dddd}dddddc{iiiii}dddc{d}iiccciiiiiicddddddccc{i}ddc{ddddd}iiic{iiii}dcicdcccccicdc{dddd}ic{iiii}dcicdcciicddccicdc{dddd}ic{iiii}dcicdcciiiiicdddddccicdc{dddd}ic{iiii}iiiiicdddddcdcc{i}ddc{d}iicciciiiiic{dddd}dddddc{iiiii}dddc{d}iiicdcc{i}ddc{d}iiccic{i}dddc{ddddd}iiic{iiiii}dddc{d}iciicdciiiicddddcicddc{i}dc{ddddd}iiic{iiiii}dddc{d}iciicdc{i}dddc{d}iiicicddc{i}dc{ddddd}iiic{iiii}dccicdcccicdcc{dddd}ic{iiii}dccicdciiiiicdddddcicdcc{dddd}ic{iiii}dccicdciiiiiicddddddcicdcc{dddd}ic{iiii}iiiiicddddddcicdcccicdciiiiiic{dddd}dddddc{iiii}iiiiicddddddcicdciiiiicdddddcicdciiiiiic{dddd}dddddc{iiiii}dddc{d}iicicdciiiiicdddddcicdc{i}ddc{ddddd}iiic{iiii}icdccdciiiiicdddddciccic{dddd}dc{iiii}dciicdcdc{i}ddc{d}iicicicddc

```

# Answer
> 0 votes
# Clean, ~~262~~... 213 bytes

```
import StdEnv
@ =(rem)
f=[d\\d<-[a*10^4+b*100+c\\a<-[10^4..99999],b<-[1..12],c<-[1..28+[0,3,if(@a 400<1|| @a 4<1&& @a 100>0)1 0,3,2,3,2,3,3,2,3,2,3]!!b]]|(\k=k==reverse k)[p\\p<-:toString d]&&all((<)0o@d)[2..d-1]]

```

Try it online!

# Answer
> 0 votes
# Javascript, ~~234~~ 229 bytes

A bit bulky, but posting it to get the JS ball rolling. Any suggestions welcome!

```
f=n=>100+10*n+n/10|0
p=n=>{for(i=2;i<n;n=n%i++<1?0:n);return n>1}
q=n=>(''+(100+n)).slice(-2)
r=_=>{for(m=13;--m;)for(d=32;--d;)for(x=10;--x+1;){s=q(f(d))+q(f(m))+x+q(m)+q(d);if(p(s|0)&&d<(m==2?29:31+(m+m/8|0)%2))console.log(s)}}

```

## Ungolfed:

```
// Flip a one- or two-digit number
f=n=>100+10*n+n/10|0

// Primality test
// For initial testing, you can replace this line with:
//      p=require('primality')
// This uses the primality npm module and is way faster
p=n=>{for(i=2;i<n;n=n%i++<1?0:n);return n>1}

// Convert number to string, pad with zeroes if necessary
q=n=>(''+(100+n)).slice(-2)

r=_=>{
    // Loop months
    for(m=13;--m;)
        // Loop days
        for(d=32;--d;)
            // Loop middle digit
            for(x=10;--x+1;) {
                // Construct 'date'
                s =
                    // Start with day and month, each flipped
                    q(f(d))+q(f(m)) +
                    // Add middle digit ( will be casted to string since the previous expression is also a string)
                    x +
                    // Add month and date as they are
                    q(m)+q(d);

                if(
                    // Check for primality
                    p(s|0) &&
                    // Check if it's a valid date by validating day ( month and year will always be valid)
                    d<(
                        // For February, we always assume 28 days ( check for 29 because we use less than)
                        m==2?29 :
                        // For other months, it alternates between 31 and 30
                        // EXCEPT July and August both have 31 days, then continues alternating
                        31+(m+m/8|0)%2))
                    console.log(s)
            }
}

```

## How it works:

The digit flipping magic is based mostly on experimenting.
I started by figuring out what number to subtract from to get the flipped version. I only cared about the last two digits.
So, if we take `n`, find `k` so that `n+k=flip(n)`. For `10<n<20` `k` started at 101 and increased in increments of 9. However, for `n<10`, this was 100. I assumed `k` increased for every jump of 10, and after a bit of fiddling I figured it was correct.
So, `k=100+9*n+n//10` where // means integer division.

Thus, we get `n+k = n+(100+9*n+n//10) = 100+10*n+n//10 = flipped(n)`.

I cannot prove, nor claim that this works for any number, but it produced correct results for the numbers used here.

For the primality test, credit to Kevin Cruijssen's answer. I had a bit shorter version, but I could not get it right:

```
p=n=>{for(i=n;--i-1;)if(!(n%i))return 1;}

```

I skipped on the palindrome test, by looping over months, days and a middle digit so I can build strings as `dDmMxMmDd`, where `D` is the day's first digit, `d` is the second, etc.

## History

Saved 5 bytes by getting rid of the conditional part of q

```
q=n=>n<10?'0'+n:(''+n).slice(-2) // from
q=n=>(''+(100+n)).slice(-2)      // to

```

# Answer
> 0 votes
# APL NARS 626 bytes, 313 chars

```
f;y;m;d;i;k;v;x;t
t←{60⊥3↑3↓⎕TS}⋄t0←50+t
x←2 12⍴v,v←31 28 31 30 31 30 31 31 30 31 30 31
x[2;2]←29⋄m←d←1⋄y←10000
X:  i←{(0=4∣⍵)∧0≠100∣⍵:1⋄0=400∣⍵:1⋄0}y
A:  →0×⍳y≥1e5
    →0×⍳t≥t0
    k←d+100×m+y×100
    →B×⍳∼k=⍎⌽⍕k⋄→B×⍳∼0πk⋄⎕←k
B:  d+←1
    →A×⍳d≤x[1+i;m]
    d←1⋄→C×⍳∼m=12⋄m←1⋄y+←1⋄→X
C:  m+←1⋄→A

```

this print what find in 50 second, than stop itself (because otherwise i can not stop the program for copy paste the test, because i not know how to stop the program without close the windows of the interpreter) test:

```
  f
100111001
100131001
100161001
101030101
101060101
101141101
101171101
102040201
102070201
103000301
103060301
104000401
104030401
104040401

```

# Answer
> 0 votes
# Julia 0.6, 109 bytes

Link goes to a longer version with two differences:

1. Checks for primes with hand written function, since the Primes package is not available on TIO.
2. Iterates over a different date range to not time out.

```
[s for s in Dates.format(Date(0,1,1):Date(100000,1,1),"YYYYmmdd") if Primes.isprime(parse(s))&&s==reverse(s)]

```

Try it online!

---
Tags: code-golf, kolmogorov-complexity, primes, date, palindrome
---


title: Exponential-ish number sequence

text:
# Question
Title: Exponential-ish number sequence
Your program must print out this exact sequence:

```
1
2
4
10
24
54
116
242
496
1006
2028
4074
8168
16358
32740
65506
131040
262110
NOPE!

```

As usual, shortest program wins. Standard code golf rules apply.

# Answer
# SOGL V0.12, 16 bytes

```
1O'²∫ūF-«O"NOPE!

```

Try it Here!

Explanation:

```
1O                output 1
  '²∫             17 times do, pushing 1-indexed counter
     ū              calculate 2^pop
      F-            subtract from that the counter
        «           multiply by 2
         O          output
          "NOPE!    push "NOPE!", which gets printed at the end as implicit output hasn't been disabled. This gets pushed every iteration of the loop, to save a byte

```
> 2 votes

# Answer
# Python 2, 51 bytes

```
i=0;exec"print 2**i-i<<(i>0);i+=1;"*18;print"NOPE!"

```

Try it online!

Notices that the formula is **2(2n-n)**, for all **n** except **0**.

Saved two bytes thanks to Wheat Wizard (`i<<1-(i<1)` changed to `i<<(i>0)`, duh!).

---

### Python 2, 53 bytes

```
i=0;exec"print[2**i-i<<(i>0),'NOPE!'][i>17];i+=1;"*19

```

Try it online!
> 8 votes

# Answer
# Fortran 95, ~~82~~ 74 bytes

Compiled with `gfortran`, with the `-cpp` flag to enable preprocessing, or saving the file with `.F95` extension.

```
#define p print*,
program w
p 1
do i=1,17
p 2*(2**i-i)
enddo
p'NOPE!'
end

```

~~Longest answer!~~ Not anymore! YAY!
> 6 votes

# Answer
# Emojicode, 96 bytes

```
1 2i⏩1 18✖2➖2.0i i 10NOPE!

```

Try it online!
> 5 votes

# Answer
# Jelly, 20 bytes

```
17Rµ2*_×2“NOPE!”ṭ1;Y

```

Try it online!

**Explanation**

```
17Rµ2*_×2“NOPE!”ṭ1;Y
17R                   range(17):[1,2,...17]
   µ                  new monadic link
    2*                exponentiate: [2*1, 2*2,...2*17]
      _               subtract: [2*1-1, 2*2-1,...2*17-17]
       ×2             times 2. Ḥ would need an additional syntax character but ×2 doesn't.
         “NOPE!”ṭ     append "NOPE!" to the above list
                 1;   prepend 1 to the above list
                   Y  join by newlines and implicitly print

```

**A recursive Jelly solution, 26 bytes**

```
’ß+_3$ḤµṖṖ$¡
18RÇ€Y⁷“NOPE!

```

Took the `Y⁷“NOPE!` trick from Jonathan Allan.

Try it online!
> 3 votes

# Answer
# Matlab (R2016b), ~~71~~ 69 bytes

Saved 2 bytes thanks to @Giuseppe (replace `2*(i-2)` by `2*i-4`)

This version prints exactly as required:

```
a=1;for i=1:18,fprintf('%d\n',a),a=2*a+max(2*i-4,0);end,disp('NOPE!')

```

# Matlab (R2016b), ~~53~~ 51 bytes

This version prints the same numbers and the `NOPE!`, but with a different formatting:

```
a=1,for i=1:17,a=2*a+max(2*i-4,0),end,disp('NOPE!')

```
> 2 votes

# Answer
# 05AB1E, ~~18~~ 17 bytes

```
X17LDoα·»"NOPE!"»

```

Try it online!

**Explanation**

```
X                  # push 1
 17L               # push range [1 ... 17]
    D              # duplicate
     o             # raise 2 to the power of each
      α            # absolute difference
       ·           # times 2
        »          # join list on newlines
         "NOPE!"   # push this string
                »  # join stack on newlines

```
> 2 votes

# Answer
# Javascript (ES2016), ~~58~~ ~~55~~ 54 bytes

*Saved 1 byte thanks to @l4m2*

*Saved 1 byte thanks to @user71546*

```
for(i=0;i<18;l(2**i-i<<!!i++))l=console.log;l("NOPE!")
```

Uses the formula `2(2<sup>n</sup>-n)` for all `n ≠ 0` and `2<sup>n</sup>-n` for `n = 0`, based on @MrXcoders Python 2 answer

## If returning an array of lines is allowed, ~~54~~ 52 bytes

```
_=>[...""+1e19].map((_,i)=>i>18?"NOPE!":2**i-i<<!!i)

```
> 2 votes

# Answer
# MATL, 19 bytes

```
l17:tWw-E"@]'NOPE!'

```

Try it online!
> 2 votes

# Answer
# Japt, 23 bytes

```
18Çn2pZ¹*2Ãh1 ·+"
NOPE!

```

Try it online!

---

# 24 bytes

```
17õ!²i½ í- m*2 ·+"
NOPE!

```

Try it online!
> 2 votes

# Answer
# , ~~56~~ ~~51~~ 39 bytes

```
cat(1,2*(2^(x=1:17)-x),"NOPE!",sep="
")

```

Try it online!
> 1 votes

# Answer
# Jelly, 19 bytes

```
1⁷17µ2*_µ€ḤY⁷“NOPE!

```

A full program printing the result to STDOUT.

**Try it online!**

### How?

```
1⁷17µ2*_µ€ḤY⁷“NOPE! - Main link: no arguments
1                   - literal 1 (printed as next byte starts a new leading constant chain)
 ⁷                  - literal newline (also printed for the same reason)
  17                - literal seventeen
    µ   µ€          - for €ach n in range -> [1,2,3,...,17]
     2              -   literal two
      *             -   raise to power n  -> [2,4,8,...,131072]
       _            -   subtract n        -> [1,2,5,...,131055]
          Ḥ         - double (vectorises) -> [2,4,10,...,262110]
           Y        - join with newlines (again this is printed, as above)
            ⁷       - literal newline (this is also printed for the same reason)
             “NOPE! - literal list of characters "NOPE!" (no trailing close quote required
                    -  at the end of a Jelly program)
                    - implicit print

```

Some alternatives exist for 19 bytes, like

```
‘Ṅ+⁴2*$_$€ḤY⁷“NOPE!

```
> 1 votes

# Answer
## Batch, 89 bytes

```
@echo 1
@set/ap=2
@for /l %%i in (0,2,32)do @call echo %%p%%&set/ap+=p+%%i
@echo NOPE!

```
> 1 votes

# Answer
# Perl 5, 42 bytes

```
say for 1,(map 2*(2**$_-$_),1..17),"NOPE!"

```

Try it online
> 1 votes

# Answer
# Bubblegum, 57 bytes

```
00000000: 04c1 4101 4331 0042 b1fb 5303 94f2 3bff  ..A.C1.B..S...;.
00000010: c696 9850 2c52 6eb1 471a fa1b 9646 9447  ...P,Rn.G....F.G
00000020: f595 e73d bc73 1f27 5fc5 eed5 f0b1 2ab2  ...=.s.'_.....*.
00000030: d8e2 3f3f ff00 5745 00                   ..??..WE.

```

Try it online!
> 1 votes

# Answer
# Java 10, ~~94~~ 80 bytes

```
a->{var r="";for(int i=0;i<18;)r+=(i<1?1:2)*((1<<i)-i++)+"\n";return r+"NOPE!";}

```

Using the formula from Herman Lauenstein's answer.

Thanks to Kevin Cruijssen for golfing 14 bytes.

Try it online here.

Ungolfed version:

```
a -> { // lambda taking an unused null parameter
    var r = ""; // we build the output as a String
    for(int i = 0; i < 18; ) // generate the sequence
        r += (i < 1 ? 1 : 2) * ((1 << i) - i++) + "\n"; // append 2*(2^i-i) for n > 0, 2^i-i for n = 0
    return r + "NOPE!"; // return the constructed sequence, with NOPE! appended
}

```
> 1 votes

# Answer
# Python 2, 61 bytes

```
i=0
x=1
print 1
exec"x*=2;print x;x+=i;i+=1;"*17
print"NOPE!"

```

**Try it online**

Just search OEIS
> 0 votes

# Answer
# C,  ~~71~~   ~~70~~  68 bytes

*Thanks to @Mr. Xcoder for saving three bytes!*

```
f(n){for(n=-1;++n<18;)printf("%d\n",((1<<n)-n)<<!!n);puts("NOPE!");}

```

Try it online!
> 0 votes

# Answer
# Haskell, 50 bytes

```
(unlines$show<$>1:[2*(2^n-n)|n<-[1..17]])++"NOPE!"

```

Try it online!
> 0 votes

# Answer
# Wolfram Language , 82 bytes

```
DifferenceRoot[Function[{y,n},{4-2 n-2 y[n]+y[1+n]==0,y[1]==1,y[2]==2}]]/@Range@18

```

This is actually a holonomic sequence whose solution was obtained from

```
f = FindSequenceFunction[{1, 2, 4, 10, 24, 54, 116, 242, 496, 1006}]

```

> ```
> DifferenceRoot[Function[{y,n},{4 - 2 n - 2 y[n] + y[1 + n] == 0, y[1] == 1, y[2] == 2}]]
>
> ```

I don't know why the `NOPE!` is needed as the sequence does continue

```
f[19]

```

> ```
> 524252
>
> ```
> 0 votes

# Answer
# Clean, ~~92~~ 65 bytes

```
import StdEnv
Start=("1\n",[(2*(2^n-n),'
')\\n<-[1..17]],"NOPE!")

```

Trivia: The type that is actually being printed is `(String, [(Int, Char)], String)`

Try it online!
> 0 votes

# Answer
# PHP 5.6+, 65 bytes

```
<?=1,"\n";for($i=0;$i++<17;){echo 2*(2**$i-$i),"\n";}echo"NOPE!";

```

Try it online!
> 0 votes

# Answer
# SNOBOL4 (CSNOBOL4), ~~97~~ 83 bytes

```
	OUTPUT =1
I	X =X + 1
	OUTPUT =LT(X,18) 2 * (2 ^ X - X) 	:S(I)
	OUTPUT ='NOPE!'
END

```

Try it online!

I'm still not really sure why I had two counters going; I only needed one.
> 0 votes

# Answer
# Charcoal, 18 bytes

```
Ｅ¹⁸Ｉ⎇ι⊗⁻Ｘ²ιι¹NOPE!

```

Try it online! Link is to verbose version of code. Explanation:

```
 ¹⁸                 Literal 18
Ｅ                   Map over implicit range
         ²          Literal 2
          ι         Current value
        Ｘ           Exponentiate
           ι        Current value
       ⁻            Subtract
      ⊗             Double
            ¹       Literal 1
     ι              Current value
    ⎇               Ternary
   Ｉ                Cast to string
                    Implicitly print on separate lines
             NOPE!  Literal string
                    Implictly print

```
> 0 votes

# Answer
# Haskell, 47 bytes

```
unlines[show$2*(2^x-x)-0^x|x<-[0..17]]++"NOPE!"

```

Try it online!
> 0 votes

# Answer
# Bash, 67 characters

```
echo 1
for((i=0;i++<17;));do
echo $((2*(2**i-i)))
done
echo "NOPE!"

```

Try it online!
> 0 votes

# Answer
# AWK, 48 bytes

```
END{for(;i++<17;){print 2*(2**i-i)}print"NOPE!"}

```

Try it online!
> 0 votes

# Answer
# Recursiva, 23 bytes

```
E++A1mB17"D~^2a"A"NOPE!

```

Try it online!

```
E++A1mB17"D~^2a"A"NOPE!  - Implicitly print the evaluated value
E                        - Join with newline
 +                       - Concatenate
  +A1mB17"D~^2a"         - [1, 2, 6, 14... 262142]
  +                      - Concatenate
   A1                    - Listify 1 [1]
     mB17"D~^2a"         - [2,6,14... 262142]
     m                   - map with
      B17                - [1,2...17]
         "D~^2a"         - Function 2(2^n - 1)
                A"NOPE!  - Listify ["NOPE!"]

```
> 0 votes

# Answer
# Perl 6, 35 bytes

```
{1,{2*(2**++$-++$)}.../21/,'NOPE!'}

```

Try it

```
{  # bare block lambda

  1,     # start the sequence with `1`

  {  # bare block used to generate values

    2*(
      2 ** ++$ # 2 to the power of an incrementing state variable
      -
      ++$      # incrementing anonymous state variable
    )
  }

  ...          # keep generating values until

  /21/,        # it generates a value that contains '21'

  'NOPE!'      # continue sequence with string 'NOPE!'
}

```
> 0 votes

# Answer
# Ruby, 43 bytes

```
->{[1]+(1..17).map{|i|2*(2**i-i)}<<"NOPE!"}

```

Try it online!

A lambda returning an array of integers (and one string). Breaking out 1 into a special case was pretty cheap, and didn't hurt my brain at all!
> 0 votes

# Answer
# Deadfish~, 530 bytes

```
{iiiii}dc{dddd}ic{iiii}c{dddd}c{iiii}iic{dddd}ddc{iiii}dcdc{dddd}iic{iiii}ciic{dddd}ddc{iiii}iiicdc{dddd}ddc{iiii}dcciiiiic{dddd}ddddc{iiii}ciicddc{dddd}c{iiii}iiciiiiicdddc{dddd}ddddc{iiii}dcdcciiiiiic{dddd}ddddc{iiii}cddciiciiiiiic{dddd}ddddddc{iiii}iicddddc{i}dddcdddc{dddd}ddc{iiii}iiiiiic{d}iiiciiiiiciic{dddd}ddddddc{iiii}dciiiiicdddciiciiic{dddd}ddddddc{iiii}icdciiiiicdddcddddc{dddd}iic{iiii}iiiicdccdddddciiiiiic{dddd}ddddc{iiii}dciicddcdciiiicddddc{dddd}iic{iiii}ciiiicddddcdccdc{dddd}iic{{i}ddd}ddcicic{d}dc{ddd}ddddddc

```

Try it online!
> 0 votes

---
Tags: code-golf, sequence, kolmogorov-complexity
---