Product of min and max prime factors: Difference between revisions

m
→‎{{header|Wren}}: Changed to Wren S/H
m (→‎{{header|AppleScript}}: Dedicated primeFactors handler. Multiplications moved to task code.)
m (→‎{{header|Wren}}: Changed to Wren S/H)
 
(18 intermediate revisions by 12 users not shown)
Line 1:
{{draft task}}
Exactly as the task title implies.
 
Line 7:
 
 
:''For some unknown reason, the term for '''1''' is defined to be '''1'''.''<br>
:''AnA equal case could be made that it should be '''0''', in'''undefined''', myor opinion.''<br>'-∞'''''. ¯\_(ツ)_/¯
:''A even stronger case that it should be ''''undefined'''' or '''NaN'''.'' ¯\_(ツ)_/¯
 
 
Line 15 ⟶ 14:
;*[[oeis:A066048|OEIS:A066048 - Product of smallest and greatest prime factors of n]]
 
 
=={{header|11l}}==
{{trans|BASIC}}
 
<syntaxhighlight lang="11l">
V m = 100
V c = [0B] * (m + 1)
 
L(p) 2 .. Int(m ^ 0.5)
L(ci) (p * p .. m).step(p)
c[ci] = 1B
 
print(‘ #4’.format(1), end' ‘’)
 
L(i) 2 .. m
L(l) 2 .. i
I !(c[l] | i % l > 0)
L(h) (i .. 2).step(-1)
I !(c[h] | i % h > 0)
print(‘ #4’.format(l * h), end' I i % 10 == 0 {"\n"} E ‘’)
L(l).break
</syntaxhighlight>
 
{{out}}
<pre>
1 4 9 4 25 6 49 4 9 10
121 6 169 14 15 4 289 6 361 10
21 22 529 6 25 26 9 14 841 10
961 4 33 34 35 6 1369 38 39 10
1681 14 1849 22 15 46 2209 6 49 10
51 26 2809 6 55 14 57 58 3481 10
3721 62 21 4 65 22 4489 34 69 14
5041 6 5329 74 15 38 77 26 6241 10
9 82 6889 14 85 86 87 22 7921 10
91 46 93 94 95 6 9409 14 33 10
</pre>
 
=={{header|ALGOL 68}}==
Line 68 ⟶ 103:
 
=={{header|AppleScript}}==
===Procedural===
<syntaxhighlight lang="applescript">on isPrime(n)
if (n < 4) then return (n > 1)
Line 132 ⟶ 168:
9 82 6889 14 85 86 87 22 7921 10
91 46 93 94 95 6 9409 14 33 10"</syntaxhighlight>
 
===Functional===
<syntaxhighlight lang="applescript">use framework "Foundation"
 
 
----------- PRODUCT OF MIN AND MAX PRIME FACTORS ---------
 
on OEISA066048()
-- Infinite series of the terms of OEISA066048
script f
on |λ|(n)
set xs to primeFactors(n)
(item 1 of xs) * (item -1 of xs)
end |λ|
end script
cons(1, fmapGen(f, enumFrom(2)))
end OEISA066048
 
 
--------------------------- TEST -------------------------
on run
table(10, take(100, OEISA066048()))
end run
 
 
------------------------- DISPLAY ------------------------
 
-- table :: Int -> [Int] -> String
on table(n, xs)
-- A list of strings formatted as
-- right-justified rows of n columns.
set w to length of str(maximum(xs))
unlines(map(my unwords, ¬
chunksOf(n, ¬
map(compose(justifyRight(w, space), my str), xs))))
end table
 
 
------------------------- GENERIC ------------------------
 
-- compose (<<<) :: (b -> c) -> (a -> b) -> a -> c
on compose(f, g)
script
property mf : mReturn(f)
property mg : mReturn(g)
on |λ|(x)
mf's |λ|(mg's |λ|(x))
end |λ|
end script
end compose
 
 
-- cons :: a -> [a] -> [a]
on cons(x, xs)
script
property pRead : false
on |λ|()
if pRead then
|λ|() of xs
else
set pRead to true
return x
end if
end |λ|
end script
end cons
 
 
-- enumFrom :: Enum a => a -> [a]
on enumFrom(x)
script
property v : missing value
property blnNum : class of x is not text
on |λ|()
if missing value is not v then
if blnNum then
set v to 1 + v
else
set v to succ(v)
end if
else
set v to x
end if
return v
end |λ|
end script
end enumFrom
 
 
-- fmapGen <$> :: (a -> b) -> Gen [a] -> Gen [b]
on fmapGen(f, gen)
script
property g : mReturn(f)
on |λ|()
set v to gen's |λ|()
if v is missing value then
v
else
g's |λ|(v)
end if
end |λ|
end script
end fmapGen
 
 
-- mReturn :: First-class m => (a -> b) -> m (a -> b)
on mReturn(f)
-- 2nd class handler function lifted into 1st class script wrapper.
if script is class of f then
f
else
script
property |λ| : f
end script
end if
end mReturn
 
 
-- maximum :: Ord a => [a] -> a
on maximum(xs)
set ca to current application
unwrap((ca's NSArray's arrayWithArray:xs)'s ¬
valueForKeyPath:"@max.self")
end maximum
 
 
-- primeFactors :: Int -> [Int]
on primeFactors(n)
-- A list of the prime factors of n.
script go
on |λ|(x)
set sqroot to (x ^ 0.5) as integer
if 0 = x mod 2 then
set {q, r} to {2, 1}
else
set {q, r} to {3, 1}
end if
repeat until (sqroot < q) or (0 = (x mod q))
set {q, r} to {1 + (r * 4) - (((r / 2) as integer) * 2), 1 + r}
end repeat
if q > sqroot then
{x}
else
{q} & |λ|((x / q) as integer)
end if
end |λ|
end script
|λ|(n) of go
end primeFactors
 
 
-- str :: a -> String
on str(x)
x as string
end str
 
 
-- take :: Int -> [a] -> [a]
-- take :: Int -> String -> String
on take(n, xs)
set ys to {}
repeat with i from 1 to n
set v to |λ|() of xs
if missing value is v then
return ys
else
set end of ys to v
end if
end repeat
return ys
end take
 
 
-- chunksOf :: Int -> [a] -> [[a]]
on chunksOf(k, xs)
script
on go(ys)
set ab to splitAt(k, ys)
set a to item 1 of ab
if {} ≠ a then
{a} & go(item 2 of ab)
else
a
end if
end go
end script
result's go(xs)
end chunksOf
 
 
-- justifyRight :: Int -> Char -> String -> String
on justifyRight(n, cFiller)
script go
on |λ|(s)
if n > length of s then
text -n thru -1 of ((replicate(n, cFiller) as text) & s)
else
s
end if
end |λ|
end script
end justifyRight
 
 
-- map :: (a -> b) -> [a] -> [b]
on map(f, xs)
-- The list obtained by applying f
-- to each element of xs.
tell mReturn(f)
set lng to length of xs
set lst to {}
repeat with i from 1 to lng
set end of lst to |λ|(item i of xs, i, xs)
end repeat
return lst
end tell
end map
 
 
-- Egyptian multiplication - progressively doubling a list, appending
-- stages of doubling to an accumulator where needed for binary
-- assembly of a target length
-- replicate :: Int -> String -> String
on replicate(n, s)
-- Egyptian multiplication - progressively doubling a list,
-- appending stages of doubling to an accumulator where needed
-- for binary assembly of a target length
script p
on |λ|({n})
n ≤ 1
end |λ|
end script
script f
on |λ|({n, dbl, out})
if (n mod 2) > 0 then
set d to out & dbl
else
set d to out
end if
{n div 2, dbl & dbl, d}
end |λ|
end script
set xs to |until|(p, f, {n, s, ""})
item 2 of xs & item 3 of xs
end replicate
 
 
-- splitAt :: Int -> [a] -> ([a], [a])
on splitAt(n, xs)
if n > 0 and n < length of xs then
if class of xs is text then
{items 1 thru n of xs as text, ¬
items (n + 1) thru -1 of xs as text}
else
{items 1 thru n of xs, items (n + 1) thru -1 of xs}
end if
else
if n < 1 then
{{}, xs}
else
{xs, {}}
end if
end if
end splitAt
 
 
-- unlines :: [String] -> String
on unlines(xs)
-- A single string formed by the intercalation
-- of a list of strings with the newline character.
set {dlm, my text item delimiters} to ¬
{my text item delimiters, linefeed}
set s to xs as text
set my text item delimiters to dlm
s
end unlines
 
 
-- until :: (a -> Bool) -> (a -> a) -> a -> a
on |until|(p, f, x)
set v to x
set mp to mReturn(p)
set mf to mReturn(f)
repeat until mp's |λ|(v)
set v to mf's |λ|(v)
end repeat
v
end |until|
 
 
-- unwords :: [String] -> String
on unwords(xs)
set {dlm, my text item delimiters} to ¬
{my text item delimiters, space}
set s to xs as text
set my text item delimiters to dlm
return s
end unwords
 
 
-- unwrap :: NSValue -> a
on unwrap(nsValue)
if nsValue is missing value then
missing value
else
set ca to current application
item 1 of ((ca's NSArray's arrayWithObject:nsValue) as list)
end if
end unwrap</syntaxhighlight>
{{Out}}
<pre> 1 4 9 4 25 6 49 4 9 10
121 6 169 14 15 4 289 6 361 10
21 22 529 6 25 26 9 14 841 10
961 4 33 34 35 6 1369 38 39 10
1681 14 1849 22 15 46 2209 6 49 10
51 26 2809 6 55 14 57 58 3481 10
3721 62 21 4 65 22 4489 34 69 14
5041 6 5329 74 15 38 77 26 6241 10
9 82 6889 14 85 86 87 22 7921 10
91 46 93 94 95 6 9409 14 33 10</pre>
 
=={{header|Arturo}}==
<syntaxhighlight lang="arturo">prints " 1" ; special case 1 since the result is normally null
; for the factors of 1
 
loop 2..100 'i [
f: factors.prime i
prints to :string .format:"5d" mul min f max f
if 0 = i%10 -> print ""
]</syntaxhighlight>
{{out}}
<pre> 1 4 9 4 25 6 49 4 9 10
121 6 169 14 15 4 289 6 361 10
21 22 529 6 25 26 9 14 841 10
961 4 33 34 35 6 1369 38 39 10
1681 14 1849 22 15 46 2209 6 49 10
51 26 2809 6 55 14 57 58 3481 10
3721 62 21 4 65 22 4489 34 69 14
5041 6 5329 74 15 38 77 26 6241 10
9 82 6889 14 85 86 87 22 7921 10
91 46 93 94 95 6 9409 14 33 10</pre>
 
=={{header|BASIC}}==
Line 527 ⟶ 912:
9 82 6889 14 85 86 87 22 7921 10
91 46 93 94 95 6 9409 14 33 10</pre>
 
=={{header|D}}==
<syntaxhighlight lang="D">
import std.stdio : writef;
 
void main() {
auto sieve = sieve(100);
for(ulong i = 1; i <= 100; i++) {
writef("%4d ", min_prime_factor(i, sieve) * max_prime_factor(i, sieve));
if(i % 10 == 0)
writef("\n");
}
}
bool []sieve(ulong max) {
bool []sieve = new bool[](max + 1);
sieve[] = true;
sieve[0] = false;
sieve[1] = false;
 
for(ulong i = 2; i <= max; i++)
if(sieve[i])
for(ulong j = i * 2; j <= max; j += i)
sieve[j] = false;
 
return sieve;
}
ulong min_prime_factor(ulong number, bool []sieve) {
if (number <= 1)
return 1;
 
for(ulong index = 2; index <= number; index++)
if(sieve[index] && number % index == 0)
return index;
 
assert(0 && "Sieve was not initialized correctly");
}
ulong max_prime_factor(ulong number, bool []sieve) {
if (number <= 1)
return 1;
 
for(ulong index = number; index >= 2; index--)
if(sieve[index] && number % index == 0)
return index;
 
assert(0 && "Sieve was not initialized correctly");
}
 
</syntaxhighlight>
{{out}}
<pre>
1 4 9 4 25 6 49 4 9 10
121 6 169 14 15 4 289 6 361 10
21 22 529 6 25 26 9 14 841 10
961 4 33 34 35 6 1369 38 39 10
1681 14 1849 22 15 46 2209 6 49 10
51 26 2809 6 55 14 57 58 3481 10
3721 62 21 4 65 22 4489 34 69 14
5041 6 5329 74 15 38 77 26 6241 10
9 82 6889 14 85 86 87 22 7921 10
91 46 93 94 95 6 9409 14 33 10
</pre>
 
=={{header|Delphi}}==
{{works with|Delphi|6.0}}
{{libheader|SysUtils,StdCtrls}}
Another example of code reuse by creating subroutines to that get used for more than one Rosetta Code task.
 
<syntaxhighlight lang="Delphi">
procedure StoreNumber(N: integer; var IA: TIntegerDynArray);
{Expand and store number in array}
begin
SetLength(IA,Length(IA)+1);
IA[High(IA)]:=N;
end;
 
 
procedure GetPrimeFactors(N: integer; var Facts: TIntegerDynArray);
{Get all the prime factors of a number}
var I: integer;
begin
I:=2;
SetLength(Facts,0);
repeat
begin
if (N mod I) = 0 then
begin
StoreNumber(I,Facts);
N:=N div I;
end
else I:=GetNextPrime(I);
end
until N=1;
end;
 
 
 
procedure ProductMinMaxFactors(Memo: TMemo);
var I,Cnt,P: integer;
var IA: TIntegerDynArray;
var S: string;
begin
Cnt:=1;
S:=' 1';
for I:=2 to 100 do
begin
GetPrimeFactors(I,IA);
P:=IA[0] * IA[High(IA)];
Inc(Cnt);
S:=S+Format('%5D',[P]);
If (Cnt mod 10)=0 then S:=S+CRLF;
end;
Memo.Lines.Add(S);
Memo.Lines.Add('Count = '+IntToStr(Cnt));
end;
 
</syntaxhighlight>
{{out}}
<pre>
1 4 9 4 25 6 49 4 9 10
121 6 169 14 15 4 289 6 361 10
21 22 529 6 25 26 9 14 841 10
961 4 33 34 35 6 1369 38 39 10
1681 14 1849 22 15 46 2209 6 49 10
51 26 2809 6 55 14 57 58 3481 10
3721 62 21 4 65 22 4489 34 69 14
5041 6 5329 74 15 38 77 26 6241 10
9 82 6889 14 85 86 87 22 7921 10
91 46 93 94 95 6 9409 14 33 10
 
Count = 100
Elapsed Time: 2.961 ms.
</pre>
 
 
=={{header|Draco}}==
Line 734 ⟶ 1,252:
 
=={{header|Haskell}}==
<syntaxhighlight lang=haskell>import Data.List.Split (chunksOfintercalate, transpose)
import Data.List.Split (chunksOf)
import Data.Numbers.Primes (primeFactors)
import Text.Printf (printf)
 
----------- PRODUCT OF MIN AND MAX PRIME FACTORS ---------
 
oeisA066048 :: [Integer]
oeisA066048 = 1 : fmap f [2 ..]
where
f = ((*) . head <*> last) . primeFactors
 
--------------------------- TEST -------------------------
main :: IO ()
main = putStrLn $
(mapM_table print" . " $ (chunksOf 10 . take 100) $
fmap show oeisA066048
1 : (((*) . minimum <*> maximum) . primeFactors <$> [2 ..])</syntaxhighlight>
 
------------------------- DISPLAY ------------------------
 
table :: String -> [[String]] -> String
table gap rows =
let ws = maximum . fmap length <$> transpose rows
pw = printf . flip intercalate ["%", "s"] . show
in unlines $ intercalate gap . zipWith pw ws <$> rows</syntaxhighlight>
{{Out}}
<pre>[ 1, 4, 9, 4, 25, 6, 49, 4, 9, 10]
[ 121, 6, 169, 14, 15, 4, 289, 6, 361, 10]
[ 21, 22, 529, 6, 25, 26, 9, 14, 841, 10]
[ 961, 4, 33, 34, 35, 6, 1369, 38, 39, 10]
[1681, 14, 1849, 22, 15, 46, 2209, 6, 49, 10]
[ 51, 26, 2809, 6, 55, 14, 57, 58, 3481, 10]
[3721, 62, 21, 4, 65, 22, 4489, 34, 69, 14]
[5041, 6, 5329, 74, 15, 38, 77, 26, 6241, 10]
[ 9, 82, 6889, 14, 85, 86, 87, 22, 7921, 10]
[ 91, 46, 93, 94, 95, 6, 9409, 14, 33, 10]</pre>
 
=={{header|J}}==
Line 986 ⟶ 1,522:
9 82 6889 14 85 86 87 22 7921 10
91 46 93 94 95 6 9409 14 33 10</pre>
 
=={{header|Nim}}==
<syntaxhighlight lang="Nim">import std/strformat
 
func primeFactors(n: Positive): seq[Natural] =
if n == 1: return @[1]
var n = n
var d = 2
while d * d <= n:
if n mod d == 0:
result.add d
while n mod d == 0:
n = n div d
inc d
if n != 1: result.add n
 
for n in 1..100:
let pf = n.primeFactors
stdout.write &"{pf[0] * pf[^1]:4}"
stdout.write if n mod 10 == 0: '\n' else: ' '
</syntaxhighlight>
 
{{out}}
<pre> 1 4 9 4 25 6 49 4 9 10
121 6 169 14 15 4 289 6 361 10
21 22 529 6 25 26 9 14 841 10
961 4 33 34 35 6 1369 38 39 10
1681 14 1849 22 15 46 2209 6 49 10
51 26 2809 6 55 14 57 58 3481 10
3721 62 21 4 65 22 4489 34 69 14
5041 6 5329 74 15 38 77 26 6241 10
9 82 6889 14 85 86 87 22 7921 10
91 46 93 94 95 6 9409 14 33 10
</pre>
 
 
=={{header|Perl}}==
Line 1,133 ⟶ 1,704:
 
=={{header|Python}}==
===Procedural===
<syntaxhighlight lang="python">''' Rosetta code rosettacode.org/wiki/Product_of_min_and_max_prime_factors '''
 
Line 1,147 ⟶ 1,719:
<pre>
1 4 9 4 25 6 49 4 9 10
121 6 169 14 15 4 289 6 361 10
21 22 529 6 25 26 9 14 841 10
961 4 33 34 35 6 1369 38 39 10
1681 14 1849 22 15 46 2209 6 49 10
51 26 2809 6 55 14 57 58 3481 10
3721 62 21 4 65 22 4489 34 69 14
5041 6 5329 74 15 38 77 26 6241 10
9 82 6889 14 85 86 87 22 7921 10
91 46 93 94 95 6 9409 14 33 10
</pre>
 
===Functional===
Defining an infinite series, tabulating with flexible column widths for larger samples,
 
and writing (rather than importing) a primeFactors function:
 
<syntaxhighlight lang="python">'''Produce of min and max prime factors'''
 
from itertools import chain, count, islice
from math import floor, sqrt
 
 
# oeisA066048 :: [Int]
def oeisA066048():
'''Infinite series of terms in OEIS A066048.
'''
def f(x):
ns = primeFactors(x)
return ns[0] * ns[-1]
 
return chain([1], map(f, count(2)))
 
 
# ------------------------- TEST -------------------------
# main :: IO ()
def main():
'''First 100 terms in OEIS A066048.
'''
print(table(10)(
list(map(
str, islice(
oeisA066048(),
100
)
))
))
 
 
# ----------------------- GENERIC ------------------------
 
# chunksOf :: Int -> [a] -> [[a]]
def chunksOf(n):
'''A series of lists of length n, subdividing the
contents of xs. Where the length of xs is not evenly
divisible, the final list will be shorter than n.
'''
def go(xs):
return (
xs[i:n + i] for i in range(0, len(xs), n)
) if 0 < n else None
return go
 
 
# primeFactors :: Int -> [Int]
def primeFactors(n):
'''A list of the prime factors of n.
'''
def f(qr):
r = qr[1]
return step(r), 1 + r
 
def step(x):
return 1 + (x << 2) - ((x >> 1) << 1)
 
def go(x):
root = floor(sqrt(x))
 
def p(qr):
q = qr[0]
return root < q or 0 == (x % q)
 
q = until(p)(f)(
(2 if 0 == x % 2 else 3, 1)
)[0]
return [x] if q > root else [q] + go(x // q)
 
return go(n)
 
 
# table :: Int -> [String] -> String
def table(n):
'''A list of strings formatted as
right-justified rows of n columns.
'''
def go(xs):
w = len(max(xs, key=len))
return '\n'.join(
' '.join(row) for row in chunksOf(n)([
s.rjust(w, ' ') for s in xs
])
)
return go
 
 
# until :: (a -> Bool) -> (a -> a) -> a -> a
def until(p):
'''The result of repeatedly applying f until p holds.
The initial seed value is x.
'''
def go(f):
def g(x):
v = x
while not p(v):
v = f(v)
return v
return g
return go
 
 
# MAIN ---
if __name__ == '__main__':
main()</syntaxhighlight>
{{Out}}
<pre> 1 4 9 4 25 6 49 4 9 10
121 6 169 14 15 4 289 6 361 10
21 22 529 6 25 26 9 14 841 10
961 4 33 34 35 6 1369 38 39 10
1681 14 1849 22 15 46 2209 6 49 10
51 26 2809 6 55 14 57 58 3481 10
3721 62 21 4 65 22 4489 34 69 14
5041 6 5329 74 15 38 77 26 6241 10
9 82 6889 14 85 86 87 22 7921 10
91 46 93 94 95 6 9409 14 33 10</pre>
 
=={{header|Quackery}}==
 
<code>primefactors</code> is defined at [[Prime decomposition#Quackery]].
 
<syntaxhighlight lang="Quackery"> ' [ 1 ]
99 times
[ i^ 2 + primefactors
dup 0 peek
swap -1 peek *
join ]
witheach
[ number$
space 4 of
swap join
-5 split nip
echo$
i^ 10 mod 9 =
if cr else sp ]</syntaxhighlight>
 
{{out}}
 
<pre> 1 4 9 4 25 6 49 4 9 10
121 6 169 14 15 4 289 6 361 10
21 22 529 6 25 26 9 14 841 10
Line 1,174 ⟶ 1,902:
9 82 6889 14 85 86 87 22 7921 10
91 46 93 94 95 6 9409 14 33 10</pre>
=={{header|RPL}}==
{{works with|HP|49g}}
≪ {1}
2 100 '''FOR''' j
j FACTORS
DUP 1 GET
SWAP REVLIST 2 GET
* +
'''NEXT '''
≫ '<span style="color:blue">TASK</span>' STO
{{out}
<pre>
1: {1 4 9 4 25 6 49 4 9 10 121 6 169 14 15 4 289 6 361 10 21 22 529 6 25 26 9 14 841 10 961 4 33 34 35 6 1369 38 39 10 1681 14 1849 22 15 46 2209 6 49 10 51 26 2809 6 55 14 57 58 3481 10 3721 62 21 4 65 22 4489 34 69 14 5041 6 5329 74 15 38 77 26 6241 10 9 82 6889 14 85 86 87 22 7921 10 91 46 93 94 95 6 9409 14 33 10}
</pre>
 
=={{header|Ruby}}==
<syntaxhighlight lang="ruby" line>require 'prime'
 
res = [1]+ (2..100).map{|n| n.prime_division.map(&:first).minmax.inject(&:*)}
res.each_slice(10){|slice| puts '%5d'*slice.size % slice}</syntaxhighlight>
{{out}}
<pre> 1 4 9 4 25 6 49 4 9 10
121 6 169 14 15 4 289 6 361 10
21 22 529 6 25 26 9 14 841 10
961 4 33 34 35 6 1369 38 39 10
1681 14 1849 22 15 46 2209 6 49 10
51 26 2809 6 55 14 57 58 3481 10
3721 62 21 4 65 22 4489 34 69 14
5041 6 5329 74 15 38 77 26 6241 10
9 82 6889 14 85 86 87 22 7921 10
91 46 93 94 95 6 9409 14 33 10</pre>
 
=={{header|Sidef}}==
<syntaxhighlight lang="ruby" line>1..100 -> map {|n| lpf(n) * gpf(n) }.slices(10).each {|a|
a.map{ '%5s' % _ }.join(' ').say
}</syntaxhighlight>
 
{{out}}
<pre>
1 4 9 4 25 6 49 4 9 10
121 6 169 14 15 4 289 6 361 10
21 22 529 6 25 26 9 14 841 10
961 4 33 34 35 6 1369 38 39 10
1681 14 1849 22 15 46 2209 6 49 10
51 26 2809 6 55 14 57 58 3481 10
3721 62 21 4 65 22 4489 34 69 14
5041 6 5329 74 15 38 77 26 6241 10
9 82 6889 14 85 86 87 22 7921 10
91 46 93 94 95 6 9409 14 33 10
</pre>
 
=={{header|VTL-2}}==
Line 1,221 ⟶ 1,999:
{{libheader|Wren-math}}
{{libheader|Wren-fmt}}
<syntaxhighlight lang="ecmascriptwren">import "./math" for Int
import "./fmt" for Fmt
 
9,476

edits