Taking the square root of the first element of a list

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
3
down vote

favorite












If I have a list for example :



 4,1,9,2,16,3,25,4


Is there a command that replaces the first element by its square root and returns a list ? In the example above it would return :



 2,1,3,2,4,3,5,4


(Obviously the list above is short and easy to manipulate, but I'm asking a question for a longer and more complicated one)










share|improve this question

























    up vote
    3
    down vote

    favorite












    If I have a list for example :



     4,1,9,2,16,3,25,4


    Is there a command that replaces the first element by its square root and returns a list ? In the example above it would return :



     2,1,3,2,4,3,5,4


    (Obviously the list above is short and easy to manipulate, but I'm asking a question for a longer and more complicated one)










    share|improve this question























      up vote
      3
      down vote

      favorite









      up vote
      3
      down vote

      favorite











      If I have a list for example :



       4,1,9,2,16,3,25,4


      Is there a command that replaces the first element by its square root and returns a list ? In the example above it would return :



       2,1,3,2,4,3,5,4


      (Obviously the list above is short and easy to manipulate, but I'm asking a question for a longer and more complicated one)










      share|improve this question













      If I have a list for example :



       4,1,9,2,16,3,25,4


      Is there a command that replaces the first element by its square root and returns a list ? In the example above it would return :



       2,1,3,2,4,3,5,4


      (Obviously the list above is short and easy to manipulate, but I'm asking a question for a longer and more complicated one)







      list-manipulation






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 1 hour ago









      J.A

      794




      794




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          3
          down vote













          MapAt[Sqrt, 4, 1, 9, 2, 16, 3, 25, 4, All, 1]



          2, 1, 3, 2, 4, 3, 5, 4







          share|improve this answer




















            Your Answer




            StackExchange.ifUsing("editor", function ()
            return StackExchange.using("mathjaxEditing", function ()
            StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
            StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
            );
            );
            , "mathjax-editing");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "387"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: false,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f183185%2ftaking-the-square-root-of-the-first-element-of-a-list%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            3
            down vote













            MapAt[Sqrt, 4, 1, 9, 2, 16, 3, 25, 4, All, 1]



            2, 1, 3, 2, 4, 3, 5, 4







            share|improve this answer
























              up vote
              3
              down vote













              MapAt[Sqrt, 4, 1, 9, 2, 16, 3, 25, 4, All, 1]



              2, 1, 3, 2, 4, 3, 5, 4







              share|improve this answer






















                up vote
                3
                down vote










                up vote
                3
                down vote









                MapAt[Sqrt, 4, 1, 9, 2, 16, 3, 25, 4, All, 1]



                2, 1, 3, 2, 4, 3, 5, 4







                share|improve this answer












                MapAt[Sqrt, 4, 1, 9, 2, 16, 3, 25, 4, All, 1]



                2, 1, 3, 2, 4, 3, 5, 4








                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 1 hour ago









                Henrik Schumacher

                40.8k258122




                40.8k258122



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f183185%2ftaking-the-square-root-of-the-first-element-of-a-list%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Comments

                    Popular posts from this blog

                    Long meetings (6-7 hours a day): Being “babysat” by supervisor

                    What does second last employer means? [closed]

                    One-line joke