-
Notifications
You must be signed in to change notification settings - Fork 6
Sequences
Ilkka Törmä edited this page Feb 11, 2018
·
2 revisions
This page documents the built-in numeric sequences of Husk.
They are accessed by İ
followed by another character from the following list, e.g. İf
for the Fibonacci numbers.
Char | Description | Sequence |
---|---|---|
½ |
Powers of 1/2 | [1/2,1/4,1/8,1/16,1/32,1/64,1/128,1/256,... |
↕ |
Palindromes in base 2 | [1,3,5,7,9,15,17,21,27,31,33,45,... |
↔ |
Palindromes in base 10 | [1,2,3,4,5,6,7,8,9,11,22,33,... |
± |
Positive and negative integers | [1,-1,2,-2,3,-3,4,-4,5,-5,6,-6,7,-7,... |
¬ |
Alternating bits | [1,0,1,0,1,0,1,0,1,0,... |
\ |
Reciprocals of positive integers | [1,1/2,1/3,1/4,1/5,1/6,1/7,1/8,1/9,1/10,... |
- |
Negative integers | [-1,-2,-3,-4,-5,-6,-7,-8,-9,-10,... |
0 |
Even positive integers | [2,4,6,8,10,12,14,16,18,20,... |
1 |
Odd positive integers | [1,3,5,7,9,11,13,15,17,19,... |
2 |
Powers of 2 | [2,4,8,16,32,64,128,256,512,1024,2048,... |
3 |
Powers of 3 | [3,9,27,81,243,729,2187,6561,19683,59049,... |
5 |
Powers of 5 | [5,25,125,625,3125,15625,78125,390625,1953125,... |
7 |
Powers of 7 | [7,49,343,2401,16807,117649,823543,5764801,... |
Z |
All integers | [0,1,-1,2,-2,3,-3,4,-4,5,-5,6,-6,7,-7,... |
_ |
Powers of -1 | [-1,1,-1,1,-1,1,-1,1,-1,1,.. |
f |
Fibonacci numbers | [1,1,2,3,5,8,13,21,34,55,89,144,... |
p |
Prime numbers | [2,3,5,7,11,13,17,19,23,29,31,37,41,... |
r |
Ruler sequence | [0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,... |
₅ |
1, 2, 5 and their multiples by 10 | [1,2,5,10,20,50,100,200,500,1000,2000,5000,... |
π |
Digits of pi | [3,1,4,1,5,9,2,6,5,3,5,8,9,7,9,3,2,3,... |
⁰ |
Powers of 10 | [10,100,1000,10000,100000,1000000,10000000,... |
€ |
Euro coin and bill values (finite list) | [1/100,1/50,1/20,1/10,1/5,1/2,1,2,5,10,20,50,100,200,500] |
□ |
Square numbers | [1,4,9,16,25,36,49,64,81,100,121,144,169,... |