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 A152535 #61 Jan 02 2024 02:42:29 %S A152535 0,1,5,11,27,37,61,75,107,161,181,247,295,321,377,467,563,597,705,781, %T A152535 821,947,1035,1173,1365,1465,1517,1625,1681,1797,2217,2341,2533,2599, %U A152535 2939,3009,3225,3447,3599,3833,4073,4155,4575,4661 %N A152535 a(n) = n*prime(n) - Sum_{i=1..n} prime(i). %C A152535 a(n) is also the area under the curve of the function pi(x) from 0 to prime(n). - _Omar E. Pol_, Nov 13 2013 %H A152535 T. D. Noe, <a href="/A152535/b152535.txt">Table of n, a(n) for n = 1..1000</a> %H A152535 Christian Axler, <a href="http://arxiv.org/abs/1504.04467">On a sequence involving the prime numbers</a>, arXiv:1504.04467 [math.NT], 2015 and <a href="https://cs.uwaterloo.ca/journals/JIS/VOL18/Axler/axler6.html">J. Int. Seq. 18 (2015) # 15.7.6</a>. %H A152535 Christian Axler, <a href="https://arxiv.org/abs/1706.04049">Improving the Estimates for a Sequence Involving Prime Numbers</a>, arXiv:1706.04049 [math.NT], 2017. %F A152535 a(n) = A033286(n) - A007504(n). - _Omar E. Pol_, Aug 09 2012 %F A152535 a(n) = A046992(A006093(n)). - _Omar E. Pol_, Apr 21 2015 %F A152535 a(n+1) = Sum_{k=A000124(n-1)..A000217(n)} A204890(k). - _Benedict W. J. Irwin_, May 23 2016 %F A152535 a(n) = Sum_{k=1..n-1} k*A001223(k). - _François Huppé_, Mar 16 2022 %e A152535 From _Omar E. Pol_, Apr 27 2015: (Start) %e A152535 For n = 5 the 5th prime is 11 and the sum of first five primes is 2 + 3 + 5 + 7 + 11 = 28, so a(5) = 5*11 - 28 = 27. %e A152535 Illustration of a(5) = 27: %e A152535 Consider a diagram in the first quadrant of the square grid in which the number of cells in the n-th horizontal bar is equal to the n-th prime, as shown below: %e A152535 . _ _ _ _ _ _ _ _ _ _ _ %e A152535 . 11 |_ _ _ _ _ _ _ _ _ _ _| %e A152535 . 7 |_ _ _ _ _ _ _|* * * * %e A152535 . 5 |_ _ _ _ _|* * * * * * %e A152535 . 3 |_ _ _|* * * * * * * * %e A152535 . 2 |_ _|* * * * * * * * * %e A152535 . %e A152535 a(5) is also the area (or the number of cells, or the number of *'s) under the bar's structure of prime numbers: a(5) = 1 + 4 + 6 + 16 = 27. %e A152535 (End) %t A152535 nn = 100; p = Prime[Range[nn]]; Range[nn] p - Accumulate[p] (* _T. D. Noe_, May 02 2011 *) %o A152535 (Sage) [n*nth_prime(n) - sum(nth_prime(j) for j in range(1,n+1)) for n in range(1,45)] # _Danny Rorabaugh_, Apr 18 2015 %o A152535 (PARI) vector(80, n, n*prime(n) - sum(k=1, n, prime(k))) \\ _Michel Marcus_, Apr 20 2015 %o A152535 (Python) %o A152535 from sympy import prime, primerange %o A152535 def A152535(n): return (n-1)*(p:=prime(n))-sum(primerange(p)) # _Chai Wah Wu_, Jan 01 2024 %Y A152535 Cf. A000040, A000720, A001223, A006093, A007504, A033286, A046992, A090942, A117495, A141042 (first differences), A189892, A230849, A230850, A247380. %K A152535 easy,nonn %O A152535 1,3 %A A152535 _Omar E. Pol_, Dec 06 2008