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.

Book: CBSE CT and AISession: 2026–27
Jump to a question or activity
  1. Question 1
  2. Question 2
  3. Question 3
  4. Question 4
  5. Question 5
  6. Question 6
  7. Question 7
  8. Question 8
  9. Question 9
  10. Question 10
  11. The Thinking Spot
  12. Short concept lessons
  13. Additional practice questions

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.

Worked example

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.

Worked example

72 = 2³ × 3², so multiplying by 3 gives 216 = 6³.

Remember: Add only the missing prime factors.

Practise this method →
Numbers that are squares and cubes

A positive integer is both when each prime exponent is a multiple of six.

Worked example

64 = 8² = 4³ = 2⁶.

Remember: Count a shared value once when counting distinct numbers.

Practise this method →
Use units digits and bounds

The last digit of a power depends on the last digit of its base.

Worked example

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.

Worked example

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.

Worked example

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?

Circle grid: 4²+3²=25; 2²+3²=13; 5²+9²=106; 9²+B²=117; B²+A²=85.
a) 12
b) 14
c) 13
d) 15

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?

a) 3
b) 4
c) 5
d) 6

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?

a) 2
b) 3
c) 4
d) More than 4

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?

a) 36
b) 49
c) 56
d) 72

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 “?”

Square symbols: 16 gives 256 and 19 gives 361. Cube symbols: 15 gives 3375 and 11 gives 1331. Find square of 14 plus cube of 12.
a) 2888
b) 1914
c) 1924
d) 340

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?

a) 10
b) 15
c) 20
d) 25

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³?

Board: 2³−1³=1+2×1×3; 3³−2³=1+3×2×3; 4³−3³=1+4×3×3. Find 13³−12³.
a) 1
b) 2
c) 3
d) 4

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)?

Four by four grid and unrotated Shape A: one cell above the right-hand cell of a two-cell bottom row.
a) 197
b) 161
c) 193
d) 216

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:

RowColumn 1Column 2Column 3Column 4
1649254
227125816
3864925
412541627

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?

Logic machine rows: 4 to15 to6 to216; 22 to483 to15 to3375; 11 to120 to3 to27; 7 toA toB toC.
a) 2259
b) 1795
c) 180
d) 1788

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 “?”

Columns: 16,9,12; 28,7,14; 25,16,20; 12,27,question mark.
a) 17
b) 18
c) 19
d) 21

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?

Stacks A to D have 3,4,2,3 boxes. B third box is1; C top is2; D top is3. Shaded boxes are A top and bottom, B second and bottom, C bottom, D middle.
a) 1
b) 2
c) 3
d) All of them occur equally

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³?

Choose one answer for Practice Q1
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?

Choose one answer for Practice Q2
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?

Choose one answer for Practice Q3
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³?

Choose one answer for Practice Q4
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?

Choose one answer for Practice Q5
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?

Choose one answer for Practice Q6
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?

Choose one answer for Practice Q7
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?

Choose one answer for Practice Q8
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?

Choose one answer for Practice Q9
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³?

Choose one answer for Practice Q10
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.

Scroll to Top