A-M baby
This commit is contained in:
parent
764da6cbbb
commit
db842d013d
19005 changed files with 197040 additions and 7 deletions
11
Task/Executable-library/J/executable-library-1.j
Normal file
11
Task/Executable-library/J/executable-library-1.j
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
hailseq=: -:`(1 3&p.)@.(2&|) ^:(1 ~: ]) ^:a:"0
|
||||
9!:29]1
|
||||
9!:27'main 0'
|
||||
main=:3 :0
|
||||
smoutput 'Hailstone sequence for the number 27'
|
||||
smoutput hailseq 27
|
||||
smoutput ''
|
||||
smoutput 'Finding number with longest hailstone sequence which is'
|
||||
smoutput 'less than 100000 (and finding that sequence length):'
|
||||
smoutput (I.@(= >./),>./) #@hailseq i.1e5
|
||||
)
|
||||
6
Task/Executable-library/J/executable-library-2.j
Normal file
6
Task/Executable-library/J/executable-library-2.j
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
load jpath '~temp/hailseq.ijs'
|
||||
Hailstone sequence for the number 27
|
||||
27 82 41 124 62 31 94 47 142 71 214 107 322 161 484 242 121 364 182 91 274 137 412 206 103 310 155 466 233 700 350 175 526 263 790 395 1186 593 1780 890 445 1336 668 334 167 502 251 754 377 1132 566 283 850 425 1276 638 319 958 479 1438 719 2158 1079 3238 ...
|
||||
Finding number with longest hailstone sequence which is
|
||||
less than 100000 (and finding that sequence length):
|
||||
77031 351
|
||||
8
Task/Executable-library/J/executable-library-3.j
Normal file
8
Task/Executable-library/J/executable-library-3.j
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
require '~temp/hailseq.ijs'
|
||||
9!:29]1
|
||||
9!:27'main 0'
|
||||
main=:3 :0
|
||||
smoutput 'Finding most frequent hailstone sequence length for'
|
||||
smoutput 'Hailstone sequences for whole numbers less than 100000:'
|
||||
smoutput {:{.\:~ (#/.~,.~.) #@hailseq }.i.1e5
|
||||
)
|
||||
4
Task/Executable-library/J/executable-library-4.j
Normal file
4
Task/Executable-library/J/executable-library-4.j
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
load jpath '~temp/66.ijs'
|
||||
Finding most frequent hailstone sequence length for
|
||||
Hailstone sequences for whole numbers less than 100000
|
||||
72
|
||||
Loading…
Add table
Add a link
Reference in a new issue