11<img src =" https://github.com/OpenLibMathSeq/IntegerSequences.jl/blob/master/SequencesLogo.jpg " >
22
3- [ ![ Build status] ( https://travis-ci.org/OpenLibMathSeq/IntegerSequences .jl.svg?branch=master )] ( https://travis-ci.org/OpenLibMathSeq/IntegerSequences .jl )
4- [ ![ Build status] ( https://ci.appveyor.com/api/projects/status/3qt5x8eej5kf2w98 ?svg=true )] ( https://ci.appveyor.com/project/OpenLibMathSeq/IntegerSequences. jl )
5- [ ![ Docs dev ] ( https://img.shields.io/badge/docs-dev-blue.svg )] ( https://openlibmathseq.github.io/IntegerSequences .jl/dev )
3+ [ ![ Build status] ( https://travis-ci.org/OpenLibMathSeq/Sequences .jl.svg?branch=master )] ( https://travis-ci.org/OpenLibMathSeq/Sequences .jl )
4+ [ ![ Build status] ( https://ci.appveyor.com/api/projects/status/1irsamfi66jnk71m/branch/master ?svg=true )] ( https://ci.appveyor.com/project/OpenLibMathSeq/integersequences- jl )
5+ [ ![ Docs stable ] ( https://img.shields.io/badge/docs-dev-blue.svg )] ( https://openlibmathseq.github.io/Sequences .jl/stable )
66--
77
88The package is tested against, and being developed for, Julia 1.1 and above on Linux, macOS, and Windows64.
@@ -43,26 +43,26 @@ Four of those are based on the iteration protocol `FiboIterate` which is kept in
4343The implementations are:
4444
4545* Iterate over the first `` n `` Fibonacci numbers.
46- ``` javascript
46+ ```
4747I000045(n) = FiboIterate(n)
4848```
4949
5050* Iterate over the Fibonacci numbers which do not exceed `` n `` .
51- ``` javascript
51+ ```
5252F000045(n) = takewhile(k -> k <= n, FiboIterate(n+1))
5353```
5454
5555* Return the first `` n `` Fibonacci numbers in an array.
56- ``` javascript
56+ ```
5757L000045(n) = collect(FiboIterate(n))
5858```
5959Alternatively one can use a generating function if available:
60- ``` javascript
60+ ```
6161L000045(n) = coefficients(G000045, n)
6262```
6363
6464* Return the `` n `` -th Fibonacci number.
65- ``` javascript
65+ ```
6666function V000045(n)
6767 F = ZZ[1 1; 1 0]
6868 Fn = F^n
7171```
7272
7373* Fibonacci function for real values, returns a Float64.
74- ```javascript
74+ ```
7575function R000045(x::Float64)
7676 (Base.MathConstants.golden^x - cos(x Base.MathConstants.pi)
7777 Base.MathConstants.golden^(-x)) / sqrt(5)
7878end
7979```
8080
8181* Query if `` n `` is a Fibonacci number, returns a Bool.
82- ```javascript
82+ ```
8383function is000045(n)
8484 d = 0
8585 for f in FiboIterate(n+2)
@@ -97,27 +97,27 @@ For the abundant numbers (i.e. numbers n where the sum of divisors exceeds 2n) w
9797 is005101, I005101, F005101, L005101, V005101
9898
9999* Is `` n `` an abundant number, i.e. is `` σ(n) > 2 n `` ?
100- ```javascript
100+ ```
101101is005101(n) = σ(n) > 2 n
102102```
103103
104104* Iterate over the first `` n `` abundant numbers.
105- ```javascript
105+ ```
106106I005101(n) = takefirst(isAbundant, n)
107107```
108108
109109* Iterate over the abundant numbers which do not exceed `` n `` .
110- ```javascript
110+ ```
111111F005101(n) = filter(isAbundant, 1:n)
112112```
113113
114114* Return the first `` n `` abundant numbers in an array.
115- ```javascript
115+ ```
116116L005101(n) = collect(I005101(n))
117117```
118118
119119* Return the value of the `` n `` -th abundant number.
120- ```javascript
120+ ```
121121V005101(n) = nth(I005101(n), n)
122122```
123123
@@ -136,7 +136,7 @@ that of Julia.
136136The matrix view of a number triangle of dimension dim has dim rows and the n-th row has length n.
137137Note that the rows are enumerated like the terms 0, 1, 2, ...
138138
139- ```javascript
139+ ```
140140 T(0,0) row 0
141141 T(1,0) T(1,1) row 1
142142 T(2,0) T(2,1) T(2,2) row 2
@@ -149,7 +149,7 @@ chain of lists. On the first level a triangle iterates over the rows of the
149149triangle and on the secondary level over the terms of the rows, which are
150150given by the user-supplied function t(n, k).
151151
152- ```javascript
152+ ```
153153 T = (row(0), row(1), ..., row(dim-1))
154154 Row(T, n) = [t(n, 0), t(n, 1), ..., t(n, n)]
155155```
@@ -160,7 +160,7 @@ Sequence A097805 gives the number of ordered partitions of n into k parts.
160160The corresponding triangle can be constructed like this:
161161* Triangle T097805 based of explicite value.
162162
163- ```javascript
163+ ```
164164V097805(n, k) = k == 0 ? k^n : binomial(n-1, k-1)
165165T097805(dim) = Triangle(dim, V097805)
166166```
@@ -170,7 +170,7 @@ To support this the type RecTriangle has a buffer which saves the
170170previously computed row. This buffer can be accessed through a function 'prevrow'.
171171
172172* Triangle T097805 based on recurrence.
173- ```javascript
173+ ```
174174R097805(n, k, prevrow) = k == 0 ? k^n : prevrow(k-1) + prevrow(k)
175175T097805(dim) = RecTriangle(dim, R097805)
176176```
@@ -185,20 +185,20 @@ A nice alternative for 'prevrow' is 'Tn_1' because Tn_1(k) = T(n-1, k) in matrix
185185The following functions are supplied:
186186
187187* Return the row n (0 <= n < dim) of a triangle.
188- ```javascript
188+ ```
189189Row(T::Triangle, n::Int, rev=true) = rev ? reversed(T(n)) : T(n)
190190```
191191
192192If in the call the third -- optional -- parameter ` rev ` is true the
193193row is returned in reversed order.
194194
195195* Return the triangle as a list of rows.
196- ```javascript
196+ ```
197197TriangularArray(T::Triangle) = [row for row in T]
198198```
199199
200200* Return the triangle as a list of integers.
201- ```javascript
201+ ```
202202TriangleToList(T::Triangle) = [k for row in T for k in row]
203203```
204204
@@ -207,7 +207,7 @@ returns a list of integers of length dim(dim + 1)/2. Conversely, given
207207an integer list of length n(n + 1)/2 the function ListToTriangle returns a
208208triangle as a chain of iterators.
209209
210- ```javascript
210+ ```
211211ListToTriangle(A::Array{})
212212```
213213
0 commit comments