login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 56th year, we are closing in on 350,000 sequences, and we’ve crossed 9,700 citations (which often say “discovered thanks to the OEIS”).

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A343675 Undulating alternating palindromic primes. 3
2, 3, 5, 7, 101, 181, 383, 727, 787, 929, 10301, 10501, 14341, 16361, 16561, 18181, 30103, 30703, 32323, 36563, 38183, 38783, 70507, 72727, 74747, 78787, 90709, 94949, 96769, 1074701, 1092901, 1212121, 1218121, 1412141, 1616161, 1658561, 1856581, 1878781, 3072703 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

COMMENTS

All terms have an odd number of decimal digits.

For n > 3, a(n) is odd and not divisible by 5.

Intersection of A002385, A030144 and A059168.

Subsequence of A343590.

LINKS

Chai Wah Wu, Table of n, a(n) for n = 1..10000

EXAMPLE

16361 is a term as it is a palindromic prime, the digits 1, 6, 3, 6 and 1 have odd and even parity alternately, and also alternately rise and fall.

MATHEMATICA

Union@Flatten[{{2, 3, 5, 7}, Array[Select[FromDigits/@Riffle@@@Tuples[{Tuples[{1, 3, 5, 7, 9}, #], Tuples[{0, 2, 4, 6, 8}, #-1]}], (s=Union@Partition[Sign@Differences@IntegerDigits@#, 2]; (s=={{1, -1}}||s=={{-1, 1}})&&PrimeQ@#&&PalindromeQ@#)&]&, 4]}] (* Giorgos Kalogeropoulos, Apr 26 2021 *)

PROG

(Python)

from sympy import isprime

def f(w):

    for s in w:

        for t in range(int(s[-1])+1, 10, 2):

            yield s+str(t)

def g(w):

    for s in w:

        for t in range(1-int(s[-1])%2, int(s[-1]), 2):

            yield s+str(t)

A343675_list = [2, 3, 5, 7]

for l in range(1, 9):

    for d in '1379':

        x = d

        for i in range(1, l+1):

            x = g(x) if i % 2 else f(x)

        A343675_list.extend([int(p+p[-2::-1]) for p in x if isprime(int(p+p[-2::-1]))])

        y = d

        for i in range(1, l+1):

            y = f(y) if i % 2 else g(y)

        A343675_list.extend([int(p+p[-2::-1]) for p in y if isprime(int(p+p[-2::-1]))])

CROSSREFS

Cf. A002385, A030144, A059168, A343590.

Sequence in context: A092908 A050784 A030150 * A029977 A052019 A205529

Adjacent sequences:  A343672 A343673 A343674 * A343676 A343677 A343678

KEYWORD

nonn,base

AUTHOR

Chai Wah Wu, Apr 25 2021

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 December 6 16:17 EST 2021. Contains 349567 sequences. (Running on oeis4.)