For any given even number #sqrtA# that has #m# digits and #A# with #n# digits, is there a relationship between #m# and #n#?

1 Answer
  • if #n# is even, #m=n/2#
  • if #n# is odd, #m=(n+1)/2#

where #m# is the number of digits in #sqrtA#

Explanation:

Let's first look at a few terms and see if we can spot a pattern (I'm including the variable #m# which is the number of digits in #sqrtA#):

#((A, n,sqrtA, m),(4,1,2,1),(16,2,4,1),(36,2,6,1),(64,2,8,1),(100,3,10,2),(144,3,12,2),(vdots, vdots, vdots, vdots))#

Since #A# is even, then #sqrtA# will also be even. And so what I'll do next is look at what values of #A# we generate for different values of #sqrtA# with different #m#:

#((A, n,sqrtA, m),(4,1,2,1),(16,2,4,1),(vdots, vdots, vdots, vdots),(64,2,8,1),(100,3,10,2),(vdots, vdots, vdots, vdots),(900,3,30,2),(1024,4,32,2),(vdots, vdots, vdots, vdots),(9604,4,98,2),(10000,5,100,3))#

And so we can see relationships:

#n=1, m=1#
#n=2, m=1#
#n=3, m=2#
#n=4, m=2#
#n=5, m=3#

and so on.

And so we can calculate #m# for any #n#, where,

  • if #n# is even, #m=n/2#
  • if #n# is odd, #m=(n+1)/2#

Let's test it out:. Let's say #sqrtA=45678, m=5=>A=2086479684, n=10 color(green)sqrt#