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.
%I A108309 #39 Oct 25 2014 14:56:01 %S A108309 0,2,2,3,2,3,3,4,4,5,3,4,6,4,6,6,4,6,7,6,8,7,5,8,9,8,7,8,9,8,9,10,10, %T A108309 8,10,12,5,12,12,13,9,11,11,9,13,14,9,14,14,10,10,19,14,12,12,12,12, %U A108309 16,15,16,15,13,18,16,16,12,16,17,15,16,18,14,15,20,18,19,14,19,20,18,16 %N A108309 Consider the triangle of odd numbers where the n-th row has the next n odd numbers. The sequence is the number of primes in the n-th row. %C A108309 Except for the initial term, a(n)>=2 because in the interval 2n-1 of odd numbers there are always at least two primes. %C A108309 For n>2, this is the same as the number of primes between n^2-n and n^2+n, which is the sum of A089610 and A094189. - _T. D. Noe_, Sep 16 2008 %C A108309 a(n) = SUM(A010051(A176271(n,k)): 1<=k<=n). - _Reinhard Zumkeller_, Apr 13 2010 %C A108309 From _Pierre CAMI_, Sep 03 2014: (Start) %C A108309 For n>1 a(n)~floor(1/2 + n/log(n)). %C A108309 The number of primes < n^2 is ~ n^2/2/log(n) by the prime number theorem, as a(n) ~ floor(1/2 + n/log(n)) we have: %C A108309 n^2/2/log(n) ~ 1 + floor(1/2 + 2/log(2)) + floor(1/2 + 3/log(3)) + floor(1/2 + 4/log(4)) + ... + floor(1/2 + (n-1)/log(n-1)) + floor(1/2 + n/log(n)). %C A108309 For n=16000 the number of primes < n^2 is 13991985, the sum: 1 + floor(1/2 + 2/log(2)) + floor(1/2 + 3/log(3)) + floor(1/2 + 4/log(4))+ ... + floor(1/2 + (n-1)/log(n-1)) + floor(1/2 + n/log(n)) is 13991101 and (n^2)/(2*log(n)) is 13222671. %C A108309 So between n^2+n and n^2+3*n there are n odd numbers and ~floor(1/2 + n/log(n)) prime numbers. %C A108309 The twin primes are of the form T1=n^2+n-1 and T2=n^2+n+1, or n^2+n+T1 and n^2+n+T2 with T1<=2*n-1, or n^2+n+P and n^2+n+P(-2 or +2) with P prime <=2*n-1. %C A108309 (End) %H A108309 T. D. Noe, <a href="/A108309/b108309.txt">Table of n, a(n) for n=1..10000</a> %H A108309 Pierre CAMI, <a href="/A108309/a108309.txt">Table of n, a(n) and Floor(1/2+n/log(n))for n=1..10000</a> %e A108309 Triangle begins: %e A108309 1: 1 -> 0 primes, %e A108309 2: 3,5 -> 2 primes, %e A108309 3: 7,9,11 -> 2 primes, %e A108309 4: 13,15,17,19 -> 3 primes. %p A108309 seq(numtheory:-pi(n^2+n-1)-numtheory:-pi(n^2-n),n=1..100); # _Robert Israel_, Sep 03 2014 %t A108309 f[n_] := PrimePi[n^2 + n - 1] - PrimePi[n^2 - n]; Table[f[n], {n, 81}] (* _Ray Chandler_, Jul 26 2005 *) %o A108309 (Haskell) %o A108309 a108309 = sum . (map a010051) . a176271_row %o A108309 -- _Reinhard Zumkeller_, May 24 2012 %Y A108309 Cf. A014085, A088485. %K A108309 easy,nonn %O A108309 1,2 %A A108309 _Giovanni Teofilatto_, Jul 25 2005 %E A108309 Edited and extended by _Ray Chandler_, Jul 26 2005