Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,13 @@
|
|||
function hofstQseq(n, typerst::Type=Int)
|
||||
nmax = maximum(n)
|
||||
r = Vector{typerst}(nmax)
|
||||
r[1] = 1
|
||||
if nmax ≥ 2 r[2] = 1 end
|
||||
for i in 3:nmax
|
||||
r[i] = r[i - r[i - 1]] + r[i - r[i - 2]]
|
||||
end
|
||||
return r[n]
|
||||
end
|
||||
|
||||
println("First ten elements of sequence: ", join(hofstQseq(1:10), ", "))
|
||||
println("1000-th element: ", hofstQseq(1000))
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
seq = hofstQseq(1:100_000)
|
||||
cnt = count(diff(seq) .< 0)
|
||||
println("$cnt elements are less than the preceding one.")
|
||||
Loading…
Add table
Add a link
Reference in a new issue