# 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. Nov 17 '20 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 Nov 18 '20 at 8:49
• This is a very nice original puzzle! Nov 19 '20 at 8:01

Steps:

18a - Look up OEIS Pentagonal numbers 47 and 82 (Two choice for 8a) 3290 fits, 10045 doesn't. Leaving 3290 for 18a, and 47 for 8a
30a - We just put a 3 in 1d, so 1189
11d - From 30a (1189-307 = 882)
7a - From 11d (882 % 42 = 0, so 300)
10a - Cross check with 11d, only one choice fits. (1848)
33d - 4? (5d clue), and is prime (from 10a clue) ->(41,43,47) Which makes 5d (14,34,74) BUT 5a is 243 or 148 and only 148 fits. all three clues solved.
6d - from 30a,
13a - ?32 from 2d, and the first digit is a 5 from cross check. Also gives 2 d.
1a - the 5 from 2d gives us 65536, and 26d is 16
4d - now known, and consequently 23a.

That should be enough to get anyone started - It's pretty much substitution from then on.

Grid at this stage:

At this point, I went through the clues, and put in all values I knew. Then it was pretty much a top to bottom substitute and Calculate.

Across

15a - 532/14 = 38 (confirmed by cross)
24a - 1000 + 148 = 1148
26a - 5 x 30 = 150
27a - 1189 + 532 -664 = 1057
28a - 534 % 3 = 0, so 1567 (Also could have solved 1??7 and 26d gives 1?67 and pattern match)
31a - 60 - 4 = 56 32a - 2 x 42 = 84
34a - 15? / 5 = 30 or 31 - Enter the 3 in the grid.
35a - 84 x 1057 + 252 = 89040 (Also lets us solve 34a)

Grid after across substitutions:

Then onto the down clues:

3d - 520 + 1010 x 30 = 30820
9d - 4 x 30820 + 140 = 123420
12d - since !(84 < 50), then 4137
14d - (38 - 5 = 33)rd Fibonacci - But I'm too lazy to look it up.
17d - 150 % 30 = 0, then 205 (Also solvable by pattern ?0?)
19d - 9d is even, 97158 (Only the 7 is new, rest cross checks!!)
24d - 14d is even, not prime, so 1010 (Cross check only)
25d - 5+3+2 = 10. Not divisible by 3. So 4798 (Cross Check Only)
26d - (We have this from first set, but use it to cross check 34a 30 - 14 = 16 OK!)
27d - 113 - not checking, but it looks reasonable as 20th prime.
28d - 300/2 = 150 (Cross Check only)
29d - 12 x 47 = 564 (Cross check only)
33d - 1189 - 1148 = 41 (Cross Check only)

Finishing Up:

1d - 3226 x 205 = 661330
21a - 84 - 60 = 24
16a - 1848 x 1567 +16837 = 2912653 ( Only 9 and 5 are new, rest cross check)

Which leaves us with:

2 remaining clues are look ups which I include for completeness and final correctness check.

22a - The 6th term of OES A123420 is 75.
14d - The 33rd Fibonacci is 3524578

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. Nov 18 '20 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 Nov 18 '20 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 '20 at 18:48
• @puck no problem, there are a lot of ways to solve this. I hope you enjoyed my puzzle Nov 18 '20 at 19:51
• @melfnt Yes I did :-)
– puck
Nov 19 '20 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? Nov 18 '20 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 '20 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. Nov 18 '20 at 20:29

without any difficulty you can figure out

across

24 first digit is known because you are adding a 3 digit number to 1000 so the first digit has to be a one

28 last digit is known because both number share the same digit

30 last digit is known because both number share the same digit

down

17 last digit is known

19 second digit is known

knowing 24 across first digit you know 24 down is 1010

14 across can be figure out using the 7 from 28 across and the length to find only value in sequence to give you that.

from there you also know 15 across

these are just a few quick ways to get started on this puzzle

Knowing the last digit of 30 across tells you 25 down

• Welcome to Puzzling! You say that digits are "known" - what are they known to be? What digit, for example, starts 24 Across? Why must that digit start 24 Across? Could you perhaps illustrate with a picture of the grid? And so forth. Answers to [grid-deduction] questions are expected to explain their logic. Dec 21 '20 at 22:01
• I see you've added some explanation. However, I'm still not clear on why 24 "shares the same digit" - share with what? - or what that digit is. Could you please add an explanation of what digits you are placing, and which clues you are using as part of your logic? Dec 22 '20 at 15:59