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!)
A116067 Numbers k such that both k and the k-th prime have nonincreasing digits. 4
1, 2, 3, 4, 5, 11, 20, 21, 64, 82, 83, 84, 86, 98, 100, 331, 720, 730, 732, 810, 821, 843, 921, 933, 940, 942, 970, 982, 983, 1100, 5540, 6442, 6542, 6644, 7331, 7411, 7433, 7440, 7442, 7443, 7511, 7520, 7530, 7531, 7620, 7630, 7641, 7642, 7644, 8210, 8500, 8510 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..82 (all terms < 10^8)
EXAMPLE
prime(7531) = 76543.
MATHEMATICA
Select[Range[9000], Max[Differences[IntegerDigits[#]]]< 1 && Max[ Differences[ IntegerDigits[Prime[#]]]]<1&] (* Harvey P. Dale, Oct 11 2021 *)
PROG
(Python)
from sympy import sieve
from itertools import count, islice, combinations_with_replacement as mc
def ni(n): s = str(n); return s == "".join(sorted(s, reverse=True))
def bgen(d):
ni = map(int, ("".join(m) for m in mc("9876543210", d)))
yield from sorted(k for k in ni if k != 0)
def agen():
for d in count(1):
yield from (k for k in bgen(d) if ni(sieve[k]))
print(list(islice(agen(), 52))) # Michael S. Branicky, Jun 26 2022
CROSSREFS
Sequence in context: A121432 A118968 A073528 * A063685 A006481 A118597
KEYWORD
nonn,base
AUTHOR
Giovanni Resta, Feb 13 2006
EXTENSIONS
a(51) and beyond from Michael S. Branicky, Jun 26 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 April 19 16:52 EDT 2024. Contains 371794 sequences. (Running on oeis4.)