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!)
A116066 Numbers k such that both k and the k-th prime have nondecreasing digits. 4
1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 15, 17, 19, 22, 24, 33, 34, 35, 37, 39, 46, 48, 49, 55, 57, 59, 68, 69, 77, 88, 123, 188, 189, 222, 229, 237, 239, 246, 247, 249, 266, 278, 333, 336, 337, 345, 346, 348, 355, 357, 367, 388, 477, 489, 499, 669, 1117, 1346, 1347, 1348 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..97 (all terms < 10^9)
EXAMPLE
p(237) = 1489.
MATHEMATICA
Select[Range[1500], Min[Differences[IntegerDigits[#]]]>=0&&Min[ Differences[ IntegerDigits[Prime[#]]]]>=0&] (* Harvey P. Dale, May 14 2019 *)
PROG
(Python)
from sympy import sieve
from itertools import count, islice, combinations_with_replacement as mc
def nd(n): s = str(n); return s == "".join(sorted(s))
def bgen(d): yield from map(int, ("".join(m) for m in mc("123456789", d)))
def agen():
for d in count(1):
yield from (k for k in bgen(d) if nd(sieve[k]))
print(list(islice(agen(), 60))) # Michael S. Branicky, Jun 26 2022
CROSSREFS
Sequence in context: A171827 A322002 A107743 * A261874 A334929 A008816
KEYWORD
nonn,base
AUTHOR
Giovanni Resta, Feb 13 2006
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 April 25 11:21 EDT 2024. Contains 371967 sequences. (Running on oeis4.)