login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A172508 Prime numbers such that the differences between any pair of digits is prime. 3

%I #12 Jan 22 2019 02:48:48

%S 2,3,5,7,13,29,31,41,47,53,61,79,83,97,163,257,461,479,503,613,631,

%T 641,683,853,863,947,2749,4297,4729

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

%C No further term between 4729 and 7368787 = A000040(500000). - _R. J. Mathar_, Feb 16 2010

%C 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

%p 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

%t Select[Prime[Range[638]],And@@PrimeQ[#[[1]]-#[[2]]&/@ Subsets[ IntegerDigits[ #],{2}]]&] (* _Harvey P. Dale_, Nov 29 2012 *)

%K nonn,base,fini,full

%O 1,1

%A _Claudio Meller_, Feb 05 2010

%E Three more terms from _R. J. Mathar_ and _Robert G. Wilson v_, Feb 16 2010

%E Edited by _N. J. A. Sloane_, Feb 24 2010

%E Keywords:fini,full added by _Ray Chandler_ and _R. J. Mathar_, Feb 25 2010

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 15:20 EDT 2024. Contains 371916 sequences. (Running on oeis4.)