OFFSET
1,2
COMMENTS
No terms contain digit 9 before a non-9. - Robert Israel, May 20 2020
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
12348 is in the sequence because 8 (its largest digit) plus 9 (the largest digit of 12349) equals 17 (a prime).
MAPLE
N:= 500: # to get terms <= N
L:= map(t -> max(convert(t, base, 10)), [$1..N+1]):
LL:= L[1..-2]+L[2..-1]:
select(t -> member(LL[t], {2, 3, 5, 7, 11, 13, 17}), [$1..N]); # Robert Israel, May 20 2020
MATHEMATICA
ldQ[n_]:=Module[{ldn=Max[IntegerDigits[n]], ldn1=Max[IntegerDigits[ n+1]]}, PrimeQ[ldn+ldn1]]; Select[Range[150], ldQ] (* Harvey P. Dale, Apr 29 2011 *)
PROG
(PARI) isok(m) = isprime(vecmax(digits(m))+vecmax(digits(m+1))); \\ Michel Marcus, May 20 2020
(Python)
def ok(n): return int(max(str(n))) + int(max(str(n+1))) in {2, 3, 5, 7, 11, 13, 17}
print([k for k in range(147) if ok(k)]) # Michael S. Branicky, Aug 03 2022
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
Jason Earls, Jul 16 2004
STATUS
approved