Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
28
Task/Jacobsthal-numbers/Quackery/jacobsthal-numbers.quackery
Normal file
28
Task/Jacobsthal-numbers/Quackery/jacobsthal-numbers.quackery
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
[ 2 over ** -1 rot ** - 3 / ] is j ( n --> n )
|
||||
|
||||
[ 2 over ** -1 rot ** + ] is jl ( n --> n )
|
||||
|
||||
[ dup 1+ j swap j * ] is jo ( n --> n )
|
||||
|
||||
say "First 30 Jacobsthal numbers:"
|
||||
cr
|
||||
30 times [ i^ j echo sp ]
|
||||
cr cr
|
||||
say "First 30 Jacobsthal-Lucas numbers:"
|
||||
cr
|
||||
30 times [ i^ jl echo sp ]
|
||||
cr cr
|
||||
say "First 20 Jacobsthal oblong numbers:"
|
||||
cr
|
||||
20 times [ i^ jo echo sp ]
|
||||
cr cr
|
||||
say "First 10 Jacobsthal primes:"
|
||||
cr
|
||||
[] 0
|
||||
[ dup j dup isprime iff
|
||||
[ swap dip join ]
|
||||
else drop
|
||||
1+
|
||||
over size 10 = until ]
|
||||
drop
|
||||
witheach [ echo sp ]
|
||||
Loading…
Add table
Add a link
Reference in a new issue