Sponsored links: Algebra eBooks
 

Related

evenp-indices-sublist_indices

a: [1,2,3,4,5,6];

b: [6,5,4,3,2,1];

id: sublist_indices(a...

Calculate

evenp-oddp

evenp(10);

oddp(12);

Calculate

evenp-if-lambda-makelist-map-setify-subset

expr:n;

makelist(''expr, n, 1...

set(a,b);

Calculate

evenp-sublist

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

sublist([1,2,3,4,2,1,...

Calculate

evenp-if-lambda-makelist-map-setify-subset

expr:n;

makelist(''expr, n, 1...

set(a,b);

Calculate

evenp-sublist

L: [1, 2, 3, 4, 5, 6];

sublist (L, evenp);

Calculate

evenp-subset

subset ({1, 2, 3, 4, ...

Calculate

evenp-first-if-lambda-makelist-map-setify-subset

expr:n;

makelist(''expr, n, 1...

set(a,b);

Calculate

evenp-first-if-lambda-makelist-map-setify-subset

expr:n;

makelist(''expr, n, 1...

set(a,b);

Calculate

evenp-first-if-lambda-makelist-map-setify-subset

expr:n;

makelist(''expr, n, 1...

set(a,b);

Calculate

evenp

Run Example
(%i1)L: [1, 7, 2, 9];
(%o1)                            [1, 7, 2, 9]
(%i2)  sublist (L, evenp);
(%o2)                                 [2]
(%i3) 
Run Example
expr:n;
(%o1)                                  n
(%i2) makelist(''expr, n, 1, 100);
(%o2) [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 
21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 
40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 
59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 
78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 
97, 98, 99, 100]
(%i3) set(a,b);
(%o3)                               {a, b}
(%i4) first([1,2]);
(%o4)                                  1
(%i5) map(first, [[1, 2]]);
(%o5)                                 [1]
(%i6) for n:1 thru 10 do (y:2*n, (return(if(y=2*n) then n)));
(%o6)                                  1
(%i7) subset(setify(makelist(''expr, n, 1, 10)), lambda([n], evenp(n)));
(%o7)                          {2, 4, 6, 8, 10}
(%i8) map(reverse, map(lambda([n], 1/2^n), setify(makelist(''expr, n, 1, 10))));
(%o8)             {2, 4, 8, 16, 32, 64, 128, 256, 512, 1024}
(%i9) 
Run Example
expr:n;
(%o1)                                  n
(%i2) makelist(''expr, n, 1, 100);
(%o2) [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 
21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 
40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 
59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 
78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 
97, 98, 99, 100]
(%i3) set(a,b);
(%o3)                               {a, b}
(%i4) first([1,2]);
(%o4)                                  1
(%i5) map(first, [[1, 2]]);
(%o5)                                 [1]
(%i6) for n:1 thru 10 do (return(if(n+1=2*n) then n));
(%o6)                                  1
(%i7) subset(setify(makelist(''expr, n, 1, 10)), lambda([n], evenp(n)));
(%o7)                          {2, 4, 6, 8, 10}
(%i8) map(reverse, map(lambda([n], 1/2^n), setify(makelist(''expr, n, 1, 10))));
(%o8)             {2, 4, 8, 16, 32, 64, 128, 256, 512, 1024}
(%i9) 

Related Help

Help for Evenp