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.

A096693 Balance index of each prime.

This page as a plain text file.
%I A096693 #5 Mar 30 2012 17:34:11
%S A096693 0,0,1,0,0,0,1,0,0,1,0,1,0,0,0,3,0,0,0,1,0,1,0,1,0,0,0,0,0,0,0,0,1,0,
%T A096693 1,1,4,0,0,5,1,0,0,1,0,0,2,0,1,1,0,0,0,0,1,2,0,0,0,1,0,0,0,0,0,0,0,0,
%U A096693 0,2,4,1,0,1,0,1,0,2,0,2,1,1,0,1,2,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,1,0,0
%N A096693 Balance index of each prime.
%C A096693 a(n) = the number of values of k for which the n-th prime is equal to the arithmetic average of the k primes above and below it.
%C A096693 The average of the first n balance indexes appears to reach a global maximum of 0.588 when n = 85, (prime(85) = 439).
%H A096693 C. H. Gribble, <a href="/A096693/b096693.txt">Table of n, a(n) for n=1,..., 10000</a>.
%e A096693 a(3) = 1 because the third prime, 5, equals (3 + 7)/2.
%e A096693 a(16) = 3 because the sixteenth prime, 53, equals (47 + 59)/2 = (41 + 43 + 47 + 59 + 61 + 67)/6 = (31 + 37 + 41 + 43 + 47 + 59 + 61 + 67 + 71 + 73)/10.
%t A096693 f[n_] := Block[{c = 0, k = 1, p = Prime[n], s = Plus @@ Table[ Prime[i], {i, n - 1, n + 1}]}, While[k != n - 1, If[s == (2k + 1)p, c++ ]; k++; s = s + Prime[n - k] + Prime[n + k]]; c]; Table[ f[n], {n, 105}]
%o A096693 (PARI) b-file generator: {max_n = 10^4; for (n = 1, max_n, c = 0; k = 1; p = prime(n); s = p; while (k < n, s = s + prime(n - k) + prime(n + k); if (s == (2 * k + 1) * p, c++); k++;); print(n " " c);) ;}
%Y A096693 Cf. A090403, A096695, A096705, A096706, A096707, A096708, A096709, A096711.
%K A096693 nonn
%O A096693 1,16
%A A096693 _Robert G. Wilson v_, Jun 26 2004
%E A096693 Corrected and edited by _Christopher Hunt Gribble_, Apr 06 2010