Tags: programming 

Rating:

# Challenge description

Let x = 1

Let calculation = (x*(x+1)) + (2 *(x + 1))

Let reversed_calc = reversed number of calculation [for example if calculation = 123, reversed_calc will be 321]

If reversed_calc can be divided by 4 without reminder then answer = answer + reversed_calc

Repeat all the calculations until you have x = 543

The final answer will be the flag when x = 543

Flag Format : KCTF{answer_here}
Example Flag : KCTF{123}

**Author : NomanProdhan**

-----------------------------------------------------------
sol.py

```python
x = 1
a=0
while x!=544:

calc=(x*(x+1)) + (2 *(x + 1))
k=str(calc)
x =x +1
reversed_calc= k[::-1]
reversed_calc=int(reversed_calc)
if reversed_calc % 4 ==0:
# print(x)
a=a+reversed_calc

print(a)
```

Output of sol.py :
```
12252696
```
``` KCTF{12252696} ```

Original writeup (https://github.com/j3seer/KnightCTF-2022-WriteUps/tree/main/KnightCTF%202022/Programming/Reverse%20the%20answer).