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.

A242380 Lesser of consecutive primes whose average is a perfect power.

Original entry on oeis.org

3, 7, 61, 79, 139, 223, 317, 439, 619, 1087, 1669, 1723, 2593, 3593, 4093, 5179, 6079, 8461, 12541, 13687, 16633, 17573, 19037, 19597, 21943, 25261, 27211, 28219, 29581, 36857, 38011, 39199, 45361, 46649, 47521, 51977, 56167, 74527, 87013, 88801, 91807, 92413, 95479
Offset: 1

Views

Author

Antonio Roldán, May 12 2014

Keywords

Examples

			4093 is in the sequence because 4093 and 4099 are consecutive primes and (4093 + 4099)/2 = 4096 = 2^12.
		

Crossrefs

Supersequence of A225195 and A242382.
Cf. A091624.

Programs

  • Mathematica
    Select[Partition[Prime[Range[2, 10^4]], 2, 1], GCD @@ FactorInteger[(First[#] + Last[#])/2][[;; , 2]] > 1 &][[;; , 1]] (* Amiram Eldar, Jul 04 2022 *)
  • PARI
    for(i=3, 10^5, if(isprime(i), k=(i+nextprime(i+1))/2; if(ispower(k), print1(i, ", "))))

A225077 Smaller of the two consecutive primes whose sum is a triangular number.

Original entry on oeis.org

17, 37, 59, 103, 137, 149, 313, 467, 491, 883, 911, 1277, 1423, 1619, 1783, 2137, 2473, 2729, 4127, 4933, 5437, 5507, 6043, 6359, 10039, 10453, 11717, 13397, 15809, 17489, 20807, 21821, 23027, 27631, 28307, 28813, 29669, 33029, 36947, 39103, 44203, 48281
Offset: 1

Views

Author

Alex Ratushnyak, May 28 2013

Keywords

Crossrefs

Cf. A175132 (numbers n such that sum of two consecutive primes is triangular(n)).
Cf. A181902 and A154634 (average of two consecutive primes is a triangular number).
Cf. A075190 and A225195 (average of two consecutive primes is a square).
Cf. A074924 and A061275 (sum of two consecutive primes is a square).

Programs

  • Maple
    f:= proc(n) local m,p,q;
      m:= n*(n+1)/2;
      p:= prevprime(ceil(m/2));
      q:= nextprime(p);
      if p+q=m then p fi
    end proc:
    map(f, [$3..500]); # Robert Israel, May 04 2020
  • Mathematica
    tri[n_] := IntegerQ[Sqrt[1 + 8 n]]; t = {}; p1 = 2; While[Length[t] < 50, p2 = NextPrime[p1]; If[tri[p1 + p2], AppendTo[t, p1]]; p1 = p2]; t (* T. D. Noe, May 28 2013 *)

Formula

a(n) + nextprime(a(n)) = A000217(A175132(n)).

A242382 Lesser of consecutive primes whose average is a perfect cube.

Original entry on oeis.org

61, 1723, 4093, 17573, 21943, 46649, 110587, 195103, 287491, 314423, 405221, 474547, 1061189, 1191013, 1404919, 1601609, 1906621, 2000371, 2146687, 2196979, 3241783, 3511799, 4912991, 5268017, 6229501, 6751267, 6858997, 7077883, 11239421, 20346407, 21951997, 26198063
Offset: 1

Views

Author

Antonio Roldán, May 12 2014

Keywords

Examples

			1723 is in the sequence because it is prime, nextprime(1723) = 1733, and average(1723,1733) = 1728 = 12^3.
		

Crossrefs

Subsequence of A077037 and A242380.

Programs

  • Mathematica
    Select[Partition[Prime[Range[2, 10^5]], 2, 1], IntegerQ[Surd[(First[#] + Last[#])/2, 3]] &][[;; , 1]] (* Amiram Eldar, Jul 04 2022 *)
  • PARI
    {for(i=3,3*10^7,if(isprime(i),k=(i+nextprime(i+1))/2;if(ispower(k,3),print1(i,", "))))}

A365706 For n >= 1, a(n) is the least prime p such that the arithmetic mean of (n + 1) consecutive primes starting with p is a perfect square, or a(n) = -1 if no such p exists.

Original entry on oeis.org

3, 2393, 5, 827, 53, 271, 1063, 23993, 197, 29, 193, 2143, 359, 6829, 397, 17, 433, 661, 2837, 25171, 13597, 563, 10301, 1814233, 51427, 6781, 316817, 7477, 71, 238919, 11491, 3109, 42293, 38653, 6263, 13043, 474497, 21433, 13, 21419, 16963, 5119, 705209, 183761
Offset: 1

Views

Author

Ctibor O. Zizka, Oct 15 2023

Keywords

Comments

Does a(n) exists for all n >= 1 ?
From David A. Corneth, Oct 18 2023: (Start)
Let s(n) be the sum of n + 1 consecutive primes starting with a(n). Then s(n)/(n+1) = m^2 for some positive integer m.
This means s(n) = (n + 1) * m^2. If n is even then m is odd if a(n) > 2.
As s(n) >= A007504(n) we have m^2 >= s(n)/(n+1) >= A007504(n)/(n+1) i.e. m >= sqrt(A007504(n)/(n+1)). So for some m we can see if m^2 * (n+1) is the sum of n+1 consecutive primes and if so a(n) is the smallest prime of these n+1 primes after testing all candidates up to m. (End)
s(n) = (n + 1)* a(n) + Sum_{i=0..(n-1)} (n-i)*g(i+1), thus we have Sum_{i=0..(n-1)} (n-i)*g(i+1) = (m^2 - a(n)) * (n + 1), g(j) are the n gaps between n + 1 consecutive primes. - Ctibor O. Zizka, Oct 18 2023

Examples

			n = 2: we search for the least prime(i) such that (prime(i) + prime(i + 1) + prime(i + 2))/3 = m^2, m an integer. This is valid for (2393 + 2399 + 2411)/3 = 49^2 thus a(2) = 2393.
		

Crossrefs

Programs

  • PARI
    isok(x) = (denominator(x)==1) && issquare(x);
    a(n) = my(k=1); while (!isok((vecsum(primes(k+n))-vecsum(primes(k-1)))/(n+1)), k++); prime(k); \\ Michel Marcus, Oct 16 2023
    
  • PARI
    a(n) = {my(m = n + 1, ps = vector(m, i, prime(i)), s); forprime(p = ps[m] + 1, , s = vecsum(ps); if(!(s % m) && issquare(s/m), return(ps[1])); ps = concat(vecextract(ps, "^1"), p));} \\ Amiram Eldar, Oct 18 2023

Extensions

More terms from Amiram Eldar, Oct 18 2023
Showing 1-4 of 4 results.