DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Code Golf: Fibonacci's Sequence

John Walter user avatar by
John Walter
·
Feb. 13, 15 · Interview
Like (0)
Save
Tweet
Share
28.20K Views

Join the DZone community and get the full member experience.

Join For Free

When it comes to ingenuity, Code Golf is my absolute favorite thing in the developer space. Code Golf, like the game of golf, is an exercise in brevity - the fewest lines of code and the smaller the file size, the better. It requires creativity, knowledge of your craft, and perseverance.

So in order to showcase the brightest members of our community, DZone will be holding a weekly Code Golf competition.

What's in it for you? The winner every week will receive some awesome DZone swag!

In order to submit your entry, you'll need to leave a comment with your code (using the code feature), as well as what language you used.

So, let's get started!

This week's challenge:

You'll need to output Fibonacci's sequence to the 30th factor. Your output should look something like this:

1     :     1
2     :     1
3     :     2
...
30    :     832040

Your output must include all 30 numbers (1-30 and their equivalent Fibonacci number).

The code with the fewest characters (excluding whitespace) will be the winner! You must submit your code by Tuesday, February 17.

Sound like something you can handle? We'd like to see you try.

Happy coding!

We have a winner! Milan Pavlović made several submissions (and helped to improve others' submissions as well), and will receive a DZone Swag Pack! Stay tuned for next week's challenge!

code style

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • The Importance of Delegation in Management Teams
  • RabbitMQ vs. Memphis.dev
  • The Data Leakage Nightmare in AI
  • The Future of Cloud Engineering Evolves

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: