This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Sieve of Eratosthenes: | |
// https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes | |
#include <stdio.h> | |
#include <stdlib.h> | |
// https://github.com/tapio/rlutil | |
#include "rlutil.h" | |
int N, *numbers, nrOfDigits; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# Look-and-say sequence: https://en.wikipedia.org/wiki/Look-and-say_sequence | |
num = int(input("Enter nth term: ")) | |
i = 0 | |
while i < num: | |
if i == 0: | |
series = [1] | |
else: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* The following description is from Linux Programmer's Manual (strtok(3)): | |
* | |
* #include <string.h> | |
* char *strtok(char *str, const char *delim); | |
* | |
* The strtok() function breaks a string into a sequence of zero or more | |
* nonempty tokens. On the first call to strtok() the string to be parsed | |
* should be specified in str. In each subsequent call that should parse | |
* the same string, str must be NULL. |