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.

Showing 1-4 of 4 results.

A052902 Take n-th prime p, let P = all primes that can be obtained by permuting the digits of p and possibly omitting zeros; a(n) = |p-q| where q in P is the closest to p but different from p (a(n)=0 if no such q exists).

Original entry on oeis.org

0, 0, 0, 0, 0, 18, 54, 0, 0, 0, 18, 36, 0, 0, 0, 0, 0, 0, 0, 54, 36, 18, 0, 0, 18, 90, 72, 36, 90, 18, 144, 18, 36, 54, 270, 0, 414, 450, 450, 36, 18, 630, 720, 54, 18, 720, 0, 0, 0, 0, 0, 54, 180, 270, 0, 0, 0, 144, 450, 540, 540, 54, 234, 180, 18, 144, 18, 36, 396, 90, 0, 234, 306
Offset: 1

Views

Author

N. J. A. Sloane, Mar 16 2000

Keywords

Examples

			a(6)=18 since 6th prime is 13 and 31-13=18. a(25)=90 since 23rd prime is 101 and 101-11=90.
		

Crossrefs

Programs

  • Mathematica
    pdp[n_]:=Module[{p1=FromDigits/@Permutations[IntegerDigits[n]],p2=FromDigits/@ Permutations[ Select[IntegerDigits[n],#>0&]],p3},p3=Select[ Union[ Join[ p1,p2]],PrimeQ[#]&&#!=n&];If[Length[p3]==0,0,First[Abs[Nearest[p3,n]-n]]]]; Table[pdp[n],{n,Prime[Range[80]]}] (* Harvey P. Dale, Nov 11 2016 *)

Extensions

More terms from Asher Auel, May 12 2000

A052495 Take n-th prime p, let P = all primes having same digits; a(n) = q-p where q is smallest prime in P >p if q exists; otherwise a(n) = p-r where r is largest prime in P

Original entry on oeis.org

0, 0, 0, 0, 0, 18, 54, 0, 0, 0, 18, 36, 0, 0, 0, 0, 0, 0, 0, 54, 36, 18, 0, 0, 18, 0, 0, 594, 0, 18, 144, 180, 36, 54, 270, 0, 414, 450, 450, 144, 18, 630, 720, 54, 522, 720, 0, 0, 0, 0, 0, 54, 180, 270, 0, 0, 0, 144, 450, 540, 540, 54, 0, 180, 18, 144, 18, 36, 396, 90, 0, 234
Offset: 1

Views

Author

Enoch Haga, Mar 16 2000

Keywords

Comments

The primes in P are required to have the same number of digits as p; thus internal 0's must remain internal 0's.

Examples

			a(41)=18 because the 41st prime is 179. The primes having these digits are 179, 197, 719 and 971. The distance from 179 to 197 = 18.
		

Crossrefs

A052999 Take n-th prime p, let P(p) = all primes that can be obtained by permuting the digits of p and possibly adding or omitting zeros; a(n) = |p-q| where q in P(p) is the closest to p but different from p (a(n)=0 if no such q exists).

Original entry on oeis.org

0, 0, 0, 0, 90, 18, 54, 90, 1980, 199980, 18, 36, 360, 3960, 3960, 450, 450, 540, 540, 36, 36, 18, 79999999999999999999999999999920, 720, 18, 90, 72, 36, 90, 18, 144, 18, 36, 54, 270, 900, 414, 450, 450, 36, 18, 630, 720, 54, 18, 720, 810, 1980, 1800, 1800, 2790, 54, 180, 270, 20250, 1800, 1800, 144
Offset: 1

Views

Author

N. J. A. Sloane, Mar 16 2000

Keywords

Comments

Conjecture: a(n) > 0 for n > 4. - Sean A. Irvine, Nov 23 2021

Examples

			a(6)=18 since 6th prime is 13 and 31-13=18. a(9)=1980 because 9th prime is 23 and the smallest prime in P(6) different from 23 is 2003; 2003-23=1980.
a(23)=(8*10^31+3)-83 because 8*10^31+3 is closest prime distinct from 83 but in P(83). - _Sean A. Irvine_, Nov 23 2021
		

Crossrefs

Extensions

More terms from Asher Auel, May 12 2000
a(23) corrected by Sean A. Irvine, Nov 23 2021

A052998 A052902 / 18.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 3, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 3, 2, 1, 0, 0, 1, 5, 4, 2, 5, 1, 8, 1, 2, 3, 15, 0, 23, 25, 25, 2, 1, 35, 40, 3, 1, 40, 0, 0, 0, 0, 0, 3, 10, 15, 0, 0, 0, 8, 25, 30, 30, 3, 13, 10, 1, 8, 1, 2, 22, 5, 0, 13, 17, 2, 1, 0, 25, 1, 20, 0, 4, 10, 0, 0, 5, 0, 0, 5, 10, 10, 10, 26, 0, 4, 0
Offset: 1

Views

Author

N. J. A. Sloane, Mar 16 2000

Keywords

Crossrefs

Extensions

More terms from Asher Auel, May 12 2000
Showing 1-4 of 4 results.