calebprime
Penultimate Amazing
- Joined
- Jul 5, 2006
- Messages
- 13,001
Anyone familiar with MacGap, an application for number theory on the Macintosh?
I don't know much about programming, but I can take simple code and adapt it for my purposes. This saves time over doing things by hand.
It would be useful to have some code that will do "mappings". This just means, given some input string of numbers, substitute particular numbers for those numbers.
example: "map 35"
for the numbers 0,1,2,3,4,5,6,7,8,9,10,11
substitute
0,2,5,7,10,1,4,8,11,3,6,9
so, given 5,3,6,1,9,4,0,11,7,8,10,2
the answer is:
1,7,4,2,3,10,0,9,8,11,6,5
I take code and paste it into MacGap. It's a duffer's approach, but it works for me.
like so:
gap> for i in [5,3,6,1,9,4,0,11,7,8,10,2] do
> Print(i, " multiplied mod 13 " , ((i-8) mod 12 *2) mod 13,"\n"); od;
5 multiplied mod 13 5
3 multiplied mod 13 1
6 multiplied mod 13 7
1 multiplied mod 13 10
9 multiplied mod 13 2
4 multiplied mod 13 3
0 multiplied mod 13 8
11 multiplied mod 13 6
7 multiplied mod 13 9
8 multiplied mod 13 0
10 multiplied mod 13 4
2 multiplied mod 13 12
this takes a series, tranposes it down 8 semitones, and multiplies it by 2 mod 13.
So, I'm looking for simple code something like this where I can make a few changes and plug it into MacGap.
I don't know much about programming, but I can take simple code and adapt it for my purposes. This saves time over doing things by hand.
It would be useful to have some code that will do "mappings". This just means, given some input string of numbers, substitute particular numbers for those numbers.
example: "map 35"
for the numbers 0,1,2,3,4,5,6,7,8,9,10,11
substitute
0,2,5,7,10,1,4,8,11,3,6,9
so, given 5,3,6,1,9,4,0,11,7,8,10,2
the answer is:
1,7,4,2,3,10,0,9,8,11,6,5
I take code and paste it into MacGap. It's a duffer's approach, but it works for me.
like so:
gap> for i in [5,3,6,1,9,4,0,11,7,8,10,2] do
> Print(i, " multiplied mod 13 " , ((i-8) mod 12 *2) mod 13,"\n"); od;
5 multiplied mod 13 5
3 multiplied mod 13 1
6 multiplied mod 13 7
1 multiplied mod 13 10
9 multiplied mod 13 2
4 multiplied mod 13 3
0 multiplied mod 13 8
11 multiplied mod 13 6
7 multiplied mod 13 9
8 multiplied mod 13 0
10 multiplied mod 13 4
2 multiplied mod 13 12
this takes a series, tranposes it down 8 semitones, and multiplies it by 2 mod 13.
So, I'm looking for simple code something like this where I can make a few changes and plug it into MacGap.
Last edited: