MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

compound symmetrical primes

  • To: mathgroup at smc.vnet.net
  • Subject: [mg66482] compound symmetrical primes
  • From: János <janos.lobb at yale.edu>
  • Date: Mon, 15 May 2006 23:49:16 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Let's say that a prime is symmetrical if prime==FromDigits[Reverse 
[IntegerDigits[prime]]].

I would say a prime is compound if two contiguous distinct subsets of  
its digits are summing up to the same number.  For example 211 is a  
compound prime because 2=1+1.  Similarly 15877 is a compound prime  
because 1+5+8=7+7.  May be there is a better definition in the prime  
literature.  The two distinct subset has to cover all the digits.

Here is a little program that that looks for symmetrical compound  
primes up to an mx limit.

In[14]:=
lst = Timing[First[
     Last[Reap[i = 1;
        mx = 10^6; While[
         i <= mx,
         pr = Prime[i];
          If[pr != FromDigits[
           Reverse[
           IntegerDigits[
           pr]]], i++;
           Continue[]; ];
          prdig =
           IntegerDigits[pr];
          prlen = Length[
           prdig]; j = 1;
          While[j < prlen,
           prLeft = Take[
           prdig, {1, j}];
           prRight = Take[
           prdig, {j + 1,
           prlen}];
           If[Total[prLeft] !=
           Total[prRight],
           j++; Continue[],
           Sow[pr]; Break[
           ]]; ]; i++; ]; ]]]]
Out[14]=
{31.687534999999997*Second,
   {11, 101, 16061, 31013,
    35053, 38083, 73037,
    74047, 91019, 94049,
    1120211, 1150511, 1160611,
    1180811, 1190911, 1250521,
    1280821, 1300031, 1360631,
    1390931, 1490941, 1520251,
    1550551, 1580851, 1600061,
    1630361, 1640461, 1660661,
    1670761, 1730371, 1820281,
    1880881, 1930391, 1970791,
    3140413, 3160613, 3260623,
    3310133, 3380833, 3400043,
    3460643, 3470743, 3590953,
    3670763, 3680863, 3970793,
    7100017, 7190917, 7250527,
    7300037, 7310137, 7540457,
    7600067, 7630367, 7690967,
    7750577, 7820287, 7850587,
    7930397, 7960697, 9110119,
    9200029, 9230329, 9280829,
    9320239, 9400049, 9440449,
    9470749, 9610169, 9620269,
    9650569, 9670769, 9700079,
    9770779, 9820289, 9980899}}

Here are a few questions:

Is there any compound symmetrical prime other than 11 whose length is  
even ?

Is there any compound symmetrical prime where the middle digit is not  
zero ?

Is there a much faster algorithm to find these numbers ?  /I am  
mostly procedural here :) because I could not find a functional check  
for compoundness. /
I searched up to mx=10^8 and on my little iBook it took the whole night.

Let's say a number is periodical if it is a repetition of a subset of  
its digits .  For example 11 and 232323 are periodic numbers.

Is 11 the only periodical symmetrical compound prime ?

Thanks ahead,

János


  • Prev by Date: Re: Re: level curve selection
  • Next by Date: Re: Re: Save to Quicktime during calculations?
  • Previous by thread: Re: ViewPoint selector
  • Next by thread: Re: compound symmetrical primes