Exemple #1
0
        static void Main(string[] args)
        {
            int[]      a1;
            int[]      a1Tussen;
            int[]      a2;
            bool       stop   = false;
            int        count  = 0;
            int        aantal = grens * 2;
            PriemArray x      = new PriemArray(1, 200);

            aVullen();
            bVullen();
            a1       = a;
            a2       = new int[a1.Length];
            a1Tussen = new int[a1.Length];

            for (int i = 0; i < b.Length; i++)
            {
                for (int n = 1; stop == false; n++)
                {
                    for (int j = 0, pos = 0; j < aantal; j++)
                    {
                        if (x.PriemCheck(vgl(a1[j], b[i][0], n)))
                        {
                            a1Tussen[pos] = a1[j];
                            pos++;
                            count++;
                        }
                    }
                    aantal = count;
                    if (count < 11 && count > 0)
                    {
                        for (int k = 0; k < count; k++)
                        {
                            a2[k] = a1Tussen[k];
                        }
                    }
                    else if (count == 0)
                    {
                        b[i][1] = a2[0];
                        b[i][2] = n - 1;
                        stop    = true;
                    }
                    a1    = a1Tussen;
                    count = 0;
                }
                stop   = false;
                aantal = grens * 2;
                a1     = a;
            }

            hoogsteSchrijven(hoogste());
        }
Exemple #2
0
        static void bVullen()
        {
            PriemArray p = new PriemArray(-grens, grens);

            b = new int[p.PRIEMARRAY.Length][];

            for (int i = 0; i < p.PRIEMARRAY.Length; i++)
            {
                b[i] = new int[3] {
                    p.PRIEMARRAY[i], 0, 0
                };
            }
        }