assume(m>5);

assume(n>=m);

facts();

facts(m);

facts(n);

is(n>4);

askinteger(m);

declare(m, odd);

(-1)^m;

askinteger(m);

oddp(m);

askinteger(m, odd);

declare(interesting_number, feature);

declare(m, interesting_number);

put(m, "Lecture 2", first_mention);

get(m, first_mention);

facts(m);

properties(m);

load("ezunits");

a: 1 ` mile;

b: a `` km;

float(b);

known_unit_conversions;

c: 2 ` km;

a+c;

(a+c) `` m;

%/(5 ` kg);

units(%);

kill(all); a: [1, 2, 3];

listp(a);

a[2];

a[1]: 8;

a[2]: "foo";

a[3]: [1, 2.0];

a[4]: 5;

append(a, 5);

append(a, [5]);

a;

rest(a, 1);

b: rest(a, -1);

b[1]: 9;

a;

c: makelist(x[i], i, 3, 11, 2);

c: makelist(concat(x, i), i, 7);

d: makelist(i, i, 1, 10);

sum(d);

sum(i, i, 1, 10);

map(lambda([x], x^2), d);

sublist(d, evenp);

e: map(lambda([x], cos(x)^2+sin(x)^2), d);

float(e);

kill(all); array(a, 2, 2);

a[1, 1]: 2;

a[2, 1]: [1, 4];

array(b, float, 0, 3);

b[0, 1]: "foo";

listarray(a);
listarray(b);

array(x, 0, 0);

x[0, 0]: cos(y);

y: %pi/4;

listarray(x);

ev(%);

c: set(1, 1, 2, 3, 3, 3);

d: {3, 4, 4};

setp(c);
setp(d);

intersection(c, d);

e: union(c, d);

powerset(e);

f: "I'm a string";

substring(f, 1, 8);

split(f);

x: -12;

if not integerp(x) then
    print(x, " is not an integer.")
elseif x >= 10 then
    print(x, " is an integer with more than one digit.")
elseif x >= 0 then
    print(x, " is an integer with one digit.")
else
    print(x, " is a negative integer.")$

for n: 1 thru 10 step 2 do
    print(float(sqrt(n))); 

for n: 2 thru 10 unless n>6 or not primep(n) do
    print(float(sqrt(n)))$

a: [1, 5, 9, 10, 3, 15];

for i in a do
    print(primep(i))$

x: 872349$ 
while notequal (x, 0) do
    (print(mod(x, 7)),
    print(quotient(x, 7)),
    x: quotient(x, 7))$