Algosim documentation: #

The # (number sign) character is used both as a prefix operator and as a postfix operator.

# (primorial)

The primorial function.

Syntax

Description

If n is an integer, then n# is the product of all prime numbers less than or equal to n.

Notes

The postfix operator # is mapped to the primorial function.

Examples

50#
614889782588491410
100#
2.30556796395⋅10^36
SequenceVector(15) @ primorial
(1, 2, 6, 6, 30, 30, 210, 210, 210, 210, 2310, 2310, 30030, 30030, 30030)

See also

# (length)

The length function.

Syntax

Description

In general, if X is a container, then #X is the number of elements it contains. Depending on the type of X, this number is typically referred to as the “cardinality”, “dimension”, “length”, or “size” of X.

Notes

The prefix operator # is mapped to the length function.

Examples

P ≔ filter(SequenceList(1000), IsPrime); #P
168
#functions()
781
f ≔ n ↦ if(even(n), n/2, 3⋅n + 1);
#orbit(f, 1000)
112
A ≔ ❨❨6, 3, 2, 0, 4, 5❩, ❨7, 0, 2, 1, 4, 2❩, ❨6, 2, 3, 1, 4, 2❩, ❨8, 0, 2, 3, 3, 5❩, ❨4, 2, 6, 3, 2, 0❩❩
⎛6  3  2  0  4  5⎞
⎜7  0  2  1  4  2⎟
⎜6  2  3  1  4  2⎟
⎜8  0  2  3  3  5⎟
⎝4  2  6  3  2  0⎠
#A
30

See also