OFFSET
1,1
COMMENTS
Each term in the sequence must have an even number of digits to allow comparison of its two halves. Minimum four-digit term is 1021, maximum is 9887; minimum six-digit term is 100411, maximum is 998551.
EXAMPLE
1021 belongs to the sequence as it is prime and the consecutive digits in its left and right halves (10 and 21, respectively) have the same pattern: 1 > 0, 2 > 1.
The prime number 100411 belongs to the sequence as the consecutive digits in its left half (100) and right half (411) have the same pattern: 1 > 0 = 0, 4 > 1 = 1.
MATHEMATICA
pt[w_] := Sign@ Differences@ w; ok[p_] := PrimeQ[p] && Block[{d = IntegerDigits[p], m}, m = Length[d]; EvenQ[m] && pt@ Take[d, m/2] == pt@ Take[d, -m/2]]; Select[ Range[1000, 1747], ok] (* Giovanni Resta, May 04 2018 *)
PROG
(Python)
#program to get all terms less than one million
def pattern(p):
l=len(p)
s=""
for k in range(l-1):
if p[k+1]>p[k]: s=s+"+"
elif p[k+1]<p[k]: s=s+"-"
else: s=s+"="
return(s)
def is_prime(num):
for k in range(2, num):
if (num % k) == 0:
return(0)
return(1)
for i in range(1000, 999999):
if len(str(i)) % 2 == 0:
p1=str(i)[0:int(len(str(i))/2)]
p2=str(i)[int(len(str(i))/2):len(str(i))]
if pattern(p1)==pattern(p2) and is_prime(i): print(i)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Pierandrea Formusa, May 02 2018
STATUS
approved