CLASS 8 · Computational Thinking
Class 8 CT and AI: A Square and a Cube Solutions
Work through A Square and a Cube with explanations for the Class 8 CBSE Computational Thinking and Artificial Intelligence handbook.
Jump to a question or activity
Key ideas
Use prime factors, square and cube patterns, and constraints to solve the puzzles. Check a proposed rule against every supplied example.
Short Concept Lessons
Learn a method, follow the example, then use it in the additional practice.
Squares and cubes
A square uses two equal factors; a cube uses three.
12² = 144; 12³ = 1728.
Remember: Do not confuse 3 n with n³.
Practise this method →Complete prime-factor groups
For a square, prime exponents are even. For a cube, they are multiples of three.
72 = 2³ × 3², so multiplying by 3 gives 216 = 6³.
Remember: Add only the missing prime factors.
Practise this method →Use units digits and bounds
The last digit of a power depends on the last digit of its base.
17³ ends in 3, because 7³ ends in 3.
Remember: Bounds help reduce the candidates before testing.
Practise this method →Trace a sequence of rules
Apply each operation to the result of the previous step.
Input 5: square and subtract 1 gives 24; digit sum gives 6; cube gives 216.
Remember: Keep intermediate results visible.
Practise this method →Check every condition
A candidate is valid only if it satisfies all stated rules.
For a fixed L shape, compare every legal placement without rotating it.
Remember: Do not quietly add restrictions that were not given.
Practise this method →Questions and Solutions
Q1. In the following grid, all the circles follow the same theme.
What will be the value of A + B?

Solution
Option (c) 13. Each circle adds the squares of its two connected shaded values: 4² + 3² = 25 and 5² + 9² = 106. Thus B² = 117 − 9² = 36, so B = 6. Next A² = 85 − 6² = 49, so A = 7. Therefore A + B = 13.
Q2. Sam writes a list of natural numbers.
The list has three perfect cubes and three perfect squares. If no number in the list has more than two digits, what is the MINIMUM number of distinct numbers he must have written?
Solution
Option (b) 4. The positive numbers below 100 that are both squares and cubes are 1 and 64. Count these in both groups, then add one square-only number and one cube-only number: {1, 4, 8, 64}. This gives three of each using four distinct numbers. Three numbers would require three shared square–cube numbers, which do not exist in this range.
Q3. If AB is a two-digit number whose cube is in the form of a 4-digit number “__ __ __ C” such that A < C < B, how many different values can C have?
Solution
Option (a) 2. The base must lie from 10 to 21 because 10³ = 1000, 21³ = 9261 and 22³ = 10648. Testing the units digits leaves 17³ = 4913 and 18³ = 5832. They satisfy 1 < 3 < 7 and 1 < 2 < 8. Thus C can be 3 or 2.
Q4. 56 × k is a perfect cube where k is a natural number.
What could be the smallest possible value of k?
Solution
Option (b) 49. Since 56 = 2³ × 7, multiply by 7² so every prime exponent is a multiple of three. Then 56 × 49 = 2744 = 14³.
Q5. Each geometrical shape denotes a certain operation.
What will come in place of “?”

Solution
Option (c) 1924. A square means square its entry; the cube drawing means cube its entry. Therefore 14² + 12³ = 196 + 1728 = 1924.
Q6. XYZ is a 3-digit number such that it is the square of a multiple of 5.
What will be the HIGHEST possible remainder of (XYZ)/100?
Solution
Option (d) 25. The possible squares are 100, 225, 400, 625 and 900. Their remainders on division by 100 are either 0 or 25, so the largest is 25.
Q7. A class teacher wrote the following pattern on the board, where an expression is written after the “=” sign in each row.
She then asked the class to find the expression for 13³ – 12³. Which DIGIT appears the HIGHEST number of times in the expression that denotes 13³ – 12³?

Solution
Option (a) 1. Use n³ − (n − 1)³ = 1 + 3n(n − 1). The required expression is 1 + 13 × 12 × 3. The digit 1 occurs three times, 3 twice, and 2 once. Count digits in this expression, not in its evaluated value 469.
Q8. Fill in the grid with the squares and cubes of digits 2 to 5 such that:
● Each square/cube number appears twice
● Both square and cube of the same number cannot appear in the same row/column
● Same numbers do not appear diagonally
What is the maximum possible sum that can be obtained by the cells present in the configuration of Shape A (without rotation)?

Solution
Option (a) 197 — the intended answer. Enforce the row/column restrictions for each square–cube pair and reject repeated equal values on a diagonal. The completed rows are:
| Row | Column 1 | Column 2 | Column 3 | Column 4 |
|---|---|---|---|---|
| 1 | 64 | 9 | 25 | 4 |
| 2 | 27 | 125 | 8 | 16 |
| 3 | 8 | 64 | 9 | 25 |
| 4 | 125 | 4 | 16 | 27 |
For the L shape shown, use row 2 column 2 above row 3 columns 1 and 2: 125 + 8 + 64 = 197. Checking the nine possible placements of that unrotated shape gives no larger sum.
Check the condition: This answer assumes the same value cannot repeat within a row or column. That extra restriction is not stated. With only the printed rules, another valid grid has rows (64,125,9,4), (27,125,8,16), (8,64,9,25), (25,4,16,27). Shape A at the upper left then totals 125 + 27 + 125 = 277, so the listed options do not give the maximum under the rules as written.
Q9. The image below shows a logic machine, where numbers move from Column to Column (starting from column 1 as input and reach column 4) through the tunnel, where they change in a different way, each time.
What would be the sum of A, B, and C?

Solution
Option (d) 1788. Tunnel 1 squares the input and subtracts 1: A = 7² − 1 = 48. Tunnel 2 adds the digits: B = 4 + 8 = 12. Tunnel 3 cubes the result: C = 12³ = 1728. Sum = 48 + 12 + 1728 = 1788.
Q10. Every column follows a certain rule.
What number should come in place of “?”

Solution
Option (b) 18. The bottom entry is the square root of the product above it: √(16 × 9) = 12, √(28 × 7) = 14 and √(25 × 16) = 20. Thus √(12 × 27) = √324 = 18.
The Thinking Spot
Boxes are stacked in four columns A, B, C, and D, such that:
• Each box is labelled with a number from 1, 2, and 3, with labels on some of the boxes already shown in the image given below
• No two adjacent boxes in the same column are labelled with the same number
• No two adjacent columns have the same number on the topmost box
• For every column, the sum of the numbers labelled on the topmost and bottommost block is equal
In the shaded boxes, which of these numbers will occur the HIGHEST number of times?

Solution
Option (b) 2. Column C has top 2. Its bottom cannot be 2, and cannot be 1 because a common end-sum of 3 would be impossible for column D, whose top is 3. Thus C ends in 3 and every end-sum is 5. From top to bottom the columns are A: 2, 1, 3; B: 3, 2, 1, 2; C: 2, 3; D: 3, 1, 2. Among the shaded cells, 2 occurs three times, more than 1 or 3.
Additional Practice Questions with Solutions
Choose an answer, use a hint if needed, then open the worked solution to check your reasoning.
Solved 0 of 10 · Checked 0 of 10
Your practice progress lasts until you reset or reload this page.
Apply · powers
Practice Q1. What is 9² + 4³?
Show hint
Evaluate each power first.
Show worked solution
Option (b) 145.
81 + 64 = 145.
Common mistake: A cube means three equal factors.
Apply · factors
Practice Q2. What is the smallest natural number k for which 72 k is a perfect cube?
Show hint
72 = 2³ × 3².
Show worked solution
Option (c) 3.
One more factor 3 completes 3³, so 72×3=216=6³.
Common mistake: Cube exponents must be multiples of three.
Apply · shared
Practice Q3. Which number is both a perfect square and a perfect cube?
Show hint
Look for a sixth power.
Show worked solution
Option (a) 64.
64=8²=4³.
Common mistake: Being one kind of power does not imply the other.
Apply · digits
Practice Q4. What is the units digit of 28³?
Show hint
Only the units digit 8 matters.
Show worked solution
Option (d) 2.
8³=512, so 28³ ends in 2.
Common mistake: Do not use the units digit of the square.
Apply · rules
Practice Q5. A machine squares its input, subtracts 1, then adds the digits. What is its output for 6?
Show hint
Keep the steps in order.
Show worked solution
Option (b) 8.
6²−1=35, then 3+5=8.
Common mistake: Do not stop at an intermediate result.
Apply · constraints
Practice Q6. An L shape has an upper-right cell 7 above a bottom row of 11 and 13. What is its total?
Show hint
Add all three occupied cells.
Show worked solution
Option (c) 31.
7+11+13=31.
Common mistake: Each occupied cell is counted once.
Apply · factors
Practice Q7. What is the smallest natural number that multiplies 18 to make a perfect square?
Show hint
18=2×3².
Show worked solution
Option (a) 2.
Multiplying by 2 gives 36=6².
Common mistake: Use the smallest factor that completes pairs.
Apply · shared
Practice Q8. How many positive numbers below 100 are both squares and cubes?
Show hint
List the positive sixth powers below 100.
Show worked solution
Option (d) Two.
1⁶=1 and 2⁶=64;3⁶=729 is too large.
Common mistake: Positive numbers exclude zero.
Apply · digits
Practice Q9. Which remainder can 45² leave when divided by 100?
Show hint
Find the last two digits.
Show worked solution
Option (b) 25.
45²=2025=20×100+25.
Common mistake: A remainder must be smaller than the divisor.
Apply · powers
Practice Q10. Using n³−(n−1)³=1+3 n(n−1), what is 6³−5³?
Show hint
Substitute n=6.
Show worked solution
Option (c) 91.
1+3×6×5=91; also 216−125=91.
Common mistake: Subtract the cubes, not the bases.
