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!)
A068831 Primes with all odd digits such that the next three primes also contain all odd digits. 3
3, 5, 7, 11, 191, 311, 313, 9133, 9371, 11113, 11171, 15731, 15937, 15959, 17939, 17957, 19319, 19553, 19739, 19973, 19979, 31151, 31333, 31511, 33353, 35573, 35753, 39113, 39119, 39937, 51131, 51133, 51971, 53717, 53719, 53731, 55313, 55331 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
EXAMPLE
313 belongs to this sequence as the next three primes 317, 331 and 337 contain only odd digits.
MATHEMATICA
odQ[n_] := And @@ OddQ[Flatten[IntegerDigits[Join[{n}, Table[NextPrime[n, k], {k, 3}]]]]]; Select[Prime[Range[5700]], odQ] (* Jayanta Basu, Aug 07 2013 *)
Prime[#]&/@SequencePosition[Table[If[AllTrue[IntegerDigits[p], OddQ], 1, 0], {p, Prime[Range[ 6000]]}], {1, 1, 1, 1}][[;; , 1]] (* Harvey P. Dale, Apr 02 2023 *)
PROG
(Magma) [NthPrime(n): n in [1..10^4] | forall{NthPrime(n+i): i in [0..3] | Intseq(NthPrime(n+i)) subset [1..9 by 2]}]; // Bruno Berselli, Aug 08 2013
(Python)
from itertools import product
from sympy import isprime, nextprime
A068831_list = [p for p in (int(''.join(d)) for l in range(1, 9) for d in product('13579', repeat=l)) if isprime(p) and set(str(nextprime(p, 1))) <= {'1', '3', '5', '7', '9'} and set(str(nextprime(p, 2))) <= {'1', '3', '5', '7', '9'} and set(str(nextprime(p, 3))) <= {'1', '3', '5', '7', '9'} ] # Chai Wah Wu, Aug 13 2015
CROSSREFS
Sequence in context: A088051 A159471 A068113 * A109862 A069804 A245722
KEYWORD
nonn,base
AUTHOR
Amarnath Murthy, Mar 09 2002
EXTENSIONS
Missing term a(19)=19739 supplied by Jayanta Basu, Aug 07 2013
STATUS
approved

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 May 7 06:31 EDT 2024. Contains 372300 sequences. (Running on oeis4.)