All techniques
Sūtra 10 of 16

Yāvadūnam

Whatever the deficiency

Squaring numbers near a power of 10.

When to use

Squaring numbers near 100, 1000, etc.

How it works

For N near base B with deficit d (so N = B − d): N² = (N − d) | d². Left part is N minus the deficit; right part is d² (padded).

Memory formula

Near base square: left = N ± deviation; right = deviation² padded to base digits.

Worked examples

Problem 1
97²
0/4
    Problem 2
    104²
    0/4

      Try it yourself

      Try to solve, then reveal the steps one at a time.

      easy
      Compute 96²
      medium
      Compute 108²

      Modern applications

      Where this ancient technique still lives in today's world.

      Coding

      Squaring near a power of 2

      When squaring numbers near 2^n, the deficit/surplus trick reduces a multiply to a shift + small multiply — an SIMD optimisation pattern.

      Code in your favourite language

      Square a number near a base by adjusting deviation twice.

      Python
      def yavadunam_square(n: int, base: int) -> int:
          d = n - base
          left = n + d
          right = d * d
          digits = len(str(base)) - 1
          return left * (10 ** digits) + right
      
      print(yavadunam_square(96, 100))  # 9216

      Stuck? Ask the tutor.

      Get a personal walkthrough of Yāvadūnam with examples tuned to your question.

      Open AI Tutor