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-5 of 5 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

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

A053544 A052999 / 18.

Original entry on oeis.org

0, 0, 0, 0, 5, 1, 3, 5, 110, 11110, 1, 2, 20, 220, 220, 25, 25, 30, 30, 2, 2, 1, 4444444444444444444444444444440, 40, 1, 5, 4, 2, 5, 1, 8, 1, 2, 3, 15, 50, 23, 25, 25, 2, 1, 35, 40, 3, 1, 40, 45, 110, 100, 100, 155, 3, 10, 15, 1125, 100, 100, 8, 25, 30, 30, 3, 13, 10, 1, 8, 1, 2, 22, 5, 275, 13, 17, 2, 1, 150, 25, 1, 20
Offset: 1

Views

Author

N. J. A. Sloane, Mar 16 2000

Keywords

Crossrefs

Extensions

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

A052507 Take n-th palindromic 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, 0, 18, 180, 180, 0, 630, 630, 720, 720, 18, 18, 0, 36, 360, 360, 0, 450, 450, 180, 180, 90, 90, 180, 180, 720, 72, 72, 0, 198, 702, 1998, 17010, 17010, 39600, 900, 900, 540, 5400, 44100, 900, 900, 18, 180, 180, 0, 180, 1800, 9900, 17100, 17100
Offset: 1

Views

Author

Enoch Haga, Mar 17 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.
Computation of this sequence is more complicated than the Name implies. Taking each palindromic prime in turn (i.e., primes from A002385), find all permutations of its digits (without leading 0's) which are also prime (obviously there will be at least 1 such permutation). This gives the terms of A052480. Then considering each of those primes apply the rule in the Name to determine q or r or 0. - Sean A. Irvine, Nov 23 2021

Examples

			a(8)=180 because the distance from 131 to 311 is 180.
		

Crossrefs

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-5 of 5 results.