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.

A172508 Prime numbers such that the differences between any pair of digits is prime.

Original entry on oeis.org

2, 3, 5, 7, 13, 29, 31, 41, 47, 53, 61, 79, 83, 97, 163, 257, 461, 479, 503, 613, 631, 641, 683, 853, 863, 947, 2749, 4297, 4729
Offset: 1

Views

Author

Claudio Meller, Feb 05 2010

Keywords

Comments

No further term between 4729 and 7368787 = A000040(500000). - R. J. Mathar, Feb 16 2010
As Robert G. Wilson v points out, there are only 4 different single-digit primes, 2, 3, 5 and 7. Therefore the difference between any pair of a term cannot be zero; the terms can only have a maximum of 5 different digits. A full search covering this range shows that the sequence terminates with the 4729. - R. J. Mathar, Feb 25 2010

Programs

  • Maple
    isA172508 := proc(n) local res,dgs,k,l ; dgs := convert(n,base,10) ; if nops(dgs) < 2 or not isprime(n) then return false; else for k from 1 to nops(dgs)-1 do for l from k+1 to nops(dgs) do if not isprime(abs( op(k,dgs)-op(l,dgs) )) then return false; end if; end do ; end do ; end if; return true; end proc: for i from 1 to 500000 do p := ithprime(i) : if isA172508(p) then printf("%d,\n",p) ; end if; end do: # R. J. Mathar, Feb 16 2010
  • Mathematica
    Select[Prime[Range[638]],And@@PrimeQ[#[[1]]-#[[2]]&/@ Subsets[ IntegerDigits[ #],{2}]]&] (* Harvey P. Dale, Nov 29 2012 *)

Extensions

Three more terms from R. J. Mathar and Robert G. Wilson v, Feb 16 2010
Edited by N. J. A. Sloane, Feb 24 2010
Keywords:fini,full added by Ray Chandler and R. J. Mathar, Feb 25 2010