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

A277583 Goldbach's problem extended to squares of prime gaps (>=2): smallest integer >= ((A078587(n) - A078496(n))^2)/n for n >= 4.

Original entry on oeis.org

1, 4, 1, 10, 5, 2, 4, 14, 1, 12, 3, 2, 3, 9, 1, 31, 2, 1, 15, 7, 5, 6, 2, 3, 12, 20, 1, 19, 11, 2, 2, 5, 3, 4, 9, 1, 1, 15, 1, 54, 1, 1, 20, 4, 3, 12, 1, 6, 7, 3, 4, 11, 1, 2, 16, 10, 1, 22, 6, 2, 1, 3, 2, 3, 14, 1, 1, 9, 1, 2, 13, 1, 1, 2, 2, 17, 5, 1, 11, 28, 2, 7, 1, 10, 4, 15
Offset: 4

Views

Author

Juri-Stepan Gerasimov, Oct 22 2016

Keywords

Comments

Where A078587(n) + A078496(n) = 2n and A078587(n) < A078496(n).

Examples

			a(5) = 4 because ((A078587(5) - A078496(5))^2)/5 = ((3 - 7)^2)/5 < 4, where 3 (prime) = 7 (prime) = 2*5;
a(6) = 1 because ((A078587(6) - A078496(6))^2)/6 = ((5 - 7)^2)/6 < 1, where 5 (prime) + 7 (prime) = 2*6;
a(7) = 10 because ((A078587(7) - A078496(7))^2)/7 = ((3 - 11)^2)/7 < 10, where 3 (prime) + 11 (prime) = 2*7.
		

Crossrefs

Cf. A002375, A078496, A078587, A277581 (Goldbach's problem extended to squares of prime gaps >= 0).

Programs

  • Mathematica
    Table[k = 1; While[k < ((Last@ # - First@ #)^2)/n, k++] &@ Block[{p = n + 1, q}, q = 2 n - p; While[q > 0 && Nand[PrimeQ@ p, PrimeQ@ q], p++; q--]; {p, q}]; k, {n, 4, 89}] (* or *)
    Table[Ceiling[4 (n - #)^2/n] &@ Block[{p = n + 1, q}, q = 2 n - p; While[q > 0 && Nand[PrimeQ@ p, PrimeQ@ q], p++; q--]; p], {n, 4, 89}] (* Michael De Vlieger, Oct 26 2016, after T. D. Noe at A078587 and Michel Marcus PARI *)
  • PARI
    maxp(n) = {my(p = precprime(n-1)); while(!isprime(2*n-p), p = precprime(p-1)); p;}
    a(n) = ceil(4*(n - maxp(n))^2/n); \\ Michel Marcus, Oct 22 2016

A082467 Least k>0 such that n-k and n+k are both primes.

Original entry on oeis.org

1, 2, 1, 4, 3, 2, 3, 6, 1, 6, 3, 2, 3, 6, 1, 12, 3, 2, 9, 6, 5, 6, 3, 4, 9, 12, 1, 12, 9, 4, 3, 6, 5, 6, 9, 2, 3, 12, 1, 24, 3, 2, 15, 6, 5, 12, 3, 8, 9, 6, 7, 12, 3, 4, 15, 12, 1, 18, 9, 4, 3, 6, 5, 6, 15, 2, 3, 12, 1, 6, 15, 4, 3, 6, 5, 18, 9, 2, 15, 24, 5, 12, 3, 14, 9, 18, 7, 12, 9, 4, 15, 6, 7, 30, 9
Offset: 4

Views

Author

Benoit Cloitre, Apr 27 2003

Keywords

Comments

The existence of k>0 for all n >= 4 is equivalent to the strong Goldbach Conjecture that every even number >= 8 is the sum of two distinct primes.
n and k are coprime, because otherwise n + k would be composite. So the rational sequence r(n) = a(n)/n = k/n is injective. - Jason Kimberley, Sep 21 2011
Because there are arbitrarily many composites from m!+2 to m!+m, there are also arbitrarily large a(n) but they increase very slowly. The twin prime conjecture implies that infinitely many a(n) are 1. - Juhani Heino, Apr 09 2020

Examples

			n=10: k=3 because 10-3 and 10+3 are both prime and 3 is the smallest k such that n +/- k are both prime.
		

Crossrefs

Cf. A129301 (records), A129302 (where records occur).
Cf. A047160 (allows k=0).
Cf. A078611 (subset for prime n).

Programs

  • Magma
    A082467 := func; [A082467(n):n in [4..98]]; // Jason Kimberley, Sep 03 2011
  • Maple
    A082467 := proc(n) local k; k := 1+irem(n,2);
    while n > k do if isprime(n-k) then if isprime(n+k)
    then RETURN(k) fi fi; k := k+2 od; print("Goldbach erred!") end:
    seq(A082467(i),i=4..90); # Peter Luschny, Sep 21 2011
  • Mathematica
    f[n_] := Block[{k}, If[OddQ[n], k = 2, k = 1]; While[ !PrimeQ[n - k] || !PrimeQ[n + k], k += 2]; k]; Table[ f[n], {n, 4, 98}] (* Robert G. Wilson v, Mar 28 2005 *)
  • PARI
    a(n)=if(n<0,0,k=1; while(isprime(n-k)*isprime(n+k) == 0,k++); k)
    

Formula

A078496(n)-a(n) = A078587(n)+a(n) = n.

Extensions

Entries checked by Klaus Brockhaus, Apr 08 2007

A078496 Smallest prime p such that p>n and 2*n-p is also prime.

Original entry on oeis.org

5, 7, 7, 11, 11, 11, 13, 17, 13, 19, 17, 17, 19, 23, 19, 31, 23, 23, 31, 29, 29, 31, 29, 31, 37, 41, 31, 43, 41, 37, 37, 41, 41, 43, 47, 41, 43, 53, 43, 67, 47, 47, 61, 53, 53, 61, 53, 59, 61, 59, 61, 67, 59, 61, 73, 71, 61, 79, 71, 67, 67, 71, 71, 73, 83, 71, 73, 83, 73, 79
Offset: 4

Views

Author

Serhat Sevki Dincer (sevki(AT)ug.bilkent.edu.tr), Nov 26 2002

Keywords

Comments

Suggested by Goldbach Conjecture.
Values of q from A143697. This follows from the factorization n^2-k^2 = (n-k)(n+k).

Examples

			a(11)=17.
		

Crossrefs

a(n) = 2n - A078587(n).

Programs

  • Mathematica
    Table[p=n+1; q=2n-p; While[q>0&&!(PrimeQ[p]&&PrimeQ[q]), p++; q-- ]; p, {n, 4, 100}]
  • PARI
    a(n) = {my(p=nextprime(n+1)); while(!isprime(2*n-p), p = nextprime(p+1)); p;} \\ Michel Marcus, Oct 22 2016

Formula

n>3 integer; a(n)=min{p: p>n; p, 2*n-p are primes}.

Extensions

Edited by N. J. A. Sloane, Jan 24 2009 at the suggestion of R. J. Mathar and T. D. Noe.

A063748 Greatest x that is a solution to x-phi(x)=n or zero if there is no solution, where phi(x) is Euler's totient function.

Original entry on oeis.org

4, 9, 8, 25, 10, 49, 16, 27, 0, 121, 22, 169, 26, 55, 32, 289, 34, 361, 38, 85, 30, 529, 46, 133, 0, 187, 52, 841, 58, 961, 64, 253, 0, 323, 68, 1369, 74, 391, 76, 1681, 82, 1849, 86, 493, 70, 2209, 94, 589, 0, 667, 0, 2809, 106, 703, 104, 697, 0, 3481, 118, 3721, 122
Offset: 2

Views

Author

Labos Elemer, Aug 13 2001

Keywords

Comments

See A051953 for x-phi(x), the cototient function. Note that a(n)=0 for n in A005278. Also note that n=1 has an infinite number of solutions. If n is prime, then a(n)=n^2. If n is even, then a(n)<=2n. In particular, if n=p+1 for a prime p, then a(n)=2n-2. Also, if n=2^k, then a(n)=2n. If n>9 is odd and composite, then a(n)=pq, with p>q odd primes with p+q=n+1 and p-q minimal. We can take p=A078496((n+1)/2) and q=A078587((n+1)/2).

Examples

			For n=15, the solutions are x=39 and x=55, so a(15)=55. Note that 55=5*11 and 5+11=n+1.
		

Crossrefs

Cf. A063507 (least solution to x-phi(x)=n), A063740 (number of solutions to x-phi(x)=n).

Programs

  • Mathematica
    nn=10^4; lim=Floor[Sqrt[nn]]; mx=Table[0,{lim}]; Do[c=n-EulerPhi[n]; If[0T. D. Noe *)
    Table[Module[{k = n^2}, While[And[k - EulerPhi@ k != n, k > 0], k--];
    k], {n, 2, 62}] (* Michael De Vlieger, Mar 17 2017 *)

Formula

a(n)=Max{x : A051953(x)=n} if the inverse set is not empty; a(n)=0 if no inverse exists.

Extensions

Corrected and edited by T. D. Noe, Oct 30 2006

A143697 Least square k^2 such that n^2-k^2 = p*q with p and q odd primes and p= 4.

Original entry on oeis.org

1, 4, 1, 16, 9, 4, 9, 36, 1, 36, 9, 4, 9, 36, 1, 144, 9, 4, 81, 36, 25, 36, 9, 16, 81, 144, 1, 144, 81, 16, 9, 36, 25, 36, 81, 4, 9, 144, 1, 576, 9, 4, 225, 36, 25, 144, 9, 64, 81, 36, 49, 144, 9, 16, 225, 144, 1, 324, 81, 16, 9, 36, 25, 36, 225, 4, 9, 144, 1, 36, 225
Offset: 4

Views

Author

Pierre CAMI, Aug 29 2008

Keywords

Comments

The product p*q is the sum of p consecutive odd numbers with 2*n-1 the greatest.
For n=4 p*q=3*5=15, 15=7+5+3
For n=5 p*q=3*7=21, 21=9+7+5
For n=6 p*q=5*7=35, 35=11+9+7+5+3
For n=7 p*q=3*11=33, 33=13+11+9
k^2 is the sum of the k first consecutive odd numbers p=n-k and q=n+k.
Assuming a strong version of the Goldbach conjecture, every term exists and we have a(n)=A082467(n)^2, p(n)=A078587(n) and q(n)=A078496(n). [T. D. Noe, Jan 22 2009]

Examples

			4*4-1=3*5 p=3 q=5
5*5-4=3*7 p=3 q=7
6*6-1=5*7 p=5 q=7
7*7-16=3*11 p=3 q=11
		

Crossrefs

Programs

  • PARI
    a(n) = {for (k=1, n-1, my(x=n^2-k^2); if ((omega(x)==2) && (bigomega(x)==2) && (x%2), return(k^2);););} \\ Michel Marcus, Sep 23 2019

A167485 Smallest positive integer m such that n can be expressed as the sum of an initial subsequence of the divisors of m, or 0 if no such m exists.

Original entry on oeis.org

1, 1, 0, 2, 3, 0, 5, 4, 7, 15, 12, 21, 6, 9, 13, 8, 12, 30, 10, 42, 19, 18, 20, 57, 14, 36, 46, 30, 12, 102, 29, 16, 21, 42, 62, 84, 22, 36, 37, 18, 27, 63, 20, 50, 43, 66, 52, 129, 33, 75, 40, 78, 48, 220, 34, 36, 28, 49, 60, 265, 24, 132, 61, 32, 56, 117, 54, 100, 67, 90, 84
Offset: 0

Views

Author

Keywords

Comments

It appears that 2 and 5 are the only zeros in this sequence. This would follow from a slightly stronger version of the Goldbach conjecture: every even integer > 22 can be expressed as the sum of two primes p and q, with 5 < p < q < 5p. Then odd numbers can be obtained for pq and even numbers for 5pq.
Is a(n) = o(n)? - Arkadiusz Wesolowski, Nov 09 2013
The above question has been posed by Erdős. See Guy. - Stefano Spezia, Sep 25 2024
a(A000203(n)) <= n. Since A000203(n)/n can be arbitrarily large, that shows that lim inf_{n -> oo} a(n)/n = 0. - Robert Israel, Sep 26 2024

Examples

			The divisors of 15 are 1,3,5,15, with cumulative sums 1,4,9,24. Since this is the smallest number where 9 occurs in the sums, a(9) = 15.
		

References

  • R. K. Guy, Unsolved Problems in Number Theory, Springer, 1st edition, 1981. See section B2.

Crossrefs

Programs

  • Maple
    N:= 100: # for a(0) .. a(N)
    count:= 1: V:= Array(0..N): V[0]:= 1:
    for m from 1 while count < N-1 do
      L:= ListTools:-PartialSums(sort(convert(numtheory:-divisors(m),list)));
      for x in L do
        if x > N then break fi;
        if V[x] = 0 then V[x]:= m; count:= count+1 fi;
    od od:
    convert(V,list); # Robert Israel, Sep 26 2024
  • PARI
    {u=vector(100); for(n=1,1000,ds=divisors(n);s=0; for(k=1,#ds,s+=ds[k];if(s>#u,break);if(!u[s],u[s]=n))); u}

A305883 Triangle read by rows: row n lists the pairs (p, q) such that p, q are primes, p+q=2*n and p < q.

Original entry on oeis.org

3, 5, 3, 7, 5, 7, 3, 11, 3, 13, 5, 11, 5, 13, 7, 11, 3, 17, 7, 13, 3, 19, 5, 17, 5, 19, 7, 17, 11, 13, 3, 23, 7, 19, 5, 23, 11, 17, 7, 23, 11, 19, 13, 17, 3, 29, 13, 19, 3, 31, 5, 29, 11, 23, 5, 31, 7, 29, 13, 23, 17, 19, 7, 31, 3, 37, 11, 29, 17, 23, 5, 37, 11, 31
Offset: 4

Views

Author

Seiichi Manyama, Jun 13 2018

Keywords

Examples

			  n  | (p,q)
  ---+----------------------------
   4 | (3,  5);
   5 | (3,  7);
   6 | (5,  7);
   7 | (3, 11);
   8 | (3, 13), (5, 11);
   9 | (5, 13), (7, 11);
  10 | (3, 17), (7, 13);
  11 | (3, 19), (5, 17);
  12 | (5, 19), (7, 17), (11, 13);
		

Crossrefs

Cf. A002373, A020481, A061357 (the size of row n), A078496, A078587.

Programs

  • Mathematica
    row[n_] := Select[Table[{p, 2 n - p}, {p, Prime[Range[PrimePi[n]]]}], Less @@ # && AllTrue[#, PrimeQ]&] // Union;
    Table[row[n], {n, 4, 25}] // Flatten (* Jean-François Alcover, Jun 16 2018 *)

A234649 Difference between the first members of the widest and the narrowest prime pair having an arithmetic mean of n.

Original entry on oeis.org

2, 2, 4, 2, 6, 4, 6, 6, 10, 8, 12, 0, 14, 14, 10, 14, 14, 16, 18, 16, 16, 12, 22, 16, 20, 24, 24, 26, 26, 28, 26, 32, 30, 26, 36, 16, 36, 36, 28, 36, 36, 18, 44, 38, 40, 44, 42, 40, 50, 48, 40, 42, 52, 30, 42, 46, 42, 56, 56, 58, 48, 60, 64, 56, 66, 60, 48, 60, 70, 68, 68, 54, 68, 74, 60, 56
Offset: 8

Views

Author

Ralf Stephan, Dec 29 2013

Keywords

Comments

The widest prime pair with a mean of n is (A002373(n),A020482(n)) and the narrowest is (A078587(n),A078496(n)).
Existence of a(n) for all n depends on A061357(n) > 0.
Even numbers missing in the subsequence with n<10^5 are 34,62,82,88,112,116,118,122,130,140,152...
a(n) = 0 for n=4,5,6,7,19 because A061357(n) = 1.

Examples

			The prime pairs with an arithmetic mean of 18 are (17,19), (13,23), (7,29), and (5,31), so a(18) = 17-5 = 31-19 = 12. The only pair with mean of 19 is (7,31) so a(19) = 0.
		

Crossrefs

Cf. A045917.

Programs

  • PARI
    a(n)=mi=0;ma=0;forprime(p=3,n-1,if(isprime(2*n-p),if(!mi,mi=2*n-p);ma=2*n-p));if(!ma,-1,mi-ma)

Formula

a(n) = A078587(n) - A002373(n) = A078496(n) - A020482(n).
Showing 1-8 of 8 results.