cp's OEIS Frontend

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.

A356570 a(n) is the first prime that starts a sequence of exactly n consecutive primes that are in A048519.

This page as a plain text file.
%I A356570 #11 Sep 04 2022 12:52:16
%S A356570 19,11,97,72461,346373,2587093,1534359019,1010782220887
%N A356570 a(n) is the first prime that starts a sequence of exactly n consecutive primes that are in A048519.
%C A356570 a(n) = prime(k) for the least possible k such that prime(i) for k <= i < k+n has the property that it plus its digit sum is prime, but prime(k-1) and prime(k+n) do not have the property.
%e A356570 a(3) = 97 because 97, 101, 103 are 3 consecutive primes with 97+9+7 = 113, 101+1+0+1 = 103, 103+1+0+3=107, all prime, but the prime before 97 is 89 and the prime after 103 is 107, and 89+8+9 = 106 and 107+1+0+7 = 115 are not prime; 97 is the least prime for which this works.
%p A356570 N:= 6: # for a(1)..a(N)
%p A356570 V:= Vector(N): count:= 0:
%p A356570 p:= 2: s:= 0:
%p A356570 while count < N do
%p A356570   p:= nextprime(p)
%p A356570   if isprime(p+convert(convert(p,base,10),`+`)) then
%p A356570   if s = 0 then q:= p fi;
%p A356570   s:= s+1
%p A356570 else
%p A356570   if s >= 1 and s <= N and V[s] = 0 then
%p A356570     V[s]:= q; count:= count+1
%p A356570   fi;
%p A356570   s:= 0
%p A356570 fi
%p A356570 od:
%p A356570 convert(V,list);
%t A356570 seq[len_, pmax_] := Module[{s = Table[0, {len}], v = {}, p = 2, c = 0, pfirst = 2, i}, While[c < len && p < pmax, If[PrimeQ[p + Plus @@ IntegerDigits[p]], AppendTo[v, p]; If[pfirst == 0, pfirst = p], i = Length[v]; v = {}; If[0 < i <= len && s[[i]] == 0, s[[i]] = pfirst]; pfirst = 0]; p = NextPrime[p]]; s]; seq[6, 10^7] (* _Amiram Eldar_, Aug 14 2022 *)
%Y A356570 Cf. A048519.
%K A356570 nonn,base,more
%O A356570 1,1
%A A356570 _J. M. Bergot_ and _Robert Israel_, Aug 12 2022
%E A356570 a(8) from _Amiram Eldar_, Aug 15 2022