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!)
A354839 Beginning with 0, smallest positive integer not yet in the sequence such that the concatenation of two digits of the sequence separated by a comma is prime. 0
0, 2, 3, 1, 7, 9, 70, 5, 30, 20, 21, 10, 22, 31, 11, 12, 32, 33, 13, 14, 15, 34, 16, 17, 18, 35, 36, 19, 71, 37, 38, 39, 72, 90, 23, 73, 74, 75, 91, 76, 77, 92, 93, 78, 94, 79, 700, 24, 100, 25, 95, 96, 101, 97, 98, 99, 701, 102, 300, 26, 103, 104, 105, 301 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,2
LINKS
EXAMPLE
a(4)=1 because this is the first number not in the sequence whose first digit is 3 (last digit of a(3)), concatenated with its first digit 1, is prime: 31.
a(14)=31 because this is the first number not in the sequence whose first digit is 2 (last digit of a(13)), concatenated with its first digit 3, is prime: 23.
PROG
(Python)
from sympy import isprime
from itertools import count, islice
def agen(): # generator of terms
aset, k, mink = {0}, 0, 1; yield 0
for n in count(2):
k, prevdig = mink, str(k%10)
while k in aset or not isprime(int(prevdig+str(k)[0])): k += 1
aset.add(k); yield k
while mink in aset: mink += 1
print(list(islice(agen(), 64))) # Michael S. Branicky, Jun 09 2022
CROSSREFS
Sequence in context: A118008 A256045 A173459 * A121637 A247370 A161847
KEYWORD
nonn,easy,base
AUTHOR
Carole Dubois, Jun 08 2022
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 June 30 04:58 EDT 2024. Contains 373861 sequences. (Running on oeis4.)