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.

A178950 Numbers n such that A178609(n)=A178609(n+1).

Original entry on oeis.org

1, 6, 8, 14, 16, 21, 27, 29, 48, 49, 52, 55, 57, 60, 61, 65, 85, 86, 90, 95, 96, 112, 117, 120, 121, 122, 123, 124, 135, 145, 153, 169, 179, 181, 186, 191, 213, 214, 215, 216, 238, 255, 256, 257, 258, 259, 260, 263, 267, 274, 275, 281, 288, 324, 325, 340, 343, 345, 354, 355, 356, 357, 359, 366
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Dec 31 2010

Keywords

Crossrefs

Cf. A000040.

Formula

A178609(a(n))=A178609(a(n)+1).

A178951 Numbers k such that A178609(k-1) = A178609(k) = A178609(k+1).

Original entry on oeis.org

49, 61, 86, 96, 121, 122, 123, 124, 214, 215, 216, 256, 257, 258, 259, 260, 275, 325, 355, 356, 357, 412, 518, 519, 545, 546, 547, 588, 589, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 827, 833, 840, 904, 905, 906, 982, 983, 984, 1176, 1177
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Dec 31 2010

Keywords

Comments

Where A178609(n) is a measure of the largest index distance which allows prime(n) to be written as the arithmetic mean of two primes at equal distance to prime(n).

Crossrefs

Cf. A178609.

Programs

Formula

A178609(a(n)-1) = A178609(a(n)) = A178609(a(n)+1).

A071681 Number of ways to represent the n-th prime as arithmetic mean of two other primes.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, May 31 2002

Keywords

Comments

Conjecture: a(n)>0 for n>2.
a(A137700(n))=n and a(m)<>n for m < A137700(n), A000040(A137700(n))=A126204(n). - Reinhard Zumkeller, Feb 07 2008
The conjecture follows from a slightly strengthened version of Goldbach's conjecture: that every even number > 6 is the sum of two distinct primes. - T. D. Noe, Jan 10 2011 [Corrected by Barry Cherkas and Robert Israel, May 21 2015]
a(n) = A116619(n) + 1. - Reinhard Zumkeller, Mar 27 2015
Number of primes q < prime(n), such that 2*prime(n) - q is prime. - Dmitry Kamenetsky, May 27 2023

Examples

			a(7)=3 as prime(7) = 17 = (3+31)/2 = (5+29)/2 = (11+23)/2 and 2*17-p is not prime for the other primes p < 17: {2,7,13}.
		

Crossrefs

Programs

  • Haskell
    a071681 n = sum $ map a010051' $
       takeWhile (> 0) $ map (2 * a000040 n -) $ drop n a000040_list
    -- Reinhard Zumkeller, Mar 27 2015
  • Mathematica
    f[n_] := Block[{c = 0, k = PrimePi@n - 1}, While[k > 0, If[ PrimeQ[2n - Prime@k], c++ ]; k-- ]; c]; Table[ f@ Prime@n, {n, 84}] (* Robert G. Wilson v, Mar 22 2007 *)
  • PARI
    A071681(n)={s=2*prime(n);a=0;for(i=1,n-1,a=a+isprime(s-prime(i)));a}
    

A178670 Number of ways to express prime(n) as (prime(n+k) + prime(n-k))/2.

Original entry on oeis.org

0, 0, 1, 0, 2, 1, 1, 0, 0, 2, 1, 1, 2, 0, 0, 2, 1, 1, 1, 3, 0, 0, 1, 1, 2, 1, 1, 1, 0, 0, 2, 2, 2, 1, 0, 1, 3, 0, 1, 3, 2, 1, 4, 2, 1, 0, 4, 0, 0, 0, 2, 0, 0, 2, 1, 1, 0, 0, 1, 0, 0, 0, 3, 4, 0, 0, 1, 1, 1, 2, 3, 3, 2, 4, 2, 2, 1, 3, 4, 4, 1, 1, 1, 3, 2, 2, 2, 1, 1, 0, 0, 1, 2, 1, 0, 0, 0, 3, 0, 2
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Jan 04 2011

Keywords

Examples

			a(5) = 2 because the 5th prime (11) is half the sum of the 7th and 3rd prime (17+5) or half the sum of the 8th and 2nd prime (19+3).
a(8) = 0 because the 8th prime (19) cannot be expressed as (1/2)*(prime(8+k) + prime(8-k)) for any k.
		

Crossrefs

Programs

  • Mathematica
    nn=1000; p=Prime[Range[2*nn]]; Table[s=Take[p,n-1] + Reverse[Take[p, {n+1,2n-1}]]; Count[s,2*p[[n]]], {n,nn}]
  • PARI
    a(n)={s=2*prime(n);a=0;for(i=1,n-1,if(prime(n+i)+prime(n-i)==s,a=a+1));a}

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)

A178953 Indices n such that 2*prime(n) cannot be written as a sum of two distinct prime(n-k) and prime(n+k).

Original entry on oeis.org

1, 2, 4, 8, 9, 14, 15, 21, 22, 29, 30, 35, 38, 46, 48, 49, 50, 52, 53, 57, 58, 60, 61, 62, 65, 66, 90, 91, 95, 96, 97, 99, 114, 120, 121, 122, 123, 124, 125, 128, 145, 146, 149, 153, 154, 163, 176, 179, 180, 186, 187, 189, 191, 192, 197
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Jan 02 2011

Keywords

Comments

Snapshots: a(1000) = 6922, a(2000) = 16376, a(3000) = 25951, a(4000) = 37266, a(5000) = 51926, a(6000) = 69928. - R. J. Mathar, Jan 08 2011

Crossrefs

Programs

  • Haskell
    a178953 n = a178953_list !! (n-1)
    a178953_list = filter ((== 0) . a178609) [1..]
    -- Reinhard Zumkeller, Jan 30 2014
  • 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,",n) ; end if; end do: # R. J. Mathar, Jan 05 2011
  • Mathematica
    A178609[n_] := For[k = n-1, k >= 0, k--, If[Prime[n-k] + Prime[n+k] == 2*Prime[n], Return[k]]]; Reap[For[n = 1, n <= 200, n++, If[A178609[n] == 0, Sow[n]]]][[2, 1]] (* Jean-François Alcover, Feb 13 2018, after R. J. Mathar *)

Formula

A178609(a(n))=0.

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}]

A178698 Largest k

Original entry on oeis.org

0, 1, 0, 3, 4, 5, 4, 6, 7, 4, 0, 2, 7, 0, 5, 13, 15, 16, 13, 9, 11, 15, 20, 21, 18, 19, 25, 17, 0, 2, 21, 0, 19, 23, 25, 29, 23, 27, 28, 29, 39, 23, 14, 16, 38, 39, 40, 37, 38, 39, 32, 0, 1, 29, 30, 31, 28, 29, 30, 23, 24, 25, 26, 35, 22, 23, 38, 39, 40, 50, 57, 43, 44, 54, 32
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Dec 26 2010, Dec 31 2010

Keywords

Examples

			a(1)=0 because 2*composite(1)=composite(1-0)+composite(1+0)=4+4=8.
		

Crossrefs

Cf. A002808 (composite numbers), A178609 (prime version).

Programs

  • Mathematica
    Composite[n_Integer] := FixedPoint[n + PrimePi@# + 1 &, n + PrimePi@ n + 1]; f[n_] := Block[{k = n - 1, m = Composite@ n}, While[k > 0 && 2 m != Composite[n + k] + Composite[n - k], k--]; k]; Array[f, 75]
Showing 1-8 of 8 results.