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

A273462 Rounded variance of the first n primes, for n > 1.

Original entry on oeis.org

0, 2, 5, 13, 19, 31, 41, 56, 81, 103, 136, 171, 201, 235, 280, 335, 384, 444, 505, 560, 626, 693, 772, 869, 966, 1055, 1145, 1229, 1314, 1447, 1578, 1719, 1849, 2008, 2156, 2313, 2479, 2644, 2818, 3000, 3171, 3372, 3560, 3748, 3925, 4142, 4398, 4651, 4890
Offset: 2

Views

Author

Andres Cicuttin, May 23 2016

Keywords

Crossrefs

Mean and variance of primes: A301273/A301274, A301275/A301276, A301277, A273462.

Programs

  • Mathematica
    Table[Round[Variance[Prime[Range[j]]]], {j, 2, 50}]
  • Sage
    round(variance(primes_first_n(n))) # Danny Rorabaugh, May 25 2016

Formula

a(n) = round(Sum_{i=1..n} (prime(i) - Sum_{j=1..n} prime(j)/n)^2/(n - 1)), n > 1.

A301277 Nearest integer to mean of first n primes.

Original entry on oeis.org

2, 3, 3, 4, 6, 7, 8, 10, 11, 13, 15, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 45, 47, 49, 51, 53, 55, 58, 60, 63, 65, 67, 70, 72, 75, 77, 80, 82, 85, 87, 90, 92, 94, 97, 100, 102, 105, 107, 110, 113, 115, 118, 121, 123, 126, 128, 131, 133
Offset: 1

Views

Author

N. J. A. Sloane, Mar 18 2018

Keywords

Comments

Differs from A075465 where ties are involved. - R. J. Mathar, Mar 20 2018

Examples

			The means are 2, 5/2, 10/3, 17/4, 28/5, 41/6, 58/7, 77/8, 100/9, 129/10, 160/11, 197/12, 238/13, 281/14, 328/15, 381/16, 440/17, 167/6, 568/19, 639/20, 712/21, 791/22, 38, 321/8, 212/5, ...
		

Crossrefs

Programs

  • Maple
    m := n -> add(ithprime(j),j=1..n)/n;
    m1:=[seq(m(n),n=1..100)];
    m2:=map(numer,m1); # A301273
    m3:=map(denom,m1); # A301274
    m4:=map(round,m1); # A301277
  • Mathematica
    Rest@ FoldList[{Append[First@ #1, #2], If[And[EvenQ@ #1, #2 == 1/2] & @@ {IntegerPart@ #, FractionalPart@ #}, Round@ # + 1, Round@ #] &@ Mean@ First@ #1} &, {{2}, 2}, Prime@ Range[2, 63]][[All, -1]] (* Michael De Vlieger, Apr 05 2018 *)
  • PARI
    a(n) = round(sum(i=1, n, prime(i))/n); \\ Altug Alkan, Mar 22 2018

Formula

a(n) = round(A007504(n) / n). - David A. Corneth, Mar 22 2018
a(n) ~ prime(n)/2 ~ n*log(n)/2. - Daniel Forgues, Mar 22 2018

A263076 Numbers n such that the fractional part of the sum of the first n primes (A007504) divided by n equals 1/2.

Original entry on oeis.org

2, 1810, 2458, 240926, 317602, 757730, 771610, 23993994, 58292586, 172616042
Offset: 1

Views

Author

Robert G. Wilson v, Oct 09 2015

Keywords

Comments

Inspired by A075465.
No other terms < 10^9.
All terms are even. - Charles R Greathouse IV, Oct 09 2015

Examples

			a(1) = 2 since A007504(2) = 5 and 5/2 has a remainder of half of 2 which is 1.
a(2) = 1810 because A007504(1810) = 13150555 and 13150555/1810 = 14531/2.
		

Crossrefs

Programs

  • Mathematica
    p = 2; k = s = 0; lst = {}; While[k < 100000001, s = s + p; If[ 2Mod[s, ++k] == k, AppendTo[lst, k]; Print[k]]; p = NextPrime@ p; k++]
  • PARI
    n=s=0; forprime(p=2,, s+=p; n++; if(n%2==0 && s%n == n/2, print1(n", "))) \\ Charles R Greathouse IV, Oct 09 2015
Showing 1-3 of 3 results.