Bobinas P4G
  • Login
  • Public

    • Public
    • Groups
    • Popular
    • People

Conversation

Notices

  1. La Fée Verte (absinthe@qoto.org)'s status on Sunday, 24-Nov-2019 17:43:14 UTC La Fée Verte La Fée Verte

    #toyprogrammingchallenge

    Okay, here is a fun one. We've all seen Fibonacci sequences. But they are all played out. Let's look at a different sequence. They are called Hamming Numbers after Richard Hamming, who proposed the problem of finding computer algorithms for generating these numbers in ascending order.

    For number H is equal to 2**i * 3**j * 2**k where i,k,k are all non negative.

    For example
    2**0 * 3**0 * 5**0 = 1
    2**1 * 3**0 * 5**0 = 2
    2**0 * 3**1 * 5**0 = 3
    2**2 * 3**0 * 5**0 = 4
    2**0 * 3**0 * 5**1 = 5
    2**2 * 3**1 * 5**0 = 6
    2**3 * 3**0 * 5**0 = 8

    So hopefully that explains what the sequence looks like. Your challenge, if you choose to accept it is to generate the first 25 of them. An arbitrary nth one such as 1700th. And given a number X determine if it is or is not a valid hamming number.

    Here is the wiki article on them:

    https://en.wikipedia.org/wiki/Regular_number

    In conversation Sunday, 24-Nov-2019 17:43:14 UTC from qoto.org permalink
    • 🎓 Dr. Freemo :jpf: 🇳🇱 repeated this.
    • La Fée Verte (absinthe@qoto.org)'s status on Monday, 25-Nov-2019 19:35:22 UTC La Fée Verte La Fée Verte
      in reply to

      https://git.qoto.org/Absinthe/hamming

      In conversation Monday, 25-Nov-2019 19:35:22 UTC permalink

      Attachments

      1. La Fée Verte / hamming
        GitLab Enterprise Edition
      🎓 Dr. Freemo :jpf: 🇳🇱 repeated this.

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • Privacy
  • Source
  • Version
  • Contact

Bobinas P4G is a social network. It runs on GNU social, version 2.0.1-beta0, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All Bobinas P4G content and data are available under the Creative Commons Attribution 3.0 license.