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.

A063792 Subtractive primes: p = x1x2x3..xk is a k-digit prime in base 10 such that abs(x1-x2-x3-...-xk) is also a prime.

Original entry on oeis.org

2, 3, 5, 7, 13, 29, 31, 41, 47, 53, 61, 79, 83, 97, 103, 113, 131, 139, 151, 157, 193, 199, 223, 227, 241, 263, 269, 281, 317, 337, 353, 359, 373, 379, 397, 401, 409, 433, 443, 461, 463, 487, 503, 521, 557, 571, 593, 599, 601, 613, 617, 631, 647, 653
Offset: 1

Views

Author

Felice Russo, Aug 17 2001

Keywords

Examples

			269 belong to the sequence because |2 - 6 - 9| = |-13| = 13.
		

Programs

  • Mathematica
    okQ[n_] := Module[{idn = -1# & /@ IntegerDigits[n]}, PrimeQ[Plus @@ Rest[idn] - First[idn]]]; Select[Prime[Range[120]], okQ]
  • PARI
    SubD(x)= { local(s); s=0; while (x>9, s+=x-10*(x\10); x\=10); return(abs(s - x)) }
    { n=0; p=0; for (m=1, 10^9, p=nextprime(p+1); if(isprime(SubD(p)), write("b063792.txt", n++, " ", p); if (n==1000, break)) ) } \\ Harry J. Smith, Aug 31 2009

Extensions

Corrected by Harvey P. Dale, Aug 20 2001