Skip, I can't find the fork in fps1

(fps 2+i.1000)-:fps1 2+i.1000
1
   
   fps1
  ┌─ ]                           
  ├─ ~ ─── #                     
  │                              
──┤     ┌─ 0                     
  │     ├─ =                     
  │     │   ┌─ [:                
  └─────┤   │     ┌─ / ─── +     
        │   ├─ " ─┴─ 1           
        └───┤                    
            │     ┌─ [:          
            │     ├─ ]           
            └─────┤     ┌─ 2     
                  │     ├─ |     
                  └─────┤   ┌─ _ 
                        └───┼─ q:
                            └─ ] 
   fps
  ┌─ ]            
  ├─ ~ ─── #      
  │               
──┤     ┌─ [:     
  │     │    ┌─ = 
  └─────┼────┴─ >.
        └─ %:     
   

Linda


-----Original Message-----
From:S Programming <[email protected]> On Behalf Of Skip 
Cave
Sent: Saturday, November 3, 2018 10:43 AM
To: [email protected]
Subject: Re: [Jprogramming] Square Roots and Extended Arithmetic

Also, there's a completely different way to attack the problem of finding 
perfect squares using the dyadic form of q: (Prime Exponents). I discovered 
this while reading NuVoc about q:

fps1 =: 13 :'y#~0=+/"1]2|_ q:y'


fps1 2+i.100

4 9 16 25 36 49 64 81 100


fps1 8200+i.1000

8281 8464 8649 8836 9025


%: 8281 8464 8649 8836 9025

91 92 93 94 95


fps1

] #~ 0 = [: +/"1 [: ] 2 | _ q: ]


The secret is: if all exponents of the prime factors of an integer are even, 
the number is a perfect square.


Skip


Skip Cave
Cave Consulting LLC
----------------------------------------------------------------------
For information about J forums see 
https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.jsoftware.com%2Fforums.htm&amp;data=02%7C01%7C%7C35400d0c8fb14573f6e308d6419ab65d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636768530066338557&amp;sdata=%2FDOtjUgVHo4A8iwxjDpF2qH0PRvtj0R0b9XThvkE15Q%3D&amp;reserved=0
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to