OFFSET
1,1
COMMENTS
If the first half of a prime's digits repeat in the second half (thus the number of digits d is even), by being prime they cannot repeat in any visually eye-catching, aesthetically pleasing order, which is frustrating. A d-digit number with an ordered repetition of digits abc...abc... is not prime because it is divisible by 10^(d/2)+1, while a d-digit number with a palindromic arrangement of digits is not prime because it is divisible by 11.
Such primes exist for d >= 6, of which at least two digits are distinct, and arranged such that the first half repeat, in a disorderly way, in the second half.
For d=6, 265 of the 68906 primes belong here: 10 occur in form aababa, 7 occur in the form abaaab, 10 occur in the form ababaa, 9 occur in the form abbbab, 66 occur in the form abcacb, 58 occur in the form abcbac, 68 occur in the form abcbca, and 37 occur in the form abccab.
To find terms for which the first part of the digits is k > 99, where k has qk digits, compute fp = k * 10^qk. Then permute the digits of k. Compute fp + [this permutation]. If it is prime, it is in the sequence. Terms will have 2 * qk digits. See example. - David A. Corneth, Jan 11 2018
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
EXAMPLE
From David A. Corneth, Jan 11 2018: (Start) To see which 6-digit numbers are in the sequence and start with 127, we see that 127 has 3 digits, so we compute 127 * 10^3 = 127000. We then permute the digits of 127 to get {127, 172, 217, 271, 712, 721}. We discard the first one since we know it won't give a prime. For the other five, we compute 127000 + [that permutation].
We see that 127217 and 127271 are prime and hence are in the sequence. (End)
PROG
(PARI) is(n)=if(!isprime(n) || n == 11, return(0)); my(d=digits(n), t=#d, h=t\2); if(t>2*h, return(0)); vecsort(d[1..h]) == vecsort(d[h+1..t]) \\ Charles R Greathouse IV, Jan 10 2018
(PARI) starts(m) = my(l = List(), d = digits(m), fp = m * 10^#d, np, c); if(m < 100, return(Set(l))); for(i = 1, (#d)! - 1, np = numtoperm(#d, i); c = fp + fromdigits(vector(#d, j, d[np[j]])); if(isprime(c), listput(l, c))); Set(l) \\ David A. Corneth, Jan 11 2018
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
C Griffiths, Jan 10 2018
STATUS
approved