login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A260343 Numbers n such that the base-n number formed by concatenating the base-n numbers 1 2 ... n-1 n n-1 ... 2 1 is prime. 19
2, 3, 4, 6, 9, 10, 16, 40, 104, 8840 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

COMMENTS

n = 8840 only corresponds to a probable prime (with 69770 decimal digits).

The concatenation (in base n) of the base-n numbers 1 2 3 ... k-1 k k-1 ... 3 2 1 is a square for k<n, so the case k=n, the subject of this sequence, is the first time a prime is possible.

Sequence A260852 lists the actual primes, A260852(k) = A260851(a(k)). - M. F. Hasler, Aug 02 2015

LINKS

Table of n, a(n) for n=1..10.

D. Broadhurst, Primes from concatenation: results and heuristics, NmbrThry List, August 1, 2015

EXAMPLE

For n = 2 we get the binary number 1 10 1 = 1101 = 13 (in decimal).

For n = 10 we get (as David Broadhurst remarks) the "memorable" decimal prime 12345678910987654321.

For n = 16 the prime is the hexadecimal number 123456789abcdef10fedcba987654321.

MATHEMATICA

Select[Range[2, 120], PrimeQ@ Total[Times @@@ Transpose[{(Function[p, Power[#, p]] /@ Reverse@ Delete[Range[0, 2 # - 1], # + 1]), Flatten@ {Range[#], Reverse@ Range[# - 1]}}]] &] (* Michael De Vlieger, Aug 02 2015 *)

PROG

(Python)

from gmpy2 import is_prime

def intbase(dlist, b=10): # convert list of digits in base b to integer

    y = 0

    for d in dlist:

        y = y*b + d

    return y

A260343_list = [n for n in range(2, 500) if is_prime(intbase(list(range(1, n))+[1, 0]+list(range(n-1, 0, -1)), n))] # Chai Wah Wu, Aug 01 2015

(PARI) for(b=2, 9e9, ispseudoprime(p=(1+b*c=(b^b-1)\(b-1))*(c-b+1)-1)&&print1(b", ")); \\ D. Broadhurst and M. F. Hasler, Aug 02 2015

CROSSREFS

For n=2 see A173427, for n=10 see A173426.

For n=3 through n=16 see A260853 - A260866.

Sequence in context: A239580 A175515 A241241 * A215818 A132600 A163627

Adjacent sequences:  A260340 A260341 A260342 * A260344 A260345 A260346

KEYWORD

nonn,base,more

AUTHOR

N. J. A. Sloane, Aug 01 2015

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified November 17 08:39 EST 2019. Contains 329217 sequences. (Running on oeis4.)