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.

Original entry on oeis.org

19, 11, 97, 72461, 346373, 2587093, 1534359019, 1010782220887
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Aug 12 2022

Keywords

Comments

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.

Examples

			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.
		

Crossrefs

Cf. A048519.

Programs

  • Maple
    N:= 6: # for a(1)..a(N)
    V:= Vector(N): count:= 0:
    p:= 2: s:= 0:
    while count < N do
      p:= nextprime(p)
      if isprime(p+convert(convert(p,base,10),`+`)) then
      if s = 0 then q:= p fi;
      s:= s+1
    else
      if s >= 1 and s <= N and V[s] = 0 then
        V[s]:= q; count:= count+1
      fi;
      s:= 0
    fi
    od:
    convert(V,list);
  • Mathematica
    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 *)

Extensions

a(8) from Amiram Eldar, Aug 15 2022