ChallengeR #3

Votre dernière mission consistait à compter le nombre de chiffres pairs du vecteur x avec le moins de code possible (étant bien entendu que les espaces, les indentations et les retours à la ligne ne sont pas comptés comme des caractères).

x <- sample(0:9, 100, TRUE)

La meilleure réponse possible était :

sum(! x %% 2)

... et vous êtes 14 à l'avoir trouvée. Dans l'ordre d'arrivée : @thedudeparis, @_antoineb, @_pvictorr, @davidgohel, @loicmolinari, @AlekVladNevski @privefl, @basiliximAb @dickoah, @ClementinC @StephaneOrlins, @claramorganexxx (ahem..), @francois_ls et @After_Eight. Bravo à toutes et à tous !

Comme vous êtes bons, on va augmenter la difficulté. Votre mission, si vous l'acceptez, consiste à coder une fonction syracuse qui renvoie la suite de Syracuse de n'importe quel entier x jusqu'à ce qu'elle atteigne 1. En d'autres termes, nous cherchons une fonction de type :

syracuse = function(x) {
 # faire quelque chose...
}

De telle sorte que :

> syracuse(42)
[1] 42 21 64 32 16  8  4  2  1

Mais comme ça, c'est trop facile, vous allez faire ça sans boucle (ni for ni while ni repeat !).

34 commentaires:

  1. It reveals how nicely you perceive this subject.

    RépondreSupprimer
  2. Bookmarked this website page, will come back for extra articles.

    RépondreSupprimer
  3. Rattling wonderful visual appeal on this web site, I’d value it 10 over 10.

    RépondreSupprimer
  4. Thanks for your marvelous posting! I certainly enjoyed reading this article... MM

    RépondreSupprimer
  5. Wonderful article. It's very useful. I think it's one of the most informative Websites... MM

    RépondreSupprimer
  6. I have taken this blog that written very well. I like you. I'll support you... MM

    RépondreSupprimer
  7. Such a valuable post. I like it very much, Love your skills in writing Thanks... MM

    RépondreSupprimer
  8. I found so many interesting stuff in this blog. Really its great article. Keep it up... MM

    RépondreSupprimer

  9. I am happy to find this way of writing the post. Thank you for this useful info

    RépondreSupprimer


  10. Really amazed with your writing talent. Thanks for sharing, Love your works

    RépondreSupprimer


  11. It’s really a cool and useful piece of info.

    RépondreSupprimer


  12. Wow, happy to see this awesome post. Thanks for sharing a great information

    RépondreSupprimer

  13. Pretty! This has been an extremely wonderful post. Thank you for supplying this info.

    RépondreSupprimer
  14. This article is super helpful for parents struggling to keep toddlers engaged!..YY

    RépondreSupprimer
  15. Thank you for always writing good things..YY

    RépondreSupprimer
  16. It was a great show , really enjoyed it..YY

    RépondreSupprimer
  17. Thanks for sharing your info. I really appreciate your efforts..YY

    RépondreSupprimer

  18. I am waiting for your next post thanks once again..YY

    RépondreSupprimer
  19. I’d be very grateful if you could elaborate a little bit more. Kudos!..YY

    RépondreSupprimer
  20. Great points you made there in your article. Thanks for all your help in making a change in the world..YY

    RépondreSupprimer

  21. Good blog information. I am impress with your writing skill. Thank you for this

    RépondreSupprimer


  22. I am always searching this type of blog post. I hope I will see this again soon.

    RépondreSupprimer

  23. Very interesting to read this blog. I enjoy your work! Its wonderful, Thanks for this.

    RépondreSupprimer

  24. Wow It is a great contents that I ever seen

    RépondreSupprimer
  25. Hello. fantastic work. I didn't anticipate this. This is an amazing tale. Thanks!..YY

    RépondreSupprimer
  26. Hello. fantastic work. I didn't anticipate this. This is an amazing tale. Thanks!..YY

    RépondreSupprimer
  27. Hi there, You have done an excellent job. I will certainly digg it and personally suggest to my friends..YY

    RépondreSupprimer
  28. This is really helpful post and very informative there is no doubt about it..YY

    RépondreSupprimer
  29. Write more high-quality articles. I support you..YY

    RépondreSupprimer
  30. Thanks for sharing with us this important Content.

    RépondreSupprimer
  31. I feel strongly about it and really enjoyed learning more about this topic..YY

    RépondreSupprimer
  32. Keep up the good writing. please visit our beautiful website, spread the love, thankyou!..YY

    RépondreSupprimer
  33. Fantastic website Lots of useful information here..YY

    RépondreSupprimer

Votre mot de passe

On ne va pas épiloguer pendant 150 ans, vous avez besoin : De mots de passe très forts (à partir de 128 bits), un par site (sauf, éventuel...