C Archives

TWC 149: Limited Fibs, and Bases of Unusual Size

(Currently editing)

In which we see that you don't need all the Fibs, and have trouble turning 21.

TWC Task #1 - Fibonacci Digit Sum

Given an input $N, generate the first $N numbers for which the sum of their digits is a Fibonacci number.

(i.e. Generate OEIS A028840)

Observations:

Raku

Perl

C

TWC Task #2 - Largest Square

(i.e. Generate OEIS A287298)

Given a number base, derive the largest perfect square with no repeated digits and return it as a string. (For base>10, use ‘A’..‘Z’.)

Observations:

Raku

Perl

C

About Bruce Gray

user-pic "Util" on IRC and PerlMonks. Frequent speaker on Perl and Raku, but infrequent blogger.