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.

A146315 Prime differences of primes subtracted from nearest square.

Original entry on oeis.org

2, 7, 11, 13, 23, 29, 31, 47, 53, 59, 61, 79, 83, 89, 97, 127, 131, 137, 139, 167, 173, 179, 191, 193, 223, 227, 233, 239, 251, 293, 307, 311, 313, 317, 359, 383, 389, 397, 439, 443, 461, 467, 479, 547, 557, 563, 569, 571, 647, 653, 659, 673, 727, 743, 761, 773
Offset: 1

Views

Author

Enoch Haga, Oct 30 2008

Keywords

Comments

Terms in A146315 + A146316 produce a square

Examples

			a(6)=29 because when the prime 29 is subtracted from the square 36, the result is another prime, 7
		

Crossrefs

Programs

  • UBASIC
    10 'sq less pr are prime 20 N=1:O=1:C=1 30 A=3:S=sqrt(N) 40 B=N\A 50 if B*A=N then 120 60 A=A+2 70 if A<=S then 40 80 R=O^2:Q=R-N 90 if N31 then stop 120 N=N+2:if N
    				

Formula

{p in A000040: A068527(p) in A000040}. - R. J. Mathar, Sep 26 2011

A146316 Prime subtrahends of nearest squares producing prime differences.

Original entry on oeis.org

2, 2, 5, 3, 2, 7, 5, 2, 11, 5, 3, 2, 17, 11, 3, 17, 13, 7, 5, 2, 23, 17, 5, 3, 2, 29, 23, 17, 5, 31, 17, 13, 11, 7, 2, 17, 11, 3, 2, 41, 23, 17, 5, 29, 19, 13, 7, 5, 29, 23, 17, 3, 2, 41, 23, 11, 2, 47, 43, 41, 37, 23, 19, 17, 13, 53, 47, 41, 11, 5, 3, 2, 59, 53, 47, 5, 3, 2, 67, 59, 47, 37
Offset: 1

Views

Author

Enoch Haga, Oct 30 2008

Keywords

Comments

Terms in A146315 + A146316 produce a square

Examples

			a(6)=7 because when the prime 29 is subtracted from the square 36, the result is another prime, 7
		

Crossrefs

Programs

  • UBASIC
    10 'sq less pr are prime 20 N=1:O=1:C=1 30 A=3:S=sqrt(N) 40 B=N\A 50 if B*A=N then 120 60 A=A+2 70 if A<=S then 40 80 R=O^2:Q=R-N 90 if N31 then stop 120 N=N+2:if N
    				

A146317 Prime differences of primes subtracted from nearest cube.

Original entry on oeis.org

5, 3, 23, 17, 11, 5, 3, 89, 79, 67, 59, 53, 43, 37, 23, 19, 17, 5, 163, 139, 103, 79, 73, 13, 3, 2, 257, 239, 227, 191, 179, 173, 137, 113, 89, 71, 59, 53, 47, 29, 23, 17, 3, 367, 347, 281, 277, 269, 257, 241, 239, 229, 197, 179, 157, 149, 131, 127, 109, 107, 101, 71, 61
Offset: 1

Views

Author

Enoch Haga, Oct 30 2008

Keywords

Comments

Terms in A146317 + A146318 produce a cube

Examples

			a(3)=23 because when the prime 23 is subtracted from the cube 64, the result is another prime, 41
		

Crossrefs

Programs

  • Maple
    R:= NULL: count:= 0: p:= 1:
    while count < 100 do
      p:= nextprime(p);
      d:= ceil(p^(1/3))^3-p;
      if isprime(d) then count:= count+1; R:= R, d fi;
    od:
    R; # Robert Israel, Aug 06 2019
  • UBASIC
    10 'cu less pr are prime 20 N=1:O=1 30 A=3:S=sqrt(N) 40 B=N\A 50 if B*A=N then 120 60 A=A+2 70 if A<=S then 40 80 R=O^3:Q=R-N 90 if N
    				

A163850 Primes p such that their distance to the nearest cube above p and also their distance to the nearest cube below p are prime.

Original entry on oeis.org

3, 127, 24391, 29789, 328511, 2460373, 3048623, 9393929, 10503461
Offset: 1

Views

Author

Keywords

Comments

The two sequences A048763(p) and A048762(p), p=A000040(n), define
nearest cubes above and below each prime p. If p is in A146318, the
distance to the larger cube, A048763(p)-p, is prime. If p is
in the set {3, 11, 13, 19, 29, 67,...,107, 127, 223,..}, the distance to the lower
cube is prime. If both of these distances are prime, we insert p into the sequence.

Examples

			p=3 is in the sequence because the distance p-1=2 to the cube 1^3 below 3, and also the distance 8-p=5 to the cube 8=2^3 above p are prime.
p=127 is in the sequence because the distance p-125=2 to the cube 125=5^3 below p, and also the distance 216-p=89 to the cube 216=6^3 above p, are prime.
		

Crossrefs

Programs

  • Mathematica
    Clear[f,lst,p,n]; f[n_]:=IntegerPart[n^(1/3)]; lst={};Do[p=Prime[n];If[PrimeQ[p-f[p]^3]&&PrimeQ[(f[p]+1)^3-p],AppendTo[lst,p]],{n,9!}];lst
    dncQ[n_]:=Module[{c=Floor[Surd[n,3]]},AllTrue[{n-c^3,(c+1)^3-n},PrimeQ]]; Select[Prime[Range[230000]],dncQ] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Oct 16 2016 *)

Extensions

Edited, first 5 entries checked by R. J. Mathar, Aug 12 2009
Two more terms (a(8) and a(9)) from Harvey P. Dale, Oct 16 2016
Showing 1-4 of 4 results.