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

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

A178954 Primes prime(j) which cannot be written as 2*prime(j) = prime(j+k) + prime(j-k) for any 0 < k < j.

Original entry on oeis.org

2, 3, 7, 19, 23, 43, 47, 73, 79, 109, 113, 149, 163, 199, 223, 227, 229, 239, 241, 269, 271, 281, 283, 293, 313, 317, 463, 467, 499, 503, 509, 523, 619, 659, 661, 673, 677, 683, 691, 719, 829, 839, 859, 883, 887, 967, 1049, 1063, 1069, 1109, 1117, 1129, 1153, 1163, 1201
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Jan 05 2011

Keywords

Comments

Sequence A127925, in which 2*prime(j) < prime(j+k) + prime(j-k) for all 0 < k < j, is a subsequence of this sequence. According to section A14 of Guy, Pomerance proved that A127925 is an infinite sequence. Hence, this sequence is also infinite. - T. D. Noe, Jan 10 2011

References

  • R. K. Guy, Unsolved Problems in Number Theory, 3rd ed. Springer, 2004.

Crossrefs

Programs

  • Maple
    A178609 := proc(n) for k from n-1 to 0 by -1 do if ithprime(n-k)+ithprime(n+k)=2*ithprime(n) then return k; end if; end do: end proc:
    for n from 1 to 200 do if A178609(n) = 0 then printf("%d,",ithprime(n)) ; end if; end do: # R. J. Mathar, Jan 05 2011

Formula

From R. J. Mathar, Jan 05 2011: (Start)
{A000040(k): A178609(k)=0}.
a(n) = A000040(A178953(n)). (End)

A179835 Smallest k > 0 such that prime(n-k) + prime(n+k) = 2*prime(n), or 0 if there is no such k.

Original entry on oeis.org

0, 0, 1, 0, 2, 2, 2, 0, 0, 3, 3, 6, 3, 0, 0, 1, 7, 4, 8, 3, 0, 0, 7, 4, 6, 6, 2, 2, 0, 0, 6, 8, 7, 12, 0, 2, 1, 0, 6, 1, 2, 4, 8, 15, 15, 0, 1, 0, 0, 0, 6, 0, 0, 2, 1, 1, 0, 0, 6, 0, 0, 0, 19, 7, 0, 0, 17, 5, 29, 3, 15, 15, 5, 1, 5, 20, 20, 4, 7, 2, 21, 2, 21, 4, 3, 5, 4, 27, 3, 0, 0, 5, 28, 2, 0, 0, 0, 21, 0, 30
Offset: 1

Views

Author

T. D. Noe, Jan 10 2011

Keywords

Crossrefs

Cf. A178609 (largest k), A178670 (number of k)

Programs

  • Mathematica
    nn=1000; p=Prime[Range[2*nn]]; Table[s=Take[p,n-1] + Reverse[Take[p, {n+1,2n-1}]]; pos=Position[s,2*p[[n]]]; If[pos=={}, 0, n-pos[[-1,1]]], {n, nn}]

A190268 Number of ways to express the n-th average of a twin prime pair as the arithmetic mean of a lower and an upper twin prime.

Original entry on oeis.org

1, 1, 3, 3, 3, 3, 5, 5, 5, 3, 3, 13, 3, 5, 1, 3, 7, 9, 5, 7, 1, 15, 5, 7, 3, 9, 9, 3, 7, 13, 11, 3, 3, 7, 9, 13, 3, 23, 13, 15, 7, 13, 5, 21, 11, 9, 9, 13, 9, 5, 3, 15, 3, 9, 11, 9, 9, 9, 17, 15, 5, 7, 9, 7, 7, 21, 19, 7, 11, 43, 35, 11, 25, 11, 5, 7, 7, 37, 27, 9
Offset: 1

Views

Author

Juri-Stepan Gerasimov, May 06 2011

Keywords

Comments

Number of ways to write 2*A014574(n) as a sum of an element of A001359 plus an element of A006512.

Examples

			a(7)=5 because the 7th average is A014574(7)=60 which equals the five averages of the pairs (11,109), (17,103), (59,61), (101,19) and (107,13). - _R. J. Mathar_, Jun 03 2011
		

Crossrefs

Programs

  • Maple
    isA001359 := proc(n) isprime(n) and isprime(n+2) ; end proc:
    A001359 := proc(n) option remember; local a; if n = 1 then 3 ; else for a from procname(n-1)+2 by 2 do if isA001359(a) then return a; end if; end do: end if; end proc:
    isA006512 := proc(n) isprime(n) and isprime(n-2) ; end proc:
    A190268 := proc(n) local a,avn,lowtp,uptp, k ; a := 0 ; avn := A014574(n) ; for k from 1 do lowtp := A001359(k) ; uptp := 2*avn-lowtp ; if uptp <= 0 then break; end if; if isA006512(uptp) then a := a+1 ; end if; end do: a ; end proc:
    seq(A190268(n),n=1..80) ; # R. J. Mathar, May 26 2011

A189802 The smallest prime(m) such that prime(m) = (prime(m+k)+prime(m-k))/2 for n values of k.

Original entry on oeis.org

5, 11, 71, 191, 571, 823, 941, 1187, 2017, 5231, 5563, 7841, 11161, 13691, 30119, 49201, 48163, 49333, 47533, 48109, 110573, 49369, 113143, 49663, 119299, 111103, 49393, 111227, 121343, 113111, 182209, 290383, 581183, 664619, 294431, 744313, 1005391, 293087
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Apr 27 2011

Keywords

Crossrefs

Cf. A178670.

Programs

  • Mathematica
    nn = 1000; p = Prime[Range[2*nn]]; t = Table[s = Take[p, n - 1] + Reverse[Take[p, {n + 1, 2 n - 1}]]; Count[s, 2*p[[n]]], {n, nn}]; n = 1; Reap[While[pos = Position[t, n, 1, 1]; pos != {}, Sow[Prime[pos[[1, 1]]]]; n++]][[2, 1]] (* T. D. Noe, Apr 2011 *)

Extensions

Corrected and extended by T. D. Noe, Apr 29 2011
Showing 1-5 of 5 results.