[Question]
  [
Your task is to turn a square root like this:
```
√12
```
into a form like this:
```
2√3
```
For our purpose, we only need to output the left number here:
```
2
```
## Test cases
```
4  -> 2
9  -> 3
12 -> 2
13 -> 1
108-> 6
```
## Specifications
* You may assume for the input that \$n>0\$. \$n\$ has to be as large as possible.
* If the number is already a perfect square, do this:
```
√4 = 2√1 -> 2
```
* If the number doesn't contain perfect squares, do this:
```
√13 = 1√13 -> 1
```
  
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), ~~9~~ ~~6~~ 5 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
LnIÖO
```
[Try it online](https://tio.run/##yy9OTMpM/f/fJ8/z8DT///8NjQA) or [verify all test cases](https://tio.run/##yy9OTMpM/V9Waa@k8KhtkoKSfeV/n7zKw9P8/@v8jzbQMdQx0bHUMTTSMTTWMTaLBQA).
**Previous ~~9~~ 6 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage) approach:**
```
LR.ΔnÖ
```
-3 bytes thanks to *@ovs*.
[Try it online](https://tio.run/##yy9OTMpM/f/fJ0jv3JS8w9P@/zc0AgA) or [verify all test cases](https://tio.run/##yy9OTMpM/V9Waa@k8KhtkoKSfeWhlf99gvTOTTm0rjjv8LT/tTr/ow10DHVMdCx1DI10DI11jM1iAQ).
**Explanation:**
```
L       # Push a list in the range [1, (implicit) input]
 n      # Take the square of each value in the list
  IÖ    # Check which squares are divisible by the input (1 if truthy; 0 if falsey)
    O   # And sum those checks
        # (after which this sum is output implicitly as result)
L       # Push a list in the range [1, (implicit) input]
 R      # Reverse it to [input, 1]
  .Δ    # Find the first value in this list which is truthy for:
    n   #  Square the current value
     Ö  #  Check if the (implicit) input is evenly divisible by this square
        # (after which the found value is output implicitly as result)
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 5 bytes
```
Ḷ²%ċ0
```
Uses the formula from [the OEIS](https://oeis.org/A000188): the number of solutions to $$x^2 \equiv 0 \ (\mathrm{mod} \ n)$$
Explanation:
* implicit input
* range `0..n-1`,
* square each
* modulo input (I got this part to work via trial and error)
* count zeroes
* implicit print
[Try it online!](https://tio.run/##y0rNyan8///hjm2HNqke6Tb4//@/pamFuaGlMQA "Jelly – Try It Online")
[Answer]
# [Brachylog](https://github.com/JCumin/Brachylog), 8 6 5 bytes
*-1 thanks to Unrelated String*
```
f↔∋√ℕ
```
[Try it online!](https://tio.run/##AUEAvv9icmFjaHlsb2cy/3t3IiAtPiAidz/ihrDigoLhuol94bWQ/2bihpTiiIviiJrihJX//1s0LDksMTIsMTMsMzAwXQ "Brachylog – Try It Online")
### How it works
```
f↔∋√ℕ
    ℕ output is a natural number (≥0) that is
   √  the root of … (Brachylog gives the negative root first)
  ∋   an element …
f↔    in the reverse factors list (so search starts with bigger values)
```
## Alternative version with prime factors, 10 bytes
```
{ḋp⊇~j×}ᵘ⌉
```
[Try it online!](https://tio.run/##SypKTM6ozMlPN/r/v/rhju6CR13tdVmHp9c@3Dojv@T/f0Pj/1EA "Brachylog – Try It Online") or verify [all test cases](https://tio.run/##SypKTM6ozMlPN/r/v7r64Y7ugkdd7XVZh6fXPtw6I78ESE74/z/aRMdSx9BIx9BYx9jAIPZ/FAA).
### How it works
```
{ḋp⊇~j×}ᵘ⌉
         ⌉  take the maximum of …
{      }ᵘ   all unique …
      ×       multiplications of …   10
    ~j        halves of …            [2,5]
   ⊇          ordered subsets from … [2,5,2,5]
  p           the permutations of …  [2,5,2,5,3]
 ḋ            the prime factors      [2,2,3,5,5]
```
[Answer]
# [Japt](https://github.com/ETHproductions/japt) `-mx`, ~~4~~ 3 bytes
[*Crossed out &nbsp4;&nbsp; is no longer 4 :)*](https://codegolf.stackexchange.com/questions/170188/crossed-out-44-is-still-regular-44)
```
²vN
```
My first Japt answer. :)  
Port of [my first 5-byter 05AB1E answer](https://codegolf.stackexchange.com/a/206857/52210), but with smart use of Japt's flags for the range and sum.
-1 byte thanks to *@Shaggy* thanks to the [shortcuts list](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=sg#docs-shortcuts): `p)`/`p␠` to `²`
[Try it online.](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&flags=LW14&code=snZO&input=MTA4)
**Explanation:**
```
-m       # Convert the (implicit) input-integer to a ranged list [0, input)
  ²      # Square each value in the list, and implicitly close the function
   vN    # Check which values are divisible by the input (1 if truthy; 0 if falsey)
     -x  # After which the sum is calculated of the resulting list
         # (before the result is output implicitly)
```
[Answer]
# JavaScript (ES6), 27 bytes
```
f=(n,k=n)=>n/k%k?f(n,k-1):k
```
[Try it online!](https://tio.run/##y0osSyxOLsosKNHNy09J/f8/zVYjTyfbNk/T1i5PP1s12z4NxNc11LTK/p@cn1ecn5Oql5OfrpGmYaKgoKmpoK@vYMSFKmEJkzBGkzA0wqHD0BgqYYguYWABkTD7DwA "JavaScript (Node.js) – Try It Online")
### How?
We recursively look for the greatest \$k\le n\$ such that \$\dfrac{n}{k}\equiv 0\pmod k\$, which is guaranteed to be satisfied for \$k=1\$ in the worst case.
This is a more golf-friendly way of testing \$\dfrac{n}{k^2}\equiv 0\pmod 1\$.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 6 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
```
ÆE:2ÆẸ
```
A monadic Link accepting a positive integer which yields a positive integer.
**[Try it online!](https://tio.run/##y0rNyan8//9wm6uV0eG2h7t2/P//39DU2NLE2NwSAA "Jelly – Try It Online")** Or see the [first 100](https://tio.run/##y0rNyan8//9wm6uV0eG2h7t2/Dc0MDjc/qhpzf//hqbGlibG5pYA).
### How?
```
ÆE:2ÆẸ - Link: integer, X          e.g. 9587193
ÆE     - factorisation vector (X)       [0,1,0,4,3] (since 2°×3¹×5°×7⁴×11³=9587193)
  :2   - integer divide by two          [0,0,0,2,1]
    ÆẸ - evaluate factorisation vector  539         (since 2°×3°×5°×7²×11¹=539)
```
[Answer]
# [Gaia](https://github.com/splcurran/Gaia), 5 bytes
(this was produced by trying a bunch of languages from <https://github.com/ETHproductions/golfing-langs> until I found one that had the most useful built-ins for this problem)
```
dụ⁇)u
```
Explanation:
```
d     divisors
 ụ⁇   keep only squares
   )  take last
    u square root
```
[Try it online! (example stolen from the Jelly answer)](https://tio.run/##S0/MTPz/P@Xh7qWPGts1S///tzS1MDe0NP4PAA "Gaia – Try It Online")
[Answer]
# [CP-1610](https://en.wikipedia.org/wiki/General_Instrument_CP1600) machine code, ~~20~~ 17 DECLEs1 ≈ 22 bytes
*As per the exception described [in this meta answer](https://codegolf.meta.stackexchange.com/a/10810/58563), the exact score is **21.25 bytes** (170 bits)*
A routine expecting the input number in **R0** and returning the result in **R3**.
```
**1D2** |         CLRR    R2
**1C9** |         CLRR    R1
**0D1** | @@loop  ADDR    R2,     R1
**00A** |         INCR    R2
**084** |         MOVR    R0,     R4
**10C** | @@sub   SUBR    R1,     R4
**10C** |         SUBR    R1,     R4
**114** |         SUBR    R2,     R4
**22E 004** |         BGT     @@sub
**20C 001** |         BNEQ    @@next
**093** |         MOVR    R2,     R3
**141** | @@next  CMPR    R0,     R1
**226 00D** |         BLE     @@loop
**0AF** |         JR      R5
```
### How?
The CP-1610 has no multiplication, no division, no modulo. We want to implement an algorithm that relies on additions and subtractions exclusively.
We start with \$k=0\$. At each iteration, we update \$j\$ in such a way that:
$$j = \frac{k(k-1)}{2}$$
The good thing about this formula is that it's very easy to compute iteratively: we just need to add \$k\$ to \$j\$ and increment \$k\$ afterwards.
In order to test whether \$n\$ is divisible by \$k^2\$, we initialize a variable \$x\$ to \$n\$ and subtract \$k^2\$ until \$x\le 0\$.
We do not explicitly store \$k^2\$, but it can be easily obtained with:
$$2j+k=k(k-1)+k=k^2$$
Each time we end up with \$x=0\$, we update the final answer to \$k\$.
We stop when \$j\$ is greater than \$n\$.
[Here is a link](https://tio.run/##fZLNboMwEITvPMVUysEIpSE9lpJnCSUmgIkd2Uuhinj2dG1SlTRqffLPt@PZ0bbFR@FK25xprc1BXq8VcmjkO1wiQPEhzXjThg3u1mbD142DEgprbGNs8BIxezCh1hclOVR2X9KfDwVJtIFQSfIo2ujSypPUBBWg0TvKfkGOCksYGqrn9yig/usHvc6Y82s0H0esc7TZ8hlw/TvZoiQ2XFlzwvgfTENTyiWg/lJTS7UJQ910UozYIY2zGQ5XrMIhHq3kWCyoLjTSuZumEk9jvOzIp1NhkGC6rCFH/qf7RPrdnpUOS0fB0C1xqn2Z6zsCmVu0U/TjrMUb5xis@bqjgdE3h/OTN2Ul9VZ7nSyarpWxgmcF24xHhpFtyjOikyQOA1Aa7UwnnztzFPtCrC56ihleXSqh42kfe4Uv) to an implementation of the algorithm in low-level JS.
### Full commented test code
```
        ROMW    10                ; use 10-bit ROM width
        ORG     $4800             ; map this program at $4800
PNUM    QEQU    $18C5             ; EXEC routine: print a number
MULT    QEQU    $1DDC             ; EXEC routine: signed multiplication
        ;; ------------------------------------------------------------- ;;
        ;;  main code                                                    ;;
        ;; ------------------------------------------------------------- ;;
main    PROC
        SDBD                      ; set up an interrupt service routine
        MVII    #isr,   R0        ; to do some minimal STIC initialization
        MVO     R0,     $100
        SWAP    R0
        MVO     R0,     $101
        EIS                       ; enable interrupts
        MVII    #$200,  R3        ; R3 = backtab pointer
        SDBD                      ; R4 = pointer to test cases
        MVII    #@@tc,  R4
@@loop  MVI@    R4,     R0        ; R0 = next test case
        TSTR    R0                ; stop if it's 0
        BEQ     @@done
        PSHR    R4                ; save R4
        PSHR    R3                ; save R3
        CALL    pSquare           ; invoke our routine
        MOVR    R3,     R0        ; copy the result into R0
        PULR    R3                ; restore R3
        CALL    print             ; print the result
        PULR    R4                ; restore R4
        B       @@loop            ; go on with the next test case
@@done  DECR    R7                ; done: loop forever
        ;; test cases
@@tc    DECLE   4, 9, 12, 13, 108, 300, 800, 900
        DECLE   0
        ENDP
        ;; ------------------------------------------------------------- ;;
        ;;  prints the result of a test case                             ;;
        ;; ------------------------------------------------------------- ;;
print   PROC
        PSHR    R5                ; save the return address on the stack
        MVII    #4,     R1        ; R1 = number of digits
        MOVR    R3,     R4        ; R4 = backtab pointer
        ADDI    #5,     R3        ; advance by 5 characters for the next one
        PSHR    R3                ; save R3
        CLRR    R3                ; R3 = attributes (black)
        CALL    PNUM              ; invoke the EXEC routine
        PULR    R3                ; restore R3
        PULR    R7                ; return
        ENDP
        ;; ------------------------------------------------------------- ;;
        ;;  ISR                                                          ;;
        ;; ------------------------------------------------------------- ;;
isr     PROC
        MVO     R0,     $0020     ; enable display
        MVI     $0021,  R0        ; color-stack mode
        CLRR    R0
        MVO     R0,     $0030     ; no horizontal delay
        MVO     R0,     $0031     ; no vertical delay
        MVO     R0,     $0032     ; no border extension
        MVII    #$D,    R0
        MVO     R0,     $0028     ; light-blue background
        MVO     R0,     $002C     ; light-blue border
        MVO     R0,     $002C     ; light-blue border
        JR      R5                ; return from ISR
        ENDP
        ;; ------------------------------------------------------------- ;;
        ;;  our routine                                                  ;;
        ;; ------------------------------------------------------------- ;;
pSquare PROC
        CLRR    R2                ; R2 = k
        CLRR    R1                ; R1 = k(k - 1) / 2
@@loop  ADDR    R2,     R1        ; add R2 to R1
        INCR    R2                ; k++
        MOVR    R0,     R4        ; start with R4 = n
@@sub   SUBR    R1,     R4        ; subtract 2 * (k(k - 1) / 2) = k² - k
        SUBR    R1,     R4        ; from R4
        SUBR    R2,     R4        ; subtract k from R4
        BGT     @@sub             ; until R4 is less than or equal to 0
        BNEQ    @@next            ; did we reach exactly 0? ...
        MOVR    R2,     R3        ; ... yes: update R3
@@next  CMPR    R0,     R1        ; go on while R1 is less than or
        BLE     @@loop            ; equal to R0
        JR      R5                ; return
        ENDP
```
### Output
This is the output for the following test cases:
```
4, 9, 12, 13, 108, 300, 800, 900
```
[![output](https://i.stack.imgur.com/qjhnC.gif)](https://i.stack.imgur.com/qjhnC.gif)
*screenshot from [jzIntv](http://spatula-city.org/%7Eim14u2c/intv/)*
---
*1. A CP-1610 opcode is encoded with a 10-bit value (0x000 to 0x3FF), known as a 'DECLE'.*
[Answer]
# [Retina 0.8.2](https://github.com/m-ender/retina/wiki/The-Language/a950ad7d925ec9316e3e2fb2cf5d49fd15d23e3d), 26 bytes
```
.+
$*
((^1|11\2)+)\1*$
$#2
```
[Try it online!](https://tio.run/##K0otycxL/K@q4Z7wX0@bS0WLS0MjzrDG0DDGSFNbM8ZQS4VLRdno/38TLksuQyMuQ2MuQwMLAA "Retina 0.8.2 – Try It Online") Link includes test cases. Explanation:
```
.+
$*
```
Convert to unary.
```
((^1|11\2)+)
```
Find the largest square number...
```
\1*$
```
... that divides the input...
```
$#2
```
... and output its root.
Bonus 63-byte version that for an input of `√1`, `√2`, `√3`, `√4`, `√5`, `√6`, `√7`, `√8`, `√9`... outputs `1`, `√2`, `√3`, `2`, `√5`, `√6`, `√7`, `2√2`, `3`... etc. (Previous bonus version did not handle `√1` correctly.)
```
\d+
$*
r`(?=^.(\3)+)(.)\3*((1$|11\4)+)
$#4$2$#1
\D1$
^1(\D)
$1
```
[Try it online!](https://tio.run/##K0otycxL/K@q4Z7wPyZFm0tFi6soQcPeNk5PI8ZYU1tTQ08zxlhLQ8NQpcbQMMYEKMKlomyiYqSibMgV42KowsUVZ6gR4wIUNfz//1HHLEMuIGECIixBhKERmDQGkwYWAA "Retina 0.8.2 – Try It Online")
[Answer]
# [Python 2](https://docs.python.org/2/), 37 bytes
```
n=i=input()
while n%i**2:i-=1
print i
```
[Try it online!](https://tio.run/##JcpbCoAgEAXQ/7sKEYIKgsbegqsJwYGYJIxq9Ub0fU58UtjF5Cvw5hVZf/tVa53FsWOJZyor/CYF17Wx3DhCPFiS4vxNgkGHHgNGTJixgFoQgcwL "Python 2 – Try It Online")
**38 bytes**
```
lambda n:sum(x*x%n<1for x in range(n))
```
[Try it online!](https://tio.run/##DclBDoIwEAXQ/T/FbExaV04FFZCbuCmBShMYmlJiPX31bV/4pnkTU1z/Kotdh9GStPuxqnzOJ3my2yJl8kLRyntSonX5zH6ZiFvpvYQjKd2F6CWR@29hGFxRocYNdzzQgC9gBpsf "Python 2 – Try It Online")
Based on the solution of [my pronoun is monicareinstate](https://codegolf.stackexchange.com/a/206877/20260), counting the number of solutions to \$x^2 \equiv 0 \ (\mathbb{mod}\ n)\$ for \$x\$ from \$0\$ to \$n-1\$.
[Answer]
# [Haskell](https://www.haskell.org/), 30 bytes
```
f n=sum[0^mod(x^2)n|x<-[1..n]]
```
[Try it online!](https://tio.run/##y0gszk7Nyfn/P00hz7a4NDfaIC43P0WjIs5IM6@mwkY32lBPLy829n9uYmaegq1CQVFmXomCikJuYoFCmgJI0tAo9v@/5LScxPTi/7rJBQUA "Haskell – Try It Online")
Based on the solution of [my pronoun is monicareinstate](https://codegolf.stackexchange.com/a/206877/20260), counting the number of solutions to \$x^2 \equiv 0 \ (\mathbb{mod}\ n)\$ using the range from 1 to n.
# [Haskell](https://www.haskell.org/), 32 bytes
```
f n=until((<1).mod n.(^2))pred n
```
[Try it online!](https://tio.run/##DcYxDoAgDADAr3RwgEESmOUlRpMGQYlQG8HvW73pDmxnLEUkAfmHei5KTVabem1ARq1Oa77jf6mYCTzwnanDABUZEszWGOsWeUMquDcZA/MH "Haskell – Try It Online")
Start with `n` and repeatedly take the `pred`ecessor, `until` it satiafies this condition: when we square it and take the original `n` modulo it, the result is less than 1, that is equal to 0.
[Answer]
# [C (gcc)](https://gcc.gnu.org/), ~~44~~ ~~33~~ 32 bytes
```
i;f(n){for(i=n;n%(--i*i););n=i;}
```
[Try it online!](https://tio.run/##XZBha4MwEIa/@ysOi5C0cau6jpXUfhn7FVNGMXE92M5i3JCJv92d1o52gYTL3fO@uVwRvhfFMKAuBcmurGqBKWkKRBjiEqWWmlLU/bBAKj6@jIWdawxWd8e9h9TA5wFJfFdopNd5wKs4Huol1K85pND5WfsSZ@32mffGV3B9T/xeT4rRprGueaOz6EFtVRSrKFHR@umKse3Jto01EwVdrBLFlHqcEW4dxMghGdsystZzuAOHP7YqxcVB3s8JxqWG1WriJJx/cHmP2GPua6rn@qbsuDzO7DZrOfvX6H/ZqWakFH5gINwDn4HLiMdCCpzimbElq/PZsvf64Rc "C (gcc) – Try It Online")
[Answer]
# [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), 13 bytes
```
√#/._^_:>1&
```
[Try it online!](https://tio.run/##y00syUjNTSzJTE78n2b7/1HHLGV9vfi4eCs7Q7X/AUWZeSXRyrp2aQ7KsWp1wcmJeXXVXCY6CpY6CoZGQGwMxAYWQL6phbmhpTFX7X8A "Wolfram Language (Mathematica) – Try It Online")
For an integer argument, `√` (`Sqrt`) returns in the desired `a√b` form (unless the argument was a perfect square).
Then, `/._^_:>1` matches `Power` expressions and replaces them with 1. As `a√b` expands to `Times[a,Power[b,1/2]]`, it becomes `Times[a,1]=a`.
[Answer]
# [Pari/GP](http://pari.math.u-bordeaux.fr/), 15 bytes
```
n->core(n,1)[2]
```
Yes, there is a build-in.
> 
> `core(n,{flag=0})`: unique squarefree integer `d` dividing `n` such that `n/d` is a square. If (optional) flag is non-null, output the two-component row vector
> `[d,f]`, where `d` is the unique squarefree integer dividing `n` such that `n/d=f^2` is a square.
> 
> 
> 
[Try it online!](https://tio.run/##K0gsytRNL/ifpmCr8D9P1y45vyhVI0/HUDPaKPZ/YkFBTqVGnoKunUJBUWZeCZCpBOIoKaRp5Glq6ihEm@goWOooGBoBsXGs5n8A "Pari/GP – Try It Online")
[Answer]
# Java 10, ~~43~~ 40 bytes
```
n->{for(var c=n++;c/--n%n>0;);return n;}
```
Inspired by [*@Arnauld*'s JavaScript answer](https://codegolf.stackexchange.com/a/206856/52210), so make sure to upvote him!
[Try it online.](https://tio.run/##LY7BbsIwDIbvPMUvJKRETbt1IKQRwRvAhSPjkKUBhRUXpW6nqeqzdyn0YtmW/8/fzbQmvRU/gy1NXWNvPHUzwBO7cDHW4TCOQFE136WDFVNDUsd9P4ulZsPe4gDCdqB0112qIFoTYLeUJNq@pSktaPeupQ6Om0Ag3Q96jD4iK0YnQlv5AvdoII4cPF1PZxj5ej8ioxM8NiD3O/qdzl2uVupT5R8qX6rlupfPU@D4V7O7Z1XD2SNyuCThk/nmi@cJZVZ4Obn3wz8)
**Explanation:**
```
n->{                // Method with double as both parameter and return-type
  for(var c=n       //  Create a copy `c` of the input `n`
             ++     //  Then increase `n` by 1
      ;             //  Continue looping as long as:
       c/--n        //   (decrease `n` by 1 first before every iteration with `--n`)
                    //   `c` divided by `n`
            %n>0;)  //   is NOT a multiply of `n` nor 0
  ;return n;}       //  After the loop: return the modified `n` as result
```
[Answer]
# [R](https://www.r-project.org/), ~~44~~ (crossed-out) ~~36~~ ~~33~~ ~~32~~ 30 bytes
```
((n=scan()):1)[!n%%(n:1)^2][1]
```
[Try it online!](https://tio.run/##K/r/X0Mjz7Y4OTFPQ1PTylAzWjFPVVUjD8iKM4qNNoz9b2hgwfUfAA "R – Try It Online")
Or, a completely-different [25 byte](https://tio.run/##K/r/v7g0V0NRw9BKI8@2ODkxT0NTUzPOSFU1T/O/oYEF138A) approach based on equivalence to 'number of solutions to x^2==0(mod n)' (as pointed-out by [my pronoun is monicareinstate](https://codegolf.stackexchange.com/questions/206853/find-the-perfect-square/206877#206877)), but that wasn't my own idea and hence seems to me to be cheating:
`sum(!(1:(n=scan()))^2%%n)`
[Answer]
# [CJam](https://sourceforge.net/projects/cjam/), 15 bytes
```
q~_{_*1$%!},,\;
```
[Try it online!](http://cjam.aditsu.net/#code=r~_%7B_*1%24%25!%7D%2C%2C%5C%3B&input=135)
Uses the new method in [Kevin Cruijssen](https://codegolf.stackexchange.com/users/52210/kevin-cruijssen)'s [05AB1E answer](https://codegolf.stackexchange.com/a/206857/58707).
---
**[CJam](https://sourceforge.net/projects/cjam/), 21 bytes**  
*This is my old approach to the problem, pre-[Kevin Cruijssen](https://codegolf.stackexchange.com/users/52210/kevin-cruijssen)'s new method which I don't understand*
```
q~mF{[~2/]}%{~#}%{*}*
```
[Try it online!](http://cjam.aditsu.net/#code=q~mF%7B%5B~2%2F%5D%7D%25%7B~%23%7D%25%7B*%7D*&input=675)
---
*Explanation*
```
q~                     Translate input into a CJam object (allows for easier testing)
  mF                   Factorise with exponents
    {     }%           For each factor
      ~2/              Halve the exponent [and round down]
     [   ]             Capture the base & exponent in an array
            {  }%      For each transformed factor
             ~#        Expand the base and exponent into b^e
                 {*}*  Multiply all the transformed factors together
```
This approach removes all single factors (those that would make up the radical part) whilst halving the paired factors (equivalent to square rooting the integer part).
---
**[CJam](https://sourceforge.net/projects/cjam/), 23 bytes**  
*A CJam port of [Kevin Cruijssen](https://codegolf.stackexchange.com/users/52210/kevin-cruijssen)'s [05AB1E answer](https://codegolf.stackexchange.com/a/206857/58707)*
```
q~_,(;{_*1$\%0>!},\;)\;
```
[Try it online!](http://cjam.aditsu.net/#code=q~_%2C(%3B%7B_*1%24%5C%250%3E!%7D%2C%5C%3B)%5C%3B&input=675)
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), ~~15~~ 12 bytes
Now based on @someone's formula.
```
ＮθＩＬΦθ¬﹪×ιιθ
```
[Try it online!](https://tio.run/##S85ILErOT8z5/98zr6C0xK80Nym1SKNQ05oroCgzr0TDObG4RMMnNS@9JEPDLTOnBCSpo@CXX6Lhm59SmpOvEZKZm1qskamjkKmpo1CoCQbW//8bGv3XLcsBAA "Charcoal – Try It Online") Link is to verbose version of code. For each number from `0` to the input, calculates whether its square is divisible by the input, and takes the number of matches.
Alternative version, also 12 bytes:
```
ＮθＩΣＥθ¬﹪×ιιθ
```
[Try it online!](https://tio.run/##FcG7CoAgFADQva9wvIINtTo2NShB/YCZkOC7a79/o3PsbZrNJhCtqXTUPZ6uQeVy2JpPCIt5EPYeQZkCVTCdEVS@eshw@Oge8IJ5LljlP0k0zTS@4QM "Charcoal – Try It Online") Link is to verbose version of code. For each number from `0` to the input, calculates whether its square is divisible by the input, and takes the sum of the results.
Alternative version, also 12 bytes:
```
ＮθＩ№Ｅθ﹪×ιιθ⁰
```
[Try it online!](https://tio.run/##S85ILErOT8z5/98zr6C0xK80Nym1SKNQ05oroCgzr0TDObEYSOSXApm@iQUahToKvvkppTn5GiGZuanFGpk6CpmaOgqFmkDCQFNT0/r/f0Oj/7plOQA "Charcoal – Try It Online") Link is to verbose version of code. For each number from `0` to the input, calculates the remainder when its square is divisible by the input, and counts the number of zeros.
[Answer]
# [Pyth](https://github.com/isaacg1/pyth), 9 bytes
```
ef!%Q^T2S
```
[Try it online!](https://tio.run/##K6gsyfj/PzVNUTUwLsQo@P9/S0sA "Pyth – Try It Online")
```
ef!%Q^T2S   
        S   Create range from 1 to (implicit) input
 f          Filter keep from the above, as T, where:
     ^T2      Square T
   %Q         Mod the input with the above
  !           Logical NOT
e           Take the last (largest) element of the filtered list, implicit print
```
[Answer]
# perl -MList::Util=max -pl, 34 bytes
```
$n=$_;$_=max grep!($n%$_**2),1..$n
```
[Try it online!](https://tio.run/##K0gtyjH9/18lz1Yl3lol3jY3sUIhvSi1QFFDJU9VJV5Ly0hTx1BPTyXv/38TLksuQyMuQ2MuE4t/@QUlmfl5xf91fX0yi0usrEJLMnNAmv/rFuQAAA "Perl 5 – Try It Online")
This finds the largest square which properly divides the input number. Very inefficient as it tries all numbers from 1 up to the input.
[Answer]
# [Ruby](https://www.ruby-lang.org/), 29 bytes
```
->n,x=n{x-=1while n%x**2>0;x}
```
[Try it online!](https://tio.run/##KypNqvyfZvtf1y5Pp8I2r7pC19awPCMzJ1UhT7VCS8vIzsC6ovZ/tImOpY6hkY6hsY6hgYWOYaxeamJyRnVNXo1CgUa1Qp6CrZ1CWnRerEKtpkLtfwA "Ruby – Try It Online")
[Answer]
# [J](http://jsoftware.com/), 12 bytes
```
1#.0=[|2^~i.
```
[Try it online!](https://tio.run/##y/qvpKeepmBrpaCuoKNgoGAFxLp6Cs5BPm7/DZX1DGyja4zi6jL1/mv@T1Mw4UpTsFQAEoZGIMIYzDSwAAA "J – Try It Online")
[Answer]
# [Arn](https://github.com/ZippyMagician/Arn), [~~12~~ 10 bytes](https://github.com/ZippyMagician/Arn/wiki/Carn)
```
·£æ9Š3nòy├
```
[Try it!](https://zippymagician.github.io/Arn?code=K3Z7ISh2XjIlfVx+&input=NAo5CjEyCjEzCjEwOA==)
# Explained
Unpacked: `+v{!(v^2%}\~`
Uses the formula from the [OEIS](https://oeis.org/A000188) page: the number of solutions to \$x^2≡0 (\mod n)\$
```
              ~     1-range (inclusive) to
                _   variable initialized to STDIN; implied
            +\      folded with addition after
v{                  mapping with block (key of v)
  !                 Boolean NOT
    (               Begin expression
          v         
        ^           exponentiated by
          2         two 
      %             mod
        _           implied
    )               End expression; implied
}                   End block
```
[Answer]
# [Husk](https://github.com/barbuz/Husk), 9 bytes
-1 byte thanks to [Razetime](https://codegolf.stackexchange.com/users/80214/razetime)!
```
▲fo¬%1m√Ḋ
```
[Try it online!](https://tio.run/##yygtzv7//9G0TWn5h9aoGuY@6pj1cEfX////LQE "Husk – Try It Online") or [Try all cases!](https://tio.run/##ASgA1/9odXNr/23igoH/4payZm/CrCUxbeKImuG4iv///1s0LDksMTIsMTNd)
### Commented
```
▲          -- the maximum of ...
 fo        -- ... filter on the next two functions composed
   ¬       --     - boolean negate / (== 0)
    %1     --     - modulo 1
      m√   -- ... map square root on ...
        Ḋ  -- ... the list of divisors
```
[Answer]
# [Whitespace](https://web.archive.org/web/20150618184706/http://compsoc.dur.ac.uk/whitespace/tutorial.php), 71 bytes
```
[S S S N
_Push_0][S N
S _Duplicate_0][T   N
T   T   _STDIN_as_integer][T    T   T   _Retrieve_input][S N
S _n=Duplicate_input][N
S S N
_Create_Label_LOOP][S T S S T   N
_Copy_0-based_1st_input][S T    S S T   N
_Copy_0-based_1st_n][S N
S _Duplicate_n][T   S S N
_Multiply][T    S T T   _Modulo][N
T   S S N
_If_0_Jump_to_Label_PRINT_RESULT][S S S T   N
_Push_1][T  S S T   _Subtract][N
S N
N
_Jump_to_Label_LOOP][N
S S S N
_Create_Label_PRINT_RESULT][T   N
S T _Print_as_integer]
```
Letters `S` (space), `T` (tab), and `N` (new-line) added as highlighting only.  
`[..._some_action]` added as explanation only.
[Try it online](https://tio.run/##K8/ILEktLkhMTv3/X0FBgQsIObk4QQDMBnEVgCJQEkxzcSpwAtWA5ECCUBkuEI8LpPL/f0MjAA) (with raw spaces, tabs and new-lines only).
Port of [*@Sok*'s Pyth answer](https://codegolf.stackexchange.com/a/206862/52210), so make sure to upvote him! Whitespace doesn't have decimals, so his/her approach is ideal for Whitespace since it doesn't use square-root nor regular division, but only integers.
**Explanation in pseudo-code:**
```
Integer n = STDIN as integer
Integer r = n
Start LOOP:
  Integer s = r * r
  If(n % s == 0):
    Jump to Label PRINT
  r = r - 1
  Go to next iteration of LOOP
Label PRINT:
  Print r as integer to STDOUT
  (implicitly stop the program with an error: no exit defined)
```
[Answer]
# [bc](https://www.gnu.org/software/bc/manual/html_mono/bc.html), 52 bytes
```
define f(n){for(i=n;i--;){if(!(n%(i*i))){return i}}}
```
[Try it online!](https://tio.run/##HcQxCoAwDAXQvaeog/AjdFA7KMXLqA1kiVB0Kj17RN/w9sPszCyaPUOp8lUgmyYJIVEVRgftIYMQUS35fop6aa2ZMSI5xvo1Tv/zd1zIvQ "bc – Try It Online")
[Answer]
# [MathGolf](https://github.com/maxbergmark/mathgolf/blob/master/math_golf.txt), 5 [bytes](https://github.com/maxbergmark/mathgolf/blob/master/code_page.py)
```
╒²k÷Σ
```
Port of [my 5-byter 05AB1E answer](https://codegolf.stackexchange.com/a/206857/52210).
[Try it online.](https://tio.run/##y00syUjPz0n7///R1EmHNmUf3n5u8f//hlxGXCZcllyGRlyGxlzGZlyGBhYA)
**Explanation:**
```
╒      # Push a list in the range [1, (implicit) input]
       # (could alternatively be `r` for a range [0, input) )
 ²     # Square each value in this list
  k÷   # Check which values are evenly divisible by the input (1 if truthy; 0 if falsey)
    Σ  # And sum those checks
       # (after which the entire stack joined together is output implicitly as result)
```
[Answer]
# APL(NARS), 23 chars, 46 bytes
```
{√⍵÷×/(∪a)/⍨2∣≢¨⊂⍨a←π⍵}
```
test:
```
  f←{√⍵÷×/(∪a)/⍨2∣≢¨⊂⍨a←π⍵}
  f 4
2
  f 9
3
  f 12
2
  f 13
1
  f 108
6
  f 2×2×2×2×2×3×3
12
```
comment:
```
{√⍵÷×/(∪a)/⍨2∣≢¨⊂⍨a←π⍵}
                    π⍵  factor argument
                  a←    save that in a list "a" of prime factors
                ⊂⍨      partition "a" in a list of list each element is ugual factors found
            2∣≢¨        to each element of list of list find if number of elements is odd
    ×/(∪a)/⍨           so choice in ∪a the elements appear in list of list as odd and multiple them
  ⍵÷                   divide the argument for the number of factor contained odd times
 √                     make sqrt of that
  
```
[Answer]
# [Retina](https://github.com/m-ender/retina/wiki), ~~123~~ 72 bytes
```
.+                        We convert the input into unary
$&*_ $&*_                 and create a copy for factor checking
{` (_+)                   START LOOP: We square the input by multiplying
$& $.1*$1                 its string representation by its length
(?=^.* (_+) (_+))\2+ .+   We check if the square is a factor of the input
$.1                       if so we replace the whole text with the current counter
 (_*)_.*                  Otherwise we decrement the counter by one
 $1                       ---
-- IMPLICIT LOOP END --
-- IMPLICIT OUTPUT --
```
[Try it online!](https://tio.run/##K0otycxLNPz/X0@bS0VNK14BRHBVJyhoxGtrAkUUVPQMtVQMuTTsbeP0tMCiYEIzxkhbAaRHz5ALKKClGa@nxaWgYqjw/7@hEQA)
---
This approach is essentially a port of [Kevin Cruijssen](https://codegolf.stackexchange.com/users/52210/kevin-cruijssen)'s [05AB1E answer](https://codegolf.stackexchange.com/a/206857/58707).  
It checks all the numbers from the input downwards until it finds a number whose square divides the original.
---
*-51 bytes*: Many thanks to [Neil](https://codegolf.stackexchange.com/users/17602/neil), whose suggestion helped me to cut off a ridiculous amount of code.
I've also switched from separating with newlines to separating with spaces because `.` is anti-newline.
[Answer]
# TI-Basic, 16 bytes
```
sum(not(fPart(seq(I²/Ans,I,1,Ans-1
```
Port of [this answer](https://codegolf.stackexchange.com/questions/206853/find-the-perfect-square/206877#206877). Takes input in `Ans`. Output is stored in `Ans` and is displayed.
]