OFFSET
1,1
COMMENTS
Primes p such that for some k, p = k + the sorted version of the base-10 digits of k.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(4) = 233 is a term because 233 = A070196(121) = 121 + 112 is prime.
a(5) = 277 is a term in three ways: 277 = 143 + 134 = 152 + 125 = 161 + 116.
MAPLE
f:= proc(n) local L, i;
L:= sort(convert(n, base, 10), `>`);
add(L[i]*10^(i-1), i=1..nops(L)) + n;
end proc:
select(t -> t < 10000 and isprime(t), map(f, {$1..9999}));
PROG
(Python)
from sympy import isprime
def aupto(LIMIT):
cands = set(k + int("".join(sorted(str(k)))) for k in range(LIMIT))
return sorted(k for k in cands if k <= LIMIT and isprime(k))
print(aupto(1200)) # Michael S. Branicky, Jan 15 2024
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Robert Israel, Jan 15 2024
STATUS
approved