We're on Discord! Please join our server now if you don't want to miss anything! (More info) | Join the UCC4 contest! (More info)

* WalrusIRC

You need to have 5 posts and not be part of restricted usergroups in order to use the WalrusIRC embedded shoutbox. However, you can also access our IRC channel called #CodeWalrus via EFnet.

Author Topic: OEIS golfing!  (Read 490 times)

0 Members and 2 Guests are viewing this topic.

Offline _iPhoenix_

  • Custom title
  • Super User
  • Join Date: Mar 2017
  • Location: Location
  • Posts: 650
  • Post Rating Ratio: +16/-1
  • ███████ ▼ ♪ Best music ♫
    • @dj_iPhoenix
    • @UCytgMNPxAMDsxjimvxHf01w
    • Legend-of-iPhoenix
    • @the-legend-of-iphoenix
    • My website.
  • Gender: Male
Re: OEIS golfing!
« on: June 17, 2018, 01:11:38 am »
Python 3, A005131, 53 bytes
Code: [Select]
f=lambda n:[2*~-i//3if 1==i%3else 1for i in range(n)]Defines a function, f, that returns an array of integers. Call with f(n), with n being your input.

(We don't need to stick to JS :) )
  • Calculators owned: A sentient TI-84+ CE, TI-85
  • Consoles, mobile devices and vintage computers owned: TI-99/4a home computer
Please spam here: https://legend-of-iphoenix.github.io/spam/

"walruses are better than tuxedo chickens, all hail the great :walrii:" ~ me
Evolution of my avatar:

 


You can also use the following HTML or bulletin board code to share it on your page or forum signature!


Also do not forget to check our affiliates below.
Planet Casio TI-Planet Calc.news BroniesQC BosaikNet Velocity Games