22# Copyright Peter Luschny. License is MIT.
33# This file includes parts from Combinatorics.jl in modified form.
44
5- # Version of: UTC 2019-11-06 01:35:53
6- # 63b05410-002d -11ea-3957-070f416b5206
5+ # Version of: UTC 2019-11-06 13:47:27
6+ # 966f98f0-0093 -11ea-1a21-434e877baaf5
77
88# Do not edit this file, it is generated from the modules and will be overwritten!
99# Edit the modules in the src directory and build this file with BuildSequences.jl!
@@ -80,7 +80,6 @@ InvOrthoPoly,
8080JacobiTheta3Powers,
8181JacobiTheta4Powers,
8282KolakoskiList,
83- LF097805,
8483List,
8584ModuleAbundant,
8685ModuleAndreNumbers,
@@ -172,6 +171,7 @@ RamanujanTau,
172171RamanujanTauList,
173172RecTriangle,
174173Records,
174+ RecordsCached,
175175ReflectPoly,
176176RiordanProduct,
177177RiordanSquare,
@@ -243,7 +243,6 @@ oeis_writebfile,
243243takeFirst,
244244toΔ,
245245Ω,
246- π,
247246σ,
248247σ2,
249248τ,
@@ -2621,7 +2620,7 @@ T097805(n) = RecTriangle(n, R097805)
26212620Lists the first ``n`` rows of A097805 by concatinating. This is the format for submissions to the OEIS.
26222621$(SIGNATURES)
26232622"""
2624- LF097805 (n) = vcat (T097805 (n)... )
2623+ L097805 (n) = vcat (T097805 (n)... )
26252624"""
26262625
26272626Return the triangular array as a square matrix.
@@ -4468,13 +4467,13 @@ V066570(n) = div(GaussFactorial(n, 1), GaussFactorial(n, n))
44684467Iterate over the indices of the first ``n`` record values of the Gauß factorial.
44694468$(SIGNATURES)
44704469"""
4471- I193339 (n) = Records (GaussFactorial, n, true , true , Dict () )
4470+ I193339 (n) = Records (GaussFactorial, n, true , true )
44724471"""
44734472
44744473Iterate over indices of the record values of the Gauß factorial which do not exceed ``n`` (``1 ≤ i ≤ n``).
44754474$(SIGNATURES)
44764475"""
4477- F193339 (n) = Records (GaussFactorial, n, false , true , Dict () )
4476+ F193339 (n) = Records (GaussFactorial, n, false , true )
44784477"""
44794478
44804479Return the indices of the first ``n`` record values of the Gauß factorial as an array.
@@ -4492,13 +4491,13 @@ V193339(n) = nth(I193339(n+1), n+1)
44924491Iterate over the first ``n`` record values of the Gauß factorial (``1 ≤ r``).
44934492$(SIGNATURES)
44944493"""
4495- I193338 (n) = Records (GaussFactorial, n, true , false , Dict () )
4494+ I193338 (n) = Records (GaussFactorial, n, true , false )
44964495"""
44974496
44984497Iterate over the record values of the Gauß factorial which do not exceed ``n`` (``1 ≤ i ≤ n``).
44994498$(SIGNATURES)
45004499"""
4501- F193338 (n) = Records (GaussFactorial, n, false , false , Dict () )
4500+ F193338 (n) = Records (GaussFactorial, n, false , false )
45024501"""
45034502
45044503Return the first ``n`` record values of the Gauß factorial as an array.
@@ -4668,13 +4667,13 @@ const ModuleHighlyAbundant = ""
46684667Iterate over the first ``n`` highly abundant numbers.
46694668$(SIGNATURES)
46704669"""
4671- I002093 (n) = Records (σ, n, true , true , Dict () )
4670+ I002093 (n) = Records (σ, n, true , true )
46724671"""
46734672
46744673Iterate over the highly abundant numbers which do not exceed ``n`` (``1 ≤ i ≤ n``).
46754674$(SIGNATURES)
46764675"""
4677- F002093 (n) = Records (σ, n, false , true , Dict () )
4676+ F002093 (n) = Records (σ, n, false , true )
46784677"""
46794678
46804679Return the first ``n`` highly abundant numbers as an array.
@@ -4692,13 +4691,13 @@ V002093(n) = nth(I002093(n+1), n+1)
46924691Iterate over the first ``n`` record values of sigma.
46934692$(SIGNATURES)
46944693"""
4695- I034885 (n) = Records (σ, n, true , false , Dict () )
4694+ I034885 (n) = Records (σ, n, true , false )
46964695"""
46974696
46984697Iterate over the record values of sigma the indices of which do not exceed ``n`` (``1 ≤ r ≤ n``).
46994698$(SIGNATURES)
47004699"""
4701- F034885 (n) = Records (σ, n, false , false , Dict () )
4700+ F034885 (n) = Records (σ, n, false , false )
47024701"""
47034702
47044703Return the first ``n`` record values of sigma as an array.
@@ -7140,7 +7139,7 @@ const ModuleRecordSearch = ""
71407139The type object to construct an iterated search for records in sequences.
71417140$(SIGNATURES)
71427141"""
7143- struct Records
7142+ struct RecordsCached
71447143" function representing the sequence"
71457144fun:: Function
71467145" search limit OR search length"
@@ -7152,17 +7151,16 @@ index::Bool
71527151" the records"
71537152records
71547153end
7155- Base. iterate (:: Records ) = (ZZ (1 ), (ZZ (1 ), ZZ (0 ), ZZ (1 )))
7154+ Base. iterate (:: RecordsCached ) = (ZZ (1 ), (ZZ (1 ), ZZ (0 ), ZZ (1 )))
71567155"""
71577156
71587157Return the value or the index of the next record.
71597158$(SIGNATURES)
71607159"""
7161- function Base. iterate (R:: Records , state)
7160+ function Base. iterate (R:: RecordsCached , state)
71627161h, n, s = state
71637162if (R. below ? s : n) >= R. lim
7164- println ()
7165- println (R. records)
7163+ println (); println (R. records)
71667164return nothing
71677165end
71687166while true
@@ -7174,6 +7172,38 @@ end
71747172n += 1
71757173end
71767174end
7175+ Base. length (R:: RecordsCached ) = R. lim
7176+ Base. eltype (R:: RecordsCached ) = fmpz
7177+ """
7178+
7179+ The type object to construct an iterated search for records in sequences.
7180+ $(SIGNATURES)
7181+ """
7182+ struct Records
7183+ " function representing the sequence"
7184+ fun:: Function
7185+ " search limit OR search length"
7186+ lim:: Int
7187+ " true ↦ search all below lim, false ↦ search length items"
7188+ below:: Bool
7189+ " true ↦ return index of record, false ↦ return value of record"
7190+ index:: Bool
7191+ end
7192+ Base. iterate (:: Records ) = (ZZ (1 ), (ZZ (1 ), ZZ (0 ), ZZ (1 )))
7193+ """
7194+
7195+ Return the value or the index of the next record.
7196+ $(SIGNATURES)
7197+ """
7198+ function Base. iterate (R:: Records , state)
7199+ h, n, s = state
7200+ (R. below ? s : n) >= R. lim && return nothing
7201+ while true
7202+ v = R. fun (n)
7203+ v > h && return (R. index ? n : v, (v, n + 1 , s + 1 ))
7204+ n += 1
7205+ end
7206+ end
71777207Base. length (R:: Records ) = R. lim
71787208Base. eltype (R:: Records ) = fmpz
71797209# *** RiordanSquares.jl ****************
@@ -7415,6 +7445,11 @@ Alias for is_oeis_installed.
74157445$(SIGNATURES)
74167446"""
74177447data_installed () = is_oeis_installed ()
7448+ """
7449+
7450+ Perform tests for an array of sequences of given type assuming the given offset.
7451+ $(SIGNATURES)
7452+ """
74187453function SeqTest (seqarray, kind, offset = 0 )
74197454if kind == ' V'
74207455return SeqVTest (seqarray, offset)
@@ -7495,6 +7530,11 @@ ShowAsΔ(S)
74957530end
74967531end
74977532end
7533+ """
7534+
7535+ Test to generate sequences from a given list of sequences.
7536+ $(SIGNATURES)
7537+ """
74987538function GenerateAllTest (A:: Array{Function,1} )
74997539err = String[]
75007540for a ∈ A
@@ -7518,9 +7558,7 @@ elseif startswith(stra, "is")
75187558elseif startswith (stra, ' I' )
75197559collect (a (6 )) |> println
75207560elseif startswith (stra, ' F' )
7521- w = fmpz[]
7522- for r ∈ a (20 ) push! (w, r) end
7523- println (w)
7561+ collect (IterTools. takewhile (k -> k <= 20 , a (21 ))) |> println
75247562elseif startswith (stra, ' P' )
75257563for k ∈ 0 : 4 a (k) |> println end
75267564elseif startswith (stra, ' R' )
@@ -7537,7 +7575,12 @@ else
75377575[a (2 , k) for k ∈ 0 : 6 ] |> println
75387576end
75397577else
7540- " ??? \n " |> print
7578+ if applicable (a, 1 )
7579+ [a (k) for k ∈ 0 : 6 ] |> println
7580+ else
7581+ [a (0 , k) for k ∈ 0 : 6 ] |> println
7582+ [a (2 , k) for k ∈ 0 : 6 ] |> println
7583+ end
75417584end
75427585catch
75437586" ERROR!" |> println
@@ -7546,7 +7589,8 @@ end
75467589end
75477590numerr = length (err)
75487591if numerr > 0
7549- @warn (numerr, " errors found:\n " , err)
7592+ @warn (numerr, " errors found:" )
7593+ for e ∈ err println (e) end
75507594end
75517595return numerr
75527596end
@@ -8123,13 +8167,13 @@ P097805(n) = OrderedSetPolynomials(0, n)
81238167
81248168Return the number of ordered set partitions of an ``n``-set which are of shape type ``0``.
81258169```julia-repl
8126- julia> L097805 (3)
8170+ julia> TL097805 (3)
812781714-element Array{Nemo.fmpz,1}:
81288172[0, 1, 2, 1]
81298173```
81308174$(SIGNATURES)
81318175"""
8132- L097805 (n) = Coeffs (OrderedSetPolynomials (0 , n))
8176+ TL097805 (n) = Coeffs (OrderedSetPolynomials (0 , n))
81338177"""
81348178
81358179Return the first ``len`` rows of the triangle of compositions of ``n``.
0 commit comments