[go: up one dir, main page]

login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A297994 Primes such that the decimal digits in the first half of the number are a nontrivial permutation of the digits in the second half. 1

%I #22 Jan 18 2018 19:22:01

%S 107071,112121,113131,115151,119191,127217,127271,131113,131311,

%T 134341,136163,136361,137713,140401,142421,143413,145451,149419,

%U 149491,157571,158581,161611,163613,169691,170701,172127,172217,172721,173137,173713,178187,178781,178817,179719,179917,182821,187871,190901,191119,191911

%N Primes such that the decimal digits in the first half of the number are a nontrivial permutation of the digits in the second half.

%C 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.

%C 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.

%C 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.

%C 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

%H Charles R Greathouse IV, <a href="/A297994/b297994.txt">Table of n, a(n) for n = 1..10000</a>

%e 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].

%e We see that 127217 and 127271 are prime and hence are in the sequence. (End)

%o (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

%o (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

%K nonn,base,easy

%O 1,1

%A _C Griffiths_, Jan 10 2018

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 30 04:38 EDT 2024. Contains 375526 sequences. (Running on oeis4.)