2cUniverse

115 Reputation

4 Badges

3 years, 86 days

MaplePrimes Activity


These are replies submitted by 2cUniverse

Good morning :)

Thats true, I was focussed in sqaurefree numbers for some reason but I have tested my program with some random intergers and also square numbers like 12^2. The plot results are really surprising.

Speed:

I do some resarch behind my grafik-software.

The bases that exit for one selected period (your proc) are pairwise conected to another base in the set.  I can see this in the plots.

So  it's possible to run only the half of the loop with some extra calculations for pairfinding. I think this may reduce the time to 60% of running the fulll loop.

Thanks for helping :)

Good afternoon,

you have solved my problem :)

Now I can use larger numbers in my program.

This is imortant because then also birthdates are possible as a number to visualize.

Here are the new steps how to find a period to visualize:

den := genSqrFree(5, 20);  # create a number
                        den := 11842585
ifactor(den);
                    (5) (23) (29) (53) (67)

maxPer := CarmichaelLambda(den);
                        maxPer := 12012

perSet := Divisors(maxPer) minus {1};


perSet := {2, 3, 4, 6, 7, 11, 12, 13, 14, 21, 22, 26, 28, 33, 39,

  42, 44, 52, 66, 77, 78, 84, 91, 132, 143, 154, 156, 182, 231,

  273, 286, 308, 364, 429, 462, 546, 572, 858, 924, 1001, 1092,

  1716, 2002, 3003, 4004, 6006, 12012}

period := perSet[6];   # choose a small period here
                          period := 11

basesL := directBases(den, period);    # this is your procedure
                              {1}

basesL := [207496, 299716, 338141, 484156, 514896, 561006,

  568691, 737761, 853036, 1029791, 1098956, 1237286, 1367931,

  1452466, 1544686, 1590796, 1598481, 1752181, 1767551, 1844401,

  2105691, 2128746, 2159486, 2267076, 2282446, 2359296, 2482256,

  2620586, 2781971, 2797341, 3135481, 3143166, 3189276, 3312236,

  3389086, 3573526, 3658061, 3673431, 4026941, 4188326, 4418876,

  4457301, 4541836, 4603316, 4634056, 4733961, 4933771, 5202746,

  5248856, 5448666, 5487091, 5663846, 5717641, 5733011, 5871341,

  5963561, 6086521, 6148001, 6224851, 6247906, 6401606, 6601416,

  6662896, 6747431, 6793541, 6901131, 7031776, 7208531, 7254641,

  7277696, 7308436, 7431396, 7546671, 7631206, 7723426, 7777221,

  8207581, 8292116, 8307486, 8338226, 8445816, 8660996, 8722476,

  8799326, 8807011, 8822381, 8960711, 8976081, 9052931, 9091356,

  9175891, 9268111, 9314221, 9321906, 9337276, 9368016, 9490976,

  9606251, 9690786, 9752266, 9783006, 9852171, 9882911, 10082721,

  10205681, 10397806, 10505396, 10636041, 10782056, 10812796,

  10858906, 10912701, 11020291, 11035661, 11296951, 11373801,

  11550556, 11627406, 11665831, 11811846]

directBases := proc(n, per) local d; d := per /~ NumberTheory:-PrimeFactors(per); print(d); select(b -> igcd(n, b) = 1 and (b &^ per) mod n = 1 and andseq((b &^ i) mod n <> 1, i = d), [$ (2 .. n - 1)]); end proc;

The base above are preplotted in a tabulate as a lineplot. Then I choose a base and color the lineplot random by recognizing the ploygons inside. I have attach a colored example.

For this example (den) which could be a birthday (8 decimals) it takes 38 seconds to find the bases.

For a use on a website this is a little to long. If there is a way to speed up the code I will be happy.

How can I mail you a jpg ? I Think the link above doesn't work.

Thanks for support :)

Good morning,

I have read this wikipedia-article about primitive roots (your link).

For our example n=78:

numbers that have a primitive root  < Totient (78) are

  {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24}  (A0033948)

Divisors(Totient(78)) are  {2, 3, 4, 6, 8, 12, 24}

Intersection of above Sets gives:   {2, 3, 4, 6}

Now 8 and 12 are removed as you mentioned.

The correct result is  {2, 3, 4, 6, 12}

…  sadly the 12 is missing …


I understand more but didn’t solve  my asked question to an statisfying end.

thanks for support

 


Ok, I have tried to understand that. This (Totient, fundamental period) is only for primes or can I use it also for squarefree numbers in general.

I use squarefree numbers for my program because there are more possibilities then.

Example:  n = 123    ( = 3 x 41)

Torient(123) = 80   (the number of positive integers coprime to n and not greater  than n)

Divisors(80) = {1, 2, 4, 5, 8, 10, 16, 20, 40, 80}

possible periods calculated with MultiplicaticeOrder : { 2, 4, 5, 8, 10, 16, 20, 40}


Question: why is the 80 not in the period-list ?

Has this to do with 2, 4, p^k, 2 p^k ?

Is this primitive Root calculating only for primes or may I use it for square free numbers (combined prime factors that have no exponent) ?

Thanks Mr Love for answering so imediate :)

Your solution helps me a lot !

I have checked numbers up to 10^8 with your code. With MultiplicativeOrder its possible up t 10^6.

I use this for visualizing small periods (< 40)  of a period-base combination (see attached file) .

My code produces a lineplot which has a lot of polygones. Then I fill the Polygones random with colors.

For getting the possible periods without MultiplicativeOrder I use this Code

perS := proc(n) local pSet, p, i, pf; pf := PrimeFactors(n); pSet := {}; for i to nops(pf) do p := [op(pf)][i]; pSet := pSet union Divisors(p - 1); end do; print(); pSet := pSet minus {1}; end proc

This gives most of the small periods which helps me but it is not the complete set.

I have recognized that the possible periods are the Divisors of the last (largest) list-element that MultiplicativeOrder gives. So may be there is a way to find this largest list element without using MultiplicativeOrder and then just use the command Divisors(largest Element).

Thanks again Mr Love :)

You knowledge helps me a lot !

Thanks a lot for helping :)

 

I am very happy to play with this procedure now😀

Best regards

Arno

1 2 3 4 Page 4 of 4