This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A249448 #25 Jun 20 2023 15:34:50 %S A249448 7,89,991,9967,99991,999983,9999971,99999989,999999937,9999999943, %T A249448 99999999821,999999999989,9999999999971,99999999999923, %U A249448 999999999999883,9999999999999851,99999999999999997,999999999999999967,9999999999999999919,99999999999999999989,999999999999999999829 %N A249448 Largest n-digit prime whose digit sum is also prime. %C A249448 Subsequence of A046704 (primes with digit sum being prime). %C A249448 Some terms of this sequence are also in A003618, the largest n-digit primes. %H A249448 Paolo P. Lava, <a href="/A249448/b249448.txt">Table of n, a(n) for n = 1..100</a> %e A249448 a(1) = 7 because it is the largest prime with just one digit. %e A249448 a(2) = 89 because it is the largest prime with 2 digits whose sum, 8 + 9 = 17, is a prime. %e A249448 Again, a(7) = 9999971 because it is the largest prime with 7 digits whose sum is a prime: 9 + 9 + 9 + 9 + 9 + 7 + 1 = 53. %p A249448 P:=proc(q) local a,b,k,n; for k from 0 to q do %p A249448 for n from 10^(k+1)-1 by -1 to 10^k do if isprime(n) then a:=n; b:=0; %p A249448 while a>0 do b:=b+(a mod 10); a:=trunc(a/10); od; %p A249448 if isprime(b) then print(n); break; fi; fi; %p A249448 od; od; end: P(10^3); %t A249448 Table[Module[{p=NextPrime[10^n,-1]},While[!PrimeQ[Total[IntegerDigits[p]]],p=NextPrime[p,-1]];p],{n,25}] (* _Harvey P. Dale_, Jun 20 2023 *) %o A249448 (PARI) a(n) = {p = precprime(10^n); while (!isprime(sumdigits(p)), p = precprime(p-1)); p;} \\ _Michel Marcus_, Oct 29 2014 %Y A249448 Cf. A046704, A103545, A249447. %K A249448 nonn,base %O A249448 1,1 %A A249448 _Paolo P. Lava_, Oct 29 2014