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.

A253216 Smallest of four primes in arithmetic progression with common difference 6 and digit sum prime.

Original entry on oeis.org

1091, 15791, 30091, 369991, 421691, 501191, 661091, 1101091, 1539991, 2042591, 2210291, 2542091, 2811191, 3351191, 3512291, 3864691, 4411391, 4675591, 5960791, 5992291, 5998691, 6884191, 6918391, 7516891, 8608591, 8697791, 9297091, 9622891, 9646291, 12013091
Offset: 1

Views

Author

K. D. Bajpai, Dec 29 2014

Keywords

Examples

			a (1) = 1091: 1091 + 6 = 1097; 1097 + 6 = 1103; 1103 + 6 = 1109; all four are prime. Their digit sums 1+0+9+1 = 11; 1+0+9+7 = 17; 1+1+0+3 = 5 and 1+1+0+9 = 11 are also prime.
a(2) = 15791: 15791 + 6 = 15797; 15797 + 6 = 15803; 15803 + 6 = 15809; all four are prime. Their digit sums 1+5+7+9+1 = 23, 1+5+7+9+7 = 29, 1+5+8+0+3 = 17 and 1+5+8+0+9 = 23 are also prime.
		

Crossrefs

Programs

  • Mathematica
    A253216 = {}; Do[d = 6; k = Prime[n]; k1 = k + d; k2 = k + 2d; k3 = k + 3d; If[PrimeQ[k1] && PrimeQ[k2] && PrimeQ[k3] && PrimeQ[Plus @@ IntegerDigits[k]] && PrimeQ[Plus @@ IntegerDigits[k1]] && PrimeQ[Plus @@ IntegerDigits[k2]] && PrimeQ[Plus @@ IntegerDigits[k3]], AppendTo[A253216, k]], {n, 1000000}]; A253216
    prQ[{a_,b_,c_,d_}]:=AllTrue[{b,c,d},PrimeQ]&&AllTrue[Total/@ (IntegerDigits/@ {a,b,c,d}),PrimeQ]; Select[#+{0,6,12,18}& /@Prime[Range[800000]],prQ][[All,1]] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, May 26 2018 *)
  • PARI
    for( n=1, 10^6, k=prime(n); k1=k+6; k2=k+12; k3=k+18; if(isprime(k1)&isprime(k2)&isprime(k3) &isprime(eval(Str(sumdigits(k)))) &isprime(eval(Str(sumdigits(k1)))) &isprime(eval(Str(sumdigits(k2)))) &isprime(eval(Str(sumdigits(k3)))), print1(k,", ")))

Extensions

Definition corrected by Harvey P. Dale, May 26 2018