login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 


A104154
For each natural number n: if the last digit of n is not zero and A004086(n) is prime, append A004086(n) to the sequence.
2
2, 3, 5, 7, 11, 31, 41, 61, 71, 13, 23, 43, 53, 73, 83, 17, 37, 47, 67, 97, 19, 29, 59, 79, 89, 101, 401, 601, 701, 211, 311, 811, 911, 421, 521, 821, 131, 331, 431, 631, 241, 541, 641, 941, 151, 251, 751, 461, 661, 761, 271, 571, 971, 181, 281, 881
OFFSET
1,1
COMMENTS
Equivalently, these are the prime numbers ordered by their reversal. - Rémy Sigrist, Feb 13 2022
LINKS
EXAMPLE
The last digit of 13 is not '0' and 31 is prime, therefore we append 31.
MATHEMATICA
a = Select[Range[196], IntegerDigits[ # ][[ -1]] != 0 && PrimeQ[FromDigits[Reverse[ IntegerDigits[ # ]]]] &]; b = {}; For[n = 1, n < Length[a] + 1, n++, AppendTo[b, FromDigits[Reverse[IntegerDigits[a[[n]]]]]]]; b
PROG
(PARI) left(str, n) = { my(v, tmp, x); v =""; tmp = Vec(str); ln=length(tmp); if(n > ln, n=ln); for(x=1, n, v=concat(v, tmp[x]); ); return(v) } \\ Get the left n characters from string str
rev(str) = { local(tmp, s, j); tmp = Vec(Str(str)); s=""; forstep(j=length(tmp), 1, -1, s=concat(s, tmp[j])); return(s) } \\ Get the reverse of the input string
rprime(n) = { local(x, y, v); for(x=1, n, y=rev(x); v=Vec(y); if(left(y, 1)<> "0"&&isprime(eval(y)), print1(y", ")) ) }
(Python)
from itertools import count, islice
from sympy import primerange
def A104154_gen(): # generator of terms
yield from (int(d[::-1]) for l in count(1) for d in sorted(str(m)[::-1] for m in primerange(10**(l-1), 10**l)))
A104154_list = list(islice(A104154_gen(), 20)) # Chai Wah Wu, Feb 17 2022
CROSSREFS
Cf. A004087.
Sequence in context: A157158 A155833 A028867 * A123214 A119834 A095180
KEYWORD
nonn,base,look,easy
AUTHOR
Cino Hilliard, Mar 09 2005
EXTENSIONS
Edited by Stefan Steinerberger, Aug 01 2007
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | 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 September 23 00:23 EDT 2024. Contains 376140 sequences. (Running on oeis4.)