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 41-50 of 150 results. Next

A119403 Primes p=prime(i) of level (1,10), i.e., such that A118534(i)=prime(i-10).

Original entry on oeis.org

745757, 1103639, 1583369, 1895359, 2124049, 3327419, 4234537, 4437779, 5071973, 6287647, 7702573, 8470927, 8675923, 9493151, 9750079, 10868203, 11213843, 14244173, 14796253, 14978893, 15611909, 16489273, 17528681, 18280771, 19125163, 19403831, 19631411, 21975167
Offset: 1

Views

Author

Rémi Eismann and Fabien Sibenaler, Jul 25 2006

Keywords

Comments

This subsequence of A125830 and of A162174 gives primes of level (1,10): If prime(i) has level 1 in A117563 and 2*prime(i) - prime(i+1) = prime(i-k), then we say that prime(i) has level (1,k).

Examples

			prime(353166) - prime(353165) = 5072057 - 5071973 = 5071973 - 5071889 = prime(353165) - prime(353165-10) and prime(353165) has level 1 in A117563, so prime(353165)=5071973 has level (1,10).
		

Crossrefs

Cf. A117078, A117563, A006562 (primes of level (1,1)), A117876, A118464, A118467.

Programs

  • PARI
    lista(nn) = my(c=11, v=primes(11)); forprime(p=37, nn, if(2*v[c]-p==v[c=c%11+1], print1(precprime(p-1), ", ")); v[c]=p); \\ Jinyuan Wang, Jun 18 2021

Extensions

More terms from Fabien Sibenaler, Oct 20 2006
Definition and comment reworded following suggestions from the authors. - M. F. Hasler, Nov 30 2009

A119404 Primes p=prime(i) of level (1,9), i.e., such that A118534(i)=prime(i-9).

Original entry on oeis.org

678659, 855739, 1403981, 2366543, 2744783, 2830657, 3027539, 3317033, 4525909, 4676851, 5341463, 5819563, 7087123, 7181897, 8815663, 9324257, 9878929, 9976937, 10403251, 10440641, 10447457, 10766411, 10787377, 11829151, 11881957, 12539389, 14026433, 14087179
Offset: 1

Views

Author

Rémi Eismann and Fabien Sibenaler, Jul 25 2006

Keywords

Comments

This subsequence of A125830 and of A162174 gives primes of level (1,9): If prime(i) has level 1 in A117563 and 2*prime(i) - prime(i+1) = prime(i-k), then we say that prime(i) has level (1,k).

Examples

			prime(780815) - prime(780814) = 11882071 - 11881957 = 11881957 - 11881843 = prime(780814) - prime(780814-9) and prime(780814) has level 1 in A117563, so prime(780814)=11881957 has level (1,9).
		

Crossrefs

Cf. A117078, A117563, A006562 (primes of level (1,1)), A117876, A118464, A118467.

Extensions

Definition and comment reworded following suggestions from the authors. - M. F. Hasler, Nov 30 2009

A359440 A measure of the extent of reflective symmetry in the pattern of primes around each prime gap: a(n) is the largest k such that prime(n-j) + prime(n+1+j) has the same value for each j in 0..k.

Original entry on oeis.org

0, 0, 0, 1, 2, 2, 1, 0, 0, 4, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 2, 1, 0, 1, 0, 0, 0, 2, 0, 0, 0, 5, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0
Offset: 1

Views

Author

Alexandre Herrera, Jan 01 2023

Keywords

Comments

If the prime gaps above and below a prime p have the same length, p is called a balanced prime (see A006562). Likewise, if the prime gaps above and below the n-th prime gap have the same length, this gap might be called a balanced prime gap. These gaps correspond to nonzero terms a(n). Similarly, if a(n) >= 2, the n-th prime gap is the equivalent of a doubly balanced prime (A051795), and so on. - Peter Munn, Jan 08 2023

Examples

			For n = 1, prime(1) + prime(2) = 2 + 3 = 5; "prime(0)" does not exist, so a(1) = 0.
For n = 4:
  j = 0:  prime(4) + prime(5) =  7 + 11 = 18;
  j = 1:  prime(3) + prime(6) =  5 + 13 = 18;
  j = 2:  prime(2) + prime(7) =  3 + 17 = 20 != 18, so a(4) = 1.
For n = 5:
  j = 0:  prime(5) + prime(6) = 11 + 13 = 24;
  j = 1:  prime(4) + prime(7) =  7 + 17 = 24;
  j = 2:  prime(3) + prime(8) =  5 + 19 = 24;
  j = 3:  prime(2) + prime(9) =  3 + 23 = 26 != 24, so a(5) = 2.
		

Crossrefs

Programs

  • Python
    import sympy
    offset = 1
    N = 100
    l = []
    for n in range(offset,N+1):
        j = 0
        first_sum = sympy.prime(n-j)+sympy.prime(n+j+1)
        while (n-j) > 1:
            j += 1
            sum = sympy.prime(n-j)+sympy.prime(n+j+1)
            if sum != first_sum:
                break
        l.append(max(0,j-1))
    print(l)

Formula

a(n) = min( {n-1} U {k : 0 <= k <= n-2 and prime(n-k-1) + prime(n+k+2) <> prime(n) + prime(n+1)} ). - Peter Munn, Jan 08 2023

Extensions

Introductory phrase added to name by Peter Munn, Jan 08 2023

A053709 Prime balanced factorials: numbers k such that k! is the mean of its 2 closest primes.

Original entry on oeis.org

3, 5, 10, 21, 171, 190, 348, 1638, 3329
Offset: 1

Views

Author

Labos Elemer, Feb 10 2000

Keywords

Comments

Also, the integers k such that A033932(k) = A033933(k).
k! is an interprime, i.e., the average of two successive primes.
The difference between k! and any of its two closest primes must be 1 or exceed k. - Franklin T. Adams-Watters
Larger terms may involve probable primes. - Hans Havermann, Aug 14 2014

Examples

			For the 1st term, 3! is in the middle between its closest prime neighbors 5 and 7.
For the 2nd term, 5! is in the middle between its closest prime neighbors 113 and 127.
From _Jon E. Schoenfield_, Jan 14 2022: (Start)
In the table below, k = a(n), k! - d and k! + d are the two closest primes to k!, and d = A033932(k) = A033933(k) = A053711(n):
.
  n     k     d
  -  ----  ----
  1     3     1
  2     5     7
  3    10    11
  4    21    31
  5   171   397
  6   190   409
  7   348  1657
  8  1638  2131
  9  3329  7607
(End)
		

Crossrefs

Cf. A075409 (smallest m such that n!-m and n!+m are both primes).

Programs

  • Maple
    for n from 3 to 200 do j := n!-prevprime(n!): if not isprime(n!+j) then next fi: i := 1: while not isprime(n!+i) and (i<=j) do i := i+2 od: if i=j then print(n):fi:od:
  • Mathematica
    PrevPrim[n_] := Block[{k = n - 1}, While[ !PrimeQ[k], k-- ]; k]; NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k] Do[ a = n!; If[2a == PrevPrim[a] + NextPrim[a], Print[n]], {n, 3, 415}]

Extensions

a(5)-a(6) from Jud McCranie, Jul 04 2000
a(7) from Robert G. Wilson v, Sep 17 2002
a(8) from Donovan Johnson, Mar 23 2008
a(9) from Hans Havermann, Aug 14 2014

A075540 Integers that are the average of three successive primes.

Original entry on oeis.org

5, 53, 157, 173, 211, 257, 263, 373, 511, 537, 563, 593, 607, 653, 733, 947, 977, 999, 1073, 1103, 1123, 1187, 1223, 1239, 1367, 1461, 1501, 1511, 1541, 1747, 1753, 1763, 1773, 1899, 1907, 1917, 2071, 2181, 2287, 2401, 2409, 2417, 2449, 2677, 2903, 2963
Offset: 1

Views

Author

Zak Seidov, Sep 21 2002

Keywords

Comments

Not every three successive primes have an integer average. The integer averages are in the sequence.
Not all of these 3-averages are prime: the prime 3-averages are in A006562 (balanced primes). There are surprisingly many prime 3-averages: among the first 10000 terms of the sequence there are 2417 primes. Indices i(n) of first prime in sequence of three primes with integer average are in A075541, for prime 3-averages i(n) are in A064113. Interprimes (s-averages with s=2) are all composite, see A024675. (Edited by Zak Seidov, Sep 01 2015 )

Examples

			a(1) = 5 = (1/3)(3+5+7), first integer average of three successive primes; next is: a(2) = 53 = (1/3)(47 + 53 + 59); up to n=8 all terms are prime; while a(9) = 511 = (1/3)( 503 + 509 + 521) is the first nonprime 3-average: 511=7*73.
		

Crossrefs

Programs

  • Haskell
    a075540 n = a075540_list !! (n-1)
    a075540_list = map fst $ filter ((== 0) . snd) $
       zipWith3 (\x y z -> divMod (x + y + z) 3)
                a000040_list (tail a000040_list) (drop 2 a000040_list)
    -- Reinhard Zumkeller, Jan 20 2012
  • Maple
    N:= 10^4: # to get all terms using primes <= N
    Primes:= select(isprime,[2,seq(2*i+1, i=1..(N-1)/2)]):
    select(type,(Primes[1..-3] + Primes[2..-2] + Primes[3..-1])/3,integer); # Robert Israel, Sep 01 2015
  • Mathematica
    Select[MovingAverage[Prime[Range[500]],3],IntegerQ] (* Harvey P. Dale, Aug 10 2012 *)

Formula

a(n) = (1/3) (p(i)+p(i+1)+p(i+2)), for some i(n).

Extensions

Comment and example edited, inefficient Mma removed by Zak Seidov, Sep 01 2015

A081415 Triply balanced primes: primes which are averages of both their immediate neighbor, their second neighbors and their third neighbors.

Original entry on oeis.org

683783, 1056317, 1100261, 2241709, 2815301, 4746359, 10009049, 12003209, 13810981, 14907649, 15403009, 15730067, 16595081, 17518201, 19755301, 20378327, 21006487, 21574453, 21579983, 22237121, 22625179, 25876901, 26018791, 26354201, 27188141, 28469461
Offset: 1

Views

Author

Labos Elemer, Apr 02 2003

Keywords

Comments

Equivalently, primes which are balanced primes of orders 1, 2, and 3. - Muniru A Asiru, Apr 08 2018
Numbers m such that A346399(m) is odd and >= 7. - Ya-Ping Lu, May 11 2024

Examples

			p = 683383: 683747 + ... + p + ... + 683819 = 7p; 683759 + ... + p + ... + 683807 = 5p; 683777 + p + 683789 = 3p.
		

Crossrefs

Programs

  • GAP
    P:=Filtered([1,3..3*10^7+1],IsPrime);;
    a:=Intersection(List([1,2,3],b->List(Filtered(List([0..Length(P)-(2*b+1)],k->List([1..2*b+1],j->P[j+k])),i->Sum(i)/(2*b+1)=i[b+1]),m->m[b+1]))); # Muniru A Asiru, Apr 08 2018
    
  • Mathematica
    a = {}; Do[p = 2Prime[n]; If[p == Prime[n - 1] + Prime[n + 1] && p == Prime[n - 2] + Prime[n + 2] && p == Prime[n - 3] + Prime[n + 3], Print[p / 2]; AppendTo[a, p / 2]], {n, 5, 1100000}]; a (* Robert G. Wilson v, Jun 28 2004 *)
    Transpose[Select[Partition[Prime[Range[1620000]],7,1],(#[[1]]+#[[7]])/2 == (#[[2]]+#[[6]])/2==(#[[3]]+#[[5]])/2==#[[4]]&]][[4]] (* Harvey P. Dale, Sep 13 2013 *)
  • Python
    from sympy import nextprime; p, q, r, s, t, u, v = 2, 3, 5, 7, 11, 13, 17
    while v < 29000000:
        if p + v == q + u == r + t == 2*s: print(s, end = ', ')
        p, q, r, s, t, u, v = q, r, s, t, u, v, nextprime(v) # Ya-Ping Lu, May 11 2024

A082080 Smallest balanced prime of order n.

Original entry on oeis.org

2, 5, 79, 17, 491, 53, 71, 29, 37, 983, 5503, 173, 157, 353, 5297, 263, 179, 383, 137, 2939, 2083, 751, 353, 5501, 1523, 149, 4561, 1259, 397, 787, 8803, 8803, 607, 227, 3671, 17443, 57097, 3607, 23671, 12539, 1217, 11087, 1087, 21407, 19759, 953
Offset: 0

Views

Author

Labos Elemer, Apr 08 2003

Keywords

Comments

Or, smallest (2n+1)-balanced prime number.
Prime(k) is a balanced prime of order n if it is the average of the 2n+1 primes from prime(k-n) to prime(k+n).

Examples

			a(1) = 5 = (3 + 5 + 7)/3 = 15/3.
a(5) = 53 = (31 + 37 + 41 + 43 + 47 + 53 + 59 + 61 + 67 + 71 + 73)/11 = 583/11.
a(6) = 71 = (43 + 47 + 53 + 59 + 61 + 67 + 71 + 73 + 79 + 83 + 89 + 97 + 101)/13 = 923/13.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{p = Prime@ Range[2n +1]}, While[ Total[p] != (2n +1) p[[n +1]], p = Join[Rest@ p, {NextPrime[ p[[-1]]] }]]; p[[n +1]]]; Array[f, 46, 0] (* Robert G. Wilson v, Jun 21 2004 and modified Apr 11 2017 *)
  • PARI
    for(n=0, 50, i=2*n+1;f=0;forprime(p=2, 10^7, s=0;c=i;pr=p-1;t=0;while(c>0, c=c-1;pr=nextprime(pr+1);s=s+pr; if(c==(i-1)/2, t=pr)); if(s/i==t, print1(t", ");f=1;break)); if(!f, print1("0, ")))

Extensions

Corrected and extended by Ralf Stephan, Apr 09 2003

A096710 Quadruply balanced primes: primes which are averages of their immediate neighbor primes, their second neighbor primes, their third neighbor primes and their fourth neighbor primes.

Original entry on oeis.org

98303927, 580868459, 784857323, 857636141, 909894647, 951508837, 1367470823, 1480028171, 1850590099, 2106973159, 2121382079, 2409718043, 2635873907, 2704854637, 3225527099, 3386231579, 3823510039, 3824915671, 3905211517, 4123167667, 4127991383, 4386448117
Offset: 1

Views

Author

Robert G. Wilson v, Jun 28 2004

Keywords

Examples

			98303927 is a member because 98303927 = (98303903 + 98303951)/2 = (98303897 + 98303957)/2 = (98303873 + 98303981)/2 = (98303867 + 98303987)/2.
		

Crossrefs

Programs

  • Mathematica
    a = {}; Do[p = 2Prime[n]; If[p == Prime[n - 1] + Prime[n + 1], If[ p == Prime[n - 2] + Prime[n + 2], If[p == Prime[n - 3] + Prime[n + 3], If[p == Prime[n - 4] + Prime[n + 4], Print[p/2]; AppendTo[a, p/2]]]]], {n, 6, 117039731}]; a
    Select[Partition[Prime[Range[207405000]],9,1],(#[[1]]+#[[9]])/2 == (#[[2]]+ #[[8]])/2 == (#[[3]]+#[[7]])/2==(#[[4]]+#[[6]])/2==#[[5]]&][[All,5]] (* Harvey P. Dale, Dec 27 2018 *)

Extensions

More terms from Jud McCranie, Sep 29 2006

A178609 Largest k < n such that prime(n-k) + prime(n+k) = 2*prime(n).

Original entry on oeis.org

0, 0, 1, 0, 3, 2, 2, 0, 0, 5, 3, 6, 4, 0, 0, 7, 7, 4, 8, 10, 0, 0, 7, 4, 11, 6, 2, 2, 0, 0, 13, 9, 10, 12, 0, 2, 16, 0, 6, 12, 13, 4, 19, 17, 15, 0, 18, 0, 0, 0, 11, 0, 0, 3, 1, 1, 0, 0, 6, 0, 0, 0, 27, 13, 0, 0, 17, 5, 29, 23, 26, 20, 26, 11, 7, 21, 20, 15, 19, 34, 21, 2, 21, 11, 10, 10, 10, 27, 3, 0, 0, 5, 32, 2, 0, 0, 0, 26, 0, 33
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Dec 24 2010

Keywords

Comments

The plot is very interesting.

Examples

			a(3)=1 because 5=prime(3)=(prime(3-1)+prime(3+1))/2=(3+7)/2.
		

Crossrefs

Cf. A006562 (balanced primes), A178670 (number of k), A178698 (composite case), A179835 (smallest k).

Programs

  • Haskell
    a178609 n = head [k | k <- [n - 1, n - 2 .. 0], let p2 = 2 * a000040 n,
                          a000040 (n - k) + a000040 (n + k) == p2]
    -- Reinhard Zumkeller, Jan 30 2014
  • Mathematica
    Table[k=n-1; While[Prime[n-k]+Prime[n+k] != 2*Prime[n], k--]; k, {n,100}]
  • Sage
    def A178609(n):
        return next(k for k in range(n)[::-1] if nth_prime(n-k)+nth_prime(n+k) == 2*nth_prime(n))
    # D. S. McNeil, Dec 29 2010
    

Formula

a(A178953(n)) = 0.

Extensions

Extended and corrected by T. D. Noe, Dec 28 2010

A126555 Primes in A126554.

Original entry on oeis.org

29, 1439, 4211, 7703, 12907, 14957, 16703, 20947, 29221, 31189, 33053, 36749, 44531, 51437, 90247, 115547, 124783, 127163, 133337, 144511, 146449, 151339, 157133, 166219, 169241, 180233, 181031, 185123, 197383, 223367, 225287, 240347
Offset: 1

Views

Author

Artur Jasinski, Dec 27 2006

Keywords

Comments

Primes that are the arithmetic mean of two consecutive balanced primes (of order one); primes of the form (A006562(k)+A006562(k+1))/2.
Might be called prime interprimes of order two.

Crossrefs

Programs

  • Mathematica
    b = {}; a = {}; Do[If[PrimeQ[((Prime[n + 2] + Prime[n + 1])/2 + (Prime[n + 1] + Prime[n])/2)/2], AppendTo[a, ((Prime[n + 2] + Prime[n + 1])/2 + (Prime[n + 1] + Prime[n])/2)/2]], {n, 1,10000}];Do[If[PrimeQ[(a[[k + 1]] + a[[k]])/2], AppendTo[b, (a[[k + 1]] + a[[k]])/2]], {k, 1, Length[a] - 1}]; b
  • PARI
    {m=250000;a=0;p=2;q=3;r=5;while(r<=m,if((p+r)/2==q,if(a>0,if(isprime(b=(a+q)/2),print1(b,",")));a=q);p=q;q=r;r=nextprime(r+1))} \\ Klaus Brockhaus, Jan 05 2007

Extensions

Edited and extended by Klaus Brockhaus, Jan 05 2007
Previous Showing 41-50 of 150 results. Next