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.

Previous Showing 61-70 of 101 results. Next

A225461 a(n) = (prime(k) + prime(k+1))/2 where k = A098015(n).

Original entry on oeis.org

9, 15, 21, 26, 34, 39, 45, 50, 56, 64, 69, 76, 81, 86, 99, 105, 111, 120, 129, 134, 144, 154, 160, 165, 170, 176, 186, 195, 225, 231, 236, 246, 254, 260, 266, 274, 279, 288, 300, 309, 315, 324, 334, 342, 351, 356, 370, 376, 381, 386, 399
Offset: 1

Views

Author

Richard R. Forberg, May 13 2013

Keywords

Comments

Former name: Numbers n such that n^2 = prime(i)*prime(i+1) + prime(j)^2, for some i, j > 0 and such that prime(i+1) = prime(i) + 2*prime(j).
The solution values for n = prime(i) + prime(j), when restricted by the condition prime(i+1) = prime(i) + 2*prime(j). Rather than being overly restrictive, the condition applies to the most prevalent type of solution to the equation above for n^2.
The density of solutions, as a percentage of prime(i) values, is 51.33% in the first 10000 primes, and 49.29% in the second 10000 primes.
Values of prime(j) for these solutions range from the prime 2 to the prime 31 in the first 10000 values of prime(i). In the second 10000 values of prime(i) the solutions shift somewhat to higher p(j) values. This trend is expected with increases in the average spacing of primes. This has the effect of slowing the decline in density of solutions at higher p(i) relative to the decline in density of primes themselves.
There is an infinite family of similar equations when "1" is replaced by "d" as in the following: n^2 = prime(i)*prime(i+d) + prime(j)^2, for any i,j, or d > 0.
In this general case, the condition becomes: prime(i+d) = prime(i) + 2*prime(j).
The solution sequence of n values, of course, differs for each d, as does the sequence of primes(i) that create them.
For this generalized version of the equation (and the condition) it is also true that the solution values of n = prime(i) + prime(j), for all d.
[This can be shown with basic algebra as follows, where p() = prime(): n^2 = (p(i) + p(j))^2 = p(i)^2 + 2*p(i)*p(j) + p(j)^2.
Now replace the first p(j) above with (p(i+d) - p(i))/2, and get: n^2 = p(i)^2 + 2*p(i)*(p(i+d) - p(i))/2 + p(j)^2 = p(i)*p(i+d) + p(j)^2.]
This also proves that for each p(i) there is, at most, one solution when the condition is applied.
There are other solutions to the equation above for n^2 with primes that do NOT obey the condition above. These are sparse. For d=1 (this case) they include 8, 18, 72, 450, and 882. All four of these are found at low values of i (i <= 13). These solutions, for all values of d, appear to have the form n = p(j) + 1, if they exist at all for given d. It can be shown, however, that for any given d NOT all p(i) have a solution, but they can occur with the same p(i) as the "algebraic" solutions above.
This sequence appears to be a large subset of (A136798 + A136799)/2 (the center of composite runs). - Bill McEachen, Oct 22 2015
Heuristically, A001223(n)/2 should be prime with probability ~ 1/log log n, so (prime(n) + prime(n+1))/2 is in the sequence with probability ~ 1/log log n. - Robert Israel, Nov 30 2015

Examples

			n = 9 is in the sequence (with i = 4 and j = 1), because 9^2 = 7*11 + 2^2 = prime(4)*prime(4+1) + 2*prime(1) and prime(4+1) = 11 = 7 + 2*2 = prime(4) + 2*prime(1). Moreover, 9 = 7 + 2 = prime(4) + prime(1).
Whereas n = 8 (not in the sequence) satisfies the first condition with i = 2 and j = 4 (8^2 = 3*5 + 7^2), it does NOT meet the second condition: p(i+1) = 5 != p(i) + 2*p(j) = 3 + 2*7 = 17. Moreover, 8 != 3 + 7.
		

Crossrefs

Cf. A000040. Subsequence of A024675. - Zak Seidov, May 18 2013
Cf. A136798 and A136799, first and last values for runs of adjacent composites.

Programs

  • Maple
    P:= select(isprime, [2,seq(2*i+1,i=1..10^4)]):
    G2:= (P[2..-1] - P[1..-2])/2:
    inds:= select(i -> isprime(G2[i]),[$2..nops(G2)]):
    seq(P[i] + G2[i],i=inds); # Robert Israel, Nov 30 2015
  • Mathematica
    Reap[For[p = 2, p < 400, p = NextPrime[p], p1 = NextPrime[p]; If[PrimeQ[pj = (p1 - p)/2] && IntegerQ[n = Sqrt[p*p1 + pj^2]], Sow[n]]]][[2, 1]](* Jean-François Alcover, May 17 2013 *)

Extensions

Example edited by Danny Rorabaugh, Oct 26 2015
Name changed by Robert Israel, Nov 30 2015

A263675 Numbers that are both averages of consecutive primes and nontrivial prime powers.

Original entry on oeis.org

4, 9, 64, 81, 625, 1681, 4096, 822649, 1324801, 2411809, 2588881, 2778889, 3243601, 3636649, 3736489, 5527201, 6115729, 6405961, 8720209, 9006001, 12752041, 16056049, 16589329, 18088009, 21743569, 25230529, 29343889, 34586161, 37736449, 39150049
Offset: 1

Views

Author

Antonio Roldán, Oct 23 2015

Keywords

Comments

Intersection of A024675 and A025475.
Lesser of consecutive primes is in the sequence A084289.

Examples

			625 is in this sequence because 625 = 5^4, nontrivial prime power, and 625 = (619+631)/2, with 619 and 631 consecutive primes.
		

Crossrefs

Programs

  • Maple
    N:= 10^10: # to get all terms <= N
    Primes:= select(isprime, [2,seq(i,i=3..isqrt(N),2)]):
    S:= select(t -> t - prevprime(t) = nextprime(t)-t, {seq(seq(p^j, j=2..floor(log[p](N))),p=Primes)}):
    sort(convert(S,list)); # Robert Israel, Dec 27 2015
  • Mathematica
    (* version >= 6 *)(#/2 + NextPrime[#]/2) & /@
    Select[Prime[Range[5000000]], PrimePowerQ[#/2 + NextPrime[#]/2] &]
    (* Wouter Meeussen, Oct 26 2015 *)
  • PARI
    {for(i=1,10^8,if(isprimepower(i)>1&&i==(precprime(i-1)+nextprime(i+1))/2,print1(i,", ")))}

A330559 a(n) = (number of primes p <= prime(n) with Delta(p) == 2 (mod 4)) - (number of primes p <= prime(n) with Delta(p) == 0 (mod 4)), where Delta(p) = nextprime(p) - p.

Original entry on oeis.org

0, 1, 2, 1, 2, 1, 2, 1, 2, 3, 4, 3, 4, 3, 4, 5, 6, 7, 6, 7, 8, 7, 8, 7, 6, 7, 6, 7, 6, 7, 6, 7, 8, 9, 10, 11, 12, 11, 12, 13, 14, 15, 16, 15, 16, 15, 14, 13, 14, 13, 14, 15, 16, 17, 18, 19, 20, 21, 20, 21, 22, 23, 22, 23, 22, 23, 24, 25, 26, 25, 26, 25, 26, 27, 26, 27, 26, 25, 24, 25, 26, 27, 28, 29, 28
Offset: 1

Views

Author

N. J. A. Sloane, Dec 30 2019

Keywords

Comments

Equals A330560 - A330561.
Since Delta(prime(n)) grows roughly like log n, this probably changes sign infinitely often. When is the next time a(n) is zero, or the first time a(n) < 0 (if these values exist)?
Let s = A024675, the interprimes. For each n let E(n) = number of even terms of s that are <= n, and let O(n) = number of odd terms of s that are <= n. Then a(n+1) = E(n) - O(n). That is, as we progress through s, the number of evens stays greater than the number of odds. - Clark Kimberling, Feb 26 2024

Examples

			n=6: prime(6) = 13, primes p <= 13 with Delta(p) == 2 (mod 4) are 3,5,11; primes p <= 13 with Delta(p) == 0 (mod 4) are 7,13; so a(6) = 3-2 = 1.
		

Crossrefs

Sequences related to the differences between successive primes: A001223 (Delta(p)), A028334, A080378, A104120, A330556, A330557, A330558, A330560, A330561.

Programs

  • Mathematica
    Join[{0}, Accumulate[Mod[Differences[Prime[Range[2, 100]]], 4] - 1]] (* Paolo Xausa, Feb 05 2024 *)

A352743 a(n) = Product_{k=1..n} (p(k+1) + p(k))/(p(k+1) - p(k)), where p(k) = prime(k).

Original entry on oeis.org

1, 5, 20, 120, 540, 6480, 48600, 874800, 9185400, 79606800, 2388204000, 27066312000, 527793084000, 22167309528000, 498764464380000, 8312741073000000, 155171166696000000, 9310270001760000000, 198619093370880000000, 6852358721295360000000, 493369827933265920000000
Offset: 0

Views

Author

Thomas Ordowski, Apr 01 2022

Keywords

Comments

Conjecture: a(n) is an integer for every natural n. - Thomas Ordowski
Checked up to n = 10^4. - Amiram Eldar, Mar 30 2022
Checked up to n = 10^6. - Michael S. Branicky, Apr 01 2022
Note that (a(n)-1)/(a(n)+1) is the relativistic sum of the velocities prime(k)/prime(k+1) from k = 1 to n, in units where the speed of light c = 1. - Thomas Ordowski, Apr 05 2022
a(0) = 1, a(n) is the largest k such that b(n+1) = b(n)*(k + a(n-1))/(k - a(n-1)) is prime, where b(1) = 2. By my conjecture, b(n) = prime(n). - Thomas Ordowski, Jul 30 2025

Examples

			a(4) = ((3+2)/(3-2))*((5+3)/(5-3))*((7+5)/(7-5))*((11+7)/(11-7)) = 540.
		

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; (p-> `if`(n=0, 1,
          a(n-1)*(p(n+1)+p(n))/(p(n+1)-p(n))))(ithprime)
        end:
    seq(a(n), n=0..20);  # Alois P. Heinz, Apr 01 2022
  • Mathematica
    p = Prime[Range[21]]; FoldList[Times, 1, (Rest[p] + Most[p])/(Rest[p] - Most[p])] (* Amiram Eldar, Apr 01 2022 *)
  • PARI
    a(n) = my(v=primes(n+1)); prod(k=1, n, (v[k+1]+v[k])/(v[k+1]-v[k])); \\ Michel Marcus, Apr 10 2025
  • Python
    from sympy import nextprime
    from itertools import islice
    def agen(): # generator of terms
        n, an, p, pp = 0, 1, 2, 3
        while True:
            yield an
            q, r = divmod(an*(pp+p), pp-p)
            assert r == 0, ("Counterexample", n, p, pp)
            n, an, p, pp = n+1, q, pp, nextprime(pp)
    print(list(islice(agen(), 21))) # Michael S. Branicky, Apr 01 2022
    

Formula

a(n) = Product_{k=1..n} A001043(k)/A001223(k).
a(n+1) = 5 * Product_{k=1..n} A024675(k)/A028334(k+1).
Note that A024675(k) and A028334(k+1) are relatively prime.
For n >= 2, a(n) <= (prime(n)+1)*a(n-1). - Thomas Ordowski, Jul 30 2025

Extensions

More terms from Amiram Eldar, Apr 01 2022

A354604 Midpoints of record gaps between primes: a(n) = (A000101(n) + A002386(n))/2 for n > 1.

Original entry on oeis.org

4, 9, 26, 93, 120, 532, 897, 1140, 1344, 9569, 15705, 19635, 31433, 155964, 360701, 370317, 492170, 1349592, 1357267, 2010807, 4652430, 17051797, 20831428, 47326803, 122164858, 189695776, 191912907, 387096258, 436273150, 1294268635, 1453168287, 2300942709, 3842610941, 4302407536, 10726904850, 20678048489, 22367085156, 25056082315, 42652618575
Offset: 2

Views

Author

Donghwi Park, Jul 08 2022

Keywords

Comments

In the displayed portion of the sequence, the only numbers of least prime signature (A025487) are 4 and 120. This is noteworthy because numbers of least prime signature frequently are adjacent to primes (see A344385). It appears to be far more rare for a number of least prime signature to be at the center of a maximal prime gap. With 4 being a term in A344385, 120 seems to have a unique status. - Hal M. Switkay, Mar 13 2025

Crossrefs

Subsequence of A024675.

A127364 Primes in A126558.

Original entry on oeis.org

1693333, 14251277, 17306687, 18067739, 25852399, 29126567, 55781581, 62333321, 113347009, 173863769, 204308891, 211281809, 247612801, 256102939, 267030149, 267670129, 277108457, 291010691, 298502489, 337176617, 365570923, 370598051
Offset: 1

Views

Author

Klaus Brockhaus, Jan 11 2007

Keywords

Comments

Prime interprimes of fourth order.
Primes that are the arithmetic mean of two consecutive prime interprimes of third order; primes of the form (A126557(k)+A126557(k+1))/2.

Crossrefs

Cf. A006562 (balanced primes), A024675 (interprimes), A126554 (interprimes of second order), A126555 (prime interprimes of second order), A126556 (interprimes of third order), A126557 (prime interprimes of third order), A126558 (interprimes of fourth order).

Programs

  • PARI
    {m=400000000;a=0;g=0;e=0;p=2;q=3;r=5;while(r<=m,if((p+r)/2==q,if(a>0,b=(a+q)/2;if(isprime(b),if(g>0,h=(g+b)/2;if(isprime(h),if(e>0,f=(e+h)/2;if(isprime(f),print1(f,",")));e=h));g=b));a=q);p=q;q=r;r=nextprime(r+1))}

A305748 Distance of a prime number from the average of the next two consecutive prime numbers.

Original entry on oeis.org

2, 3, 4, 5, 4, 5, 4, 7, 7, 5, 8, 5, 4, 7, 9, 7, 5, 8, 5, 5, 8, 7, 10, 10, 5, 4, 5, 4, 11, 16, 7, 7, 7, 11, 5, 9, 8, 7, 9, 7, 7, 11, 4, 5, 8, 18, 14, 5, 4, 7, 7, 7, 13, 9, 9, 7, 5, 8, 5, 7, 17, 16, 5, 4, 11, 17, 11, 11, 4, 7, 10, 11, 9, 8, 7, 10, 10, 8, 13, 11, 7, 11, 5, 8, 7, 10, 10, 5, 4, 10, 16, 10, 8, 10, 7, 12, 13
Offset: 1

Views

Author

Dimitris Valianatos, Jun 09 2018

Keywords

Examples

			For n=4 prime(4) = 7. The next two primes are 11, 13 and the average (11 + 13) / 2 = 12. So 12 - 7 = 5 and a(4) = 5.
		

Crossrefs

Programs

  • Mathematica
    Map[Mean@ Rest@ # - First@ # &, Partition[Prime@ Range@ 99, 3, 1]] (* Michael De Vlieger, Jun 11 2018 *)
  • PARI
    { forprime(n = 2, 100,  p1 = nextprime(n+1); p2 = nextprime(p1 + 1);
    print1((p1 + p2) / 2 - n", ")) }

Formula

a(n) = A024675(n) - A000040(n).

A373699 a(n) is the area of the (n+1)-gon having vertices coordinates (2,0), (2,prime(2)), ..., (n,prime(n)), (n,0).

Original entry on oeis.org

4, 10, 19, 31, 46, 64, 85, 111, 141, 175, 214, 256, 301, 351, 407, 467, 531, 600, 672, 748, 829, 915, 1008, 1107, 1209, 1314, 1422, 1533, 1653, 1782, 1916, 2054, 2198, 2348, 2502, 2662, 2827, 2997, 3173, 3353, 3539, 3731, 3926, 4124, 4329, 4546, 4771, 4999, 5230
Offset: 3

Views

Author

Paolo Xausa, Jun 17 2024

Keywords

Comments

In other words, area between the polyline (2,prime(2)), (3,prime(3)), ..., (n,prime(n)) and the x axis.

Crossrefs

Cf. A000040.
Partial sums of A024675.

Programs

  • Mathematica
    Accumulate[Most[#] + Differences[#]/2] & [Prime[Range[2, 100]]]

Formula

a(n) = Sum_{k=1..n-2} A024675(k).

A375097 a(n) = prime(n+2) - (prime(n) + prime(n+1))/2.

Original entry on oeis.org

3, 5, 4, 5, 4, 5, 8, 5, 7, 7, 4, 5, 8, 9, 5, 7, 7, 4, 7, 7, 8, 11, 8, 4, 5, 4, 5, 16, 11, 8, 5, 11, 7, 7, 9, 7, 8, 9, 5, 11, 7, 5, 4, 13, 18, 10, 4, 5, 8, 5, 11, 11, 9, 9, 5, 7, 7, 4, 11, 19, 11, 4, 5, 16, 13, 13, 7, 5, 8, 11, 10, 9, 7, 8, 11, 8, 10, 14, 7, 11
Offset: 2

Views

Author

Hugo Pfoertner, Jul 30 2024

Keywords

Crossrefs

Programs

  • Mathematica
    Array[#3 - (#1 + #2)/2 & @@ Prime[{#, # + 1, # + 2}] &, 80, 2] (* Michael De Vlieger, Jul 30 2024 *)
  • PARI
    a(n) = prime(n+2) - (prime(n) + prime(n+1))/2

A062839 a(n) = floor((prime(n-1)+prime(n+1))/2).

Original entry on oeis.org

1, 3, 5, 8, 10, 14, 16, 20, 24, 27, 33, 36, 40, 44, 48, 53, 57, 63, 66, 70, 75, 78, 84, 90, 95, 100, 104, 106, 110, 118, 122, 132, 135, 143, 145, 153, 157, 162, 168, 173, 177, 185, 187, 194, 196, 204, 211, 219, 226, 230, 234, 237, 245, 249, 257, 263, 267, 273
Offset: 1

Views

Author

Jason Earls, Jul 21 2001

Keywords

Crossrefs

Programs

  • PARI
    j=[]; for(n=1,200,j=concat(j,floor((prime(n-1)+prime(n+1))/2))); j

Formula

a(n) = A024675(n-1) - A028334(n-1), n>2. - R. J. Mathar, Apr 16 2008
Previous Showing 61-70 of 101 results. Next