View Single Post
 2020-12-24, 18:07 #4 kriesel     "TF79LL86GIMPS96gpu17" Mar 2017 US midwest 7·719 Posts Repdigits and near-repdigits Repdigits are numbers consisting only of repetition of the same digit value. (Single-digit numbers are excluded by definition.) For Mersennes' exponents, digit values larger than one lead to composite exponents, and thereby to composite Mersenne numbers. Composite digit counts also lead to composite exponents and composite Mersenne numbers. This leaves exponents consisting of a prime number of ones, which lead to mostly composite exponents. It also leads to a very small set of candidates, since for p<109, number of digits no greater than 9, only 2, 3, 5, or 7 digits are prime length for exponent expressed in base ten. In 10, base 10 use ntheory; $count=0; for ($i=1; $i<10;$i++ ) { #repfield is $i as digits x 8 places foreach$j ( 1, 3, 7, 9 ) { #rightmost if ($i !=$j ) { $k=$i*11111111*10+$j; if ( Math::Prime::Util::GMP::is_prime($k) == 0 ) { # print "$k is composite\n"; } else { print "$k\n"; $count++; } } } } print "Counted$count\n(end)\n"; Requiring the differing digit to be on the right is a special case / subset of the near-repdigit definition. Checking for other positions of the differing digit, and annotating the resulting output with current status: Code: # nearrep2.pl # perl script to find near repdigit exponents i..iji..i, j != i, i>0, base 10 # where leftmost digit may be j but rightmost is not use ntheory; $count=0; for ($l=1; $l<9;$l++ ) { #power of ten at which digit differs for ( $j=0;$j<10; $j++ ) { #differing digit foreach$i ( 1, 3, 7, 9 ) { #repfield is $i as digits x 8 places if ($i != $j ) {$k= $i*111111111 +($j- $i) *10**$l; if ( Math::Prime::Util::GMP::is_prime($k) == 0 ) { # print "$k is composite\n"; } else { print "$k\n";$count++; } } } } } print "Counted \$count\n(end)\n"; Code: 333333313 factored 999999929 NF 85; P-1 NF; TF in progress 111111131 factored 111111181 LL C 777777577 factored 999999599 factored 777777677 factored 333331333 factored 999992999 NF 85, TF in progress 111113111 factored 333334333 factored 777776777 NF 85, P-1 NF, PRP in progress 777767777 factored 111181111 factored 111191111 factored 333233333 factored 999299999 NF 86, P-1 NF, PRP in progress 999499999 factored 999599999 NF 86, P-1 NF, PRP in progress 333733333 factored 333833333 factored 115111111 factored 776777777 factored 337333333 NF 81; P-1 NF, PRP C, CERT 118111111 LL C 778777777 factored 998999999 NF 86; P-1 NF, PRP in progress 101111111 factored 131111111 factored 373333333 factored 787777777 factored 577777777 factored 799999999 NF 85; P-1 NF; PRP assigned prematurely but no progress Counted 33 (end) 23 factored, 2 LL composite primality test result, 8 remaining to be determined in the list immediately above. Top of reference tree: https://www.mersenneforum.org/showpo...22&postcount=1 Last fiddled with by kriesel on 2021-03-29 at 14:07 Reason: status updated