# Self-contained math crossword with if-then-else clues

An entry in Fortnightly Topic Challenge #43: Variety Crossword Grids

Since I'm not good with with words and crosswords, here is a math crosswords: to know all the operands for the calculations you will have to replace the content of the brackets (e.g. {1 across}) with the answer to that clue (e.g. the answer to 1 across).

Some clues are of the form "if condition then A else B". As you can easily imagine in this case the answer is A if the condition is true and B otherwise. ACROSS

1: 2 to the {26 down}
5: if {27 across} is prime then 243 else 148
7: if {11 down} is a multiple of 42 then 300 else 118
8: if {1 across} < {35 across} then 47 else 82
10: if {33 down} is prime then 1848 else 2949
13: {31 across} + {7 across} + 176
15: {13 across}/{5 down}
16: {10 across} x {28 across} + 16837
18: {8 across}th pentagonal number
20: product of the digits of {31 across}
21: {32 across} - {4 down}
22: 6th term of OEIS A{9 down}
23: 7 x {4 down} / 10
24: 1000 + {5 across}
26: 5 x {20 across}
27: {30 across} + {13 across} - 664
28: if {2 down} is a multiple of 3 then 1567 else 1887
30: if all the digits of {1 down} are even then 1779 else 1189
31: {4 down} - 4
32: 2 x {23 across}
34: {28 down} / 5
35: {32 across} * {27 across} + 252

DOWN

1: 3226 x {17 down}
2: 2 + {13 across}
3: 520 + {24 down} * {20 across}
4: 2 * {20 across}
6: 4 x {30 across}
9: 4 x {3 down} + 140
11: {30 across} - 307
12: if {32 across}<50 then 8532 else 4137
14: ({15 across} - 5)th fibonacci number
17: if {26 across} is a multiple of 30 then 205 else 285
19: if {9 down} is odd then 27243 else 97158
24: if {14 down} is prime then 2896 else 1010
25: if {13 across} is a multiple of 3 then 4881 else 4798
26: {34 across} - {5 down}
27: {20 across}th prime number
28: {7 across} / 2
29: 12 x {8 across}
33: {30 across} - {24 across}

SOME CLARIFICATIONS

• All the answers are natural numbers in base ten without leading zeroes.
• Fibonacci numbers start with zero: 0, 1, 1, 2, 3, 5....
• Here you can find the OEIS website.
source: original puzzle by me. For this reason can you please provide some feedback about the grid? Is it too easy?
• It's possible that I've missed something, but: could this be an error? 20across = 2 x {23a}; 15a = 5 x {20a}. Therefore 15a = 5 x 2 x {23a}. Since 15a is two fields wide, 23a has to be < 10. This is not possible, since 23a is also two fields wide and you specified that all answers are natural numbers without leading zeroes. – npkllr Nov 17 at 22:35
• @shoover that's exactly what happened, thank you two for fixing it. I actually did know that markdown feature but I forget to recheck – melfnt Nov 18 at 8:49
• This is a very nice original puzzle! – Dmitry Kamenetsky Nov 19 at 8:01

Was fun to solve it!

Here is my solution:

• Could you provide an explanation as to how you arrived at this answer? Answers to [grid-deduction] puzzles are generally expected to show at least some of their logical solve path. – bobble Nov 18 at 0:06
• This is the right answer, well done! Can you please share the logical steps as @bobble suggested? Just the first ten-fifteen numbers would be enough, I think that the remaining part is relatively simple to fill – melfnt Nov 18 at 8:53
• Caution - Possible spoiler! I also did it and I never (or perhaps almost never) had to use conditions in "if condition then x else y" to determine a number. Seeing x and y as two options for a number were enough to fill the entire puzzle. – puck Nov 18 at 18:48
• @puck no problem, there are a lot of ways to solve this. I hope you enjoyed my puzzle – melfnt Nov 18 at 19:51
• @melfnt Yes I did :-) – puck Nov 19 at 6:00

Here's a start:

{1 across}. Five digit powers of 2 are 16384, 32768 and 65536.
{1 down}: it's 3226 x (17 down) but 17 down has two possible values only, 205 / 285, so this also has two possible values being 661330 and 919410. But he first digit of the previous bullet point is the same so it must be 65536 and 661330 and {17 down} is 205
{30 across} is 1189
{6 down} is 4 * 1189 = 4756
{11 down} is 1189 - 307 = 882
{25 down} the last digit of {30 across} is its third digit and so this must be 4798 and {13 across} is not a multiple of 3
{20 across} since both choices of {12 down} has 3 as the third digit, this first digit is 3, the second digit from {17 down} is 0
{26 across} from the previous is 150
{27 down} the 30th prime is 113
{4 down} is 60 because of {20 across}
{7 across} then must be 300 (countercheck {11 down} is indeed a multiple of 42)
{10 across} starts with 1 and 8 because of {1 down} and {11 down} and so this is 1848 {33 down} is prime
{2 down} now has all digits: 5 from {1 across}, 3 from {7 across} and 4 from {10 across} -- 534
{13 across} is 534 - 2 = 532
{31 across} from {13 across} and {7 across}, 532 = {31 across} + 300 + 176 = 56
{28 down} is 150 (countercheckable with the previous)
{28 across} is 1567 since {2 down} is divisible by 3
{29 down} is 12 times something, the first digit is 5, the second digit is 6 thus the third is 4 -- 564
{8 across} is 564 / 12 = 47 and {35 across} will be larger than 65536
{27 across} is {30 across} + {13 across} - 664 aka 1189 + 532 - 664 = 1057
{23 across} is 7 x {4 down} / 10 = 42
{32 across} is 2 x {23 across} = 84
{35 across} is {32 across} * {27 across} + 252 = 89040 indeed more than 65536
{14 down} is a seven digit Fibonacci number: 1346269, 2178309, 3524578, 5702887, 9227465. Both the second digit of {13 across} and the first digit of {23 across} mandates this to be 3524578
{15 across} since 3524578 is the 33th Fibonacci number, this is 38. We also knew this is 38 from {1 down} and {11 down} but never hurts to check.

Illustrations are hard work. Feel free to copy https://docs.google.com/spreadsheets/d/1VbSrX8qcxtUp84aeYh01qklIHDrPhQX230_i8Gt-5xA/edit?usp=sharing and amend. Here is the state of affairs after the first few steps:

• Could you provide some images of in-between steps, so that it is easier to visualize you solution & solve path? – bobble Nov 18 at 19:45
• I did it in my head :) that's why I typed up digit-by-digit. Do you have tools to make these images? – chx Nov 18 at 20:27
• You could use a spreadsheet editor (Google Sheets or Excel, for example) and set up a grid there, then take screenshots. Or you could use an image editor and draw onto the picture of the grid given in the question. See this meta post for more detailed explanations. – bobble Nov 18 at 20:29