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-10 of 49 results. Next

A033287 First differences of A033286.

Original entry on oeis.org

4, 9, 13, 27, 23, 41, 33, 55, 83, 51, 103, 89, 69, 103, 143, 155, 95, 175, 147, 113, 205, 171, 227, 289, 201, 155, 215, 165, 229, 547, 255, 329, 205, 489, 221, 373, 385, 319, 407, 419, 263, 611, 279, 373, 289, 763
Offset: 0

Views

Author

Keywords

A253634 Decimal expansion of Sum_{n>=1} 1/A033286(n)^2.

Original entry on oeis.org

2, 8, 4, 1, 7, 0, 7, 0, 5, 4, 7, 0, 8, 6, 8, 2, 5, 0, 1, 7, 7, 1, 4
Offset: 0

Views

Author

Pierre CAMI, Jan 07 2015

Keywords

Comments

The convergence is very slow, need to use the first 100000000 primes to obtain the correct value of the coefficient of 10^(-23).
The constant is in the interval [0.28417070547086825017714, 0.28417070547086825017743]; these safe limits are computed by accumulating in parallel the partial sum of the lower estimate 1/n^4 = Zeta(4). - R. J. Mathar, Feb 06 2015

Examples

			0.284170705470...
		

Crossrefs

Cf. A033286 (n*prime(n)), A124012.

A007504 Sum of the first n primes.

Original entry on oeis.org

0, 2, 5, 10, 17, 28, 41, 58, 77, 100, 129, 160, 197, 238, 281, 328, 381, 440, 501, 568, 639, 712, 791, 874, 963, 1060, 1161, 1264, 1371, 1480, 1593, 1720, 1851, 1988, 2127, 2276, 2427, 2584, 2747, 2914, 3087, 3266, 3447, 3638, 3831, 4028, 4227, 4438, 4661, 4888
Offset: 0

Views

Author

Keywords

Comments

It appears that a(n)^2 - a(n-1)^2 = A034960(n). - Gary Detlefs, Dec 20 2011
This is true. Proof: By definition we have A034960(n) = Sum_{k = (a(n-1)+1)..a(n)} (2*k-1). Since Sum_{k = 1..n} (2*k-1) = n^2, it follows A034960(n) = a(n)^2 - a(n-1)^2, for n > 1. - Hieronymus Fischer, Sep 27 2012 [formulas above adjusted to changed offset of A034960 - Hieronymus Fischer, Oct 14 2012]
Row sums of the triangle in A037126. - Reinhard Zumkeller, Oct 01 2012
Ramanujan noticed the apparent identity between the prime parts partition numbers A000607 and the expansion of Sum_{k >= 0} x^a(k)/((1-x)...(1-x^k)), cf. A046676. See A192541 for the difference between the two. - M. F. Hasler, Mar 05 2014
For n > 0: row 1 in A254858. - Reinhard Zumkeller, Feb 08 2015
a(n) is the smallest number that can be partitioned into n distinct primes. - Alonso del Arte, May 30 2017
For a(n) < m < a(n+1), n > 0, at least one m is a perfect square.
Proof: For n = 1, 2, ..., 6, the proposition is clear. For n > 6, a(n) < ((prime(n) - 1)/2)^2, set (k - 1)^2 <= a(n) < k^2 < ((prime(n) + 1)/2)^2, then k^2 < (k - 1)^2 + prime(n) <= a(n) + prime(n) = a(n+1), so m = k^2 is this perfect square. - Jinyuan Wang, Oct 04 2018
For n >= 5 we have a(n) < ((prime(n)+1)/2)^2. This can be shown by noting that ((prime(n)+1)/2)^2 - ((prime(n-1)+1)/2)^2 - prime(n) = (prime(n)+prime(n-1))*(prime(n)-prime(n-1)-2)/4 >= 0. - Jianing Song, Nov 13 2022
Washington gives an oscillation formula for |a(n) - pi(n^2)|, see links. - Charles R Greathouse IV, Dec 07 2022

References

  • E. Bach and J. Shallit, §2.7 in Algorithmic Number Theory, Vol. 1: Efficient Algorithms, MIT Press, Cambridge, MA, 1996.
  • H. L. Nelson, "Prime Sums", J. Rec. Math., 14 (1981), 205-206.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

See A122989 for the value of Sum_{n >= 1} 1/a(n).

Programs

  • GAP
    P:=Filtered([1..250],IsPrime);;
    a:=Concatenation([0],List([1..Length(P)],i->Sum([1..i],k->P[k]))); # Muniru A Asiru, Oct 07 2018
    
  • Haskell
    a007504 n = a007504_list !! n
    a007504_list = scanl (+) 0 a000040_list
    -- Reinhard Zumkeller, Oct 01 2014, Oct 03 2011
    
  • Magma
    [0] cat [&+[ NthPrime(k): k in [1..n]]: n in [1..50]]; // Bruno Berselli, Apr 11 2011 (adapted by Vincenzo Librandi, Nov 27 2015 after Hasler's change on Mar 05 2014)
    
  • Maple
    s1:=[2]; for n from 2 to 1000 do s1:=[op(s1),s1[n-1]+ithprime(n)]; od: s1;
    A007504 := proc(n)
        add(ithprime(i), i=1..n) ;
    end proc: # R. J. Mathar, Sep 20 2015
  • Mathematica
    Accumulate[Prime[Range[100]]] (* Zak Seidov, Apr 10 2011 *)
    primeRunSum = 0; Table[primeRunSum = primeRunSum + Prime[k], {k, 100}] (* Zak Seidov, Apr 16 2011 *)
  • PARI
    A007504(n) = sum(k=1,n,prime(k)) \\ Michael B. Porter, Feb 26 2010
    
  • PARI
    a(n) = vecsum(primes(n)); \\ Michel Marcus, Feb 06 2021
    
  • Python
    from itertools import accumulate, count, islice
    from sympy import prime
    def A007504_gen(): return accumulate(prime(n) if n > 0 else 0 for n in count(0))
    A007504_list = list(islice(A007504_gen(),20)) # Chai Wah Wu, Feb 23 2022

Formula

a(n) ~ n^2 * log(n) / 2. - Ahmed Fares (ahmedfares(AT)my-deja.com), Apr 24 2001 (see Bach & Shallit 1996)
a(n) = A014284(n+1) - 1. - Jaroslav Krizek, Aug 19 2009
a(n+1) - a(n) = A000040(n+1). - Jaroslav Krizek, Aug 19 2009
a(A051838(n)) = A002110(A051838(n)) / A116536(n). - Reinhard Zumkeller, Oct 03 2011
a(n) = min(A068873(n), A073619(n)) for n > 1. - Jonathan Sondow, Jul 10 2012
a(n) = A033286(n) - A152535(n). - Omar E. Pol, Aug 09 2012
For n >= 3, a(n) >= (n-1)^2 * (log(n-1) - 1/2)/2 and a(n) <= n*(n+1)*(log(n) + log(log(n))+ 1)/2. Thus a(n) = n^2 * log(n) / 2 + O(n^2*log(log(n))). It is more precise than in Fares's comment. - Vladimir Shevelev, Aug 01 2013
a(n) = (n^2/2)*(log n + log log n - 3/2 + (log log n - 3)/log n + (2 (log log n)^2 - 14 log log n + 27)/(4 log^2 n) + O((log log n/log n)^3)) [Sinha]. - Charles R Greathouse IV, Jun 11 2015
G.f: (x*b(x))/(1-x), where b(x) is the g.f. of A000040. - Mario C. Enriquez, Dec 10 2016
a(n) = A008472(A002110(n)), for n > 0. - Michel Marcus, Jul 16 2020

Extensions

More terms from Stefan Steinerberger, Apr 11 2006
a(0) = 0 prepended by M. F. Hasler, Mar 05 2014

A014689 a(n) = prime(n)-n, the number of nonprimes less than prime(n).

Original entry on oeis.org

1, 1, 2, 3, 6, 7, 10, 11, 14, 19, 20, 25, 28, 29, 32, 37, 42, 43, 48, 51, 52, 57, 60, 65, 72, 75, 76, 79, 80, 83, 96, 99, 104, 105, 114, 115, 120, 125, 128, 133, 138, 139, 148, 149, 152, 153, 164, 175, 178, 179, 182, 187, 188, 197, 202, 207, 212, 213, 218, 221, 222
Offset: 1

Views

Author

Keywords

Comments

a(n) = A048864(A000040(n)) = number of nonprimes in RRS of n-th prime. - Labos Elemer, Oct 10 2002
A000040 - A014689 = A000027; in other words, the sequence of natural numbers subtracted from the prime sequence produces A014689. - Enoch Haga, May 25 2009
a(n) = A000040(n) - n. a(n) = inverse (frequency distribution) sequence of A073425(n), i.e., number of terms of sequence A073425(n) less than n. a(n) = A065890(n) + 1, for n >= 1. a(n) - 1 = A065890(n) = the number of composite numbers, i.e., (A002808) less than n-th primes, (i.e., < A000040(n)). - Jaroslav Krizek, Jun 27 2009
a(n) = A162177(n+1) + 1, for n >= 1. a(n) - 1 = A162177(n+1) = the number of composite numbers, i.e., (A002808) less than (n+1)-th number of set {1, primes}, (i.e., < A008578(n+1)). - Jaroslav Krizek, Jun 28 2009
Conjecture: Each residue class contains infinitely many terms of this sequence. Similarly, for any integers m > 0 and r, we have prime(n) + n == r (mod m) for infinitely many positive integers n. - Zhi-Wei Sun, Nov 25 2013
First differences are A046933 = differences minus one between successive primes. - Gus Wiseman, Jan 18 2020

Crossrefs

Equals A014692 - 1.
The sum of prime factors of n is A001414(n).
The sum of prime indices of n is A056239(n).
Their difference is A331415(n).

Programs

Formula

G.f: b(x) - x/((1-x)^2), where b(x) is the g.f. of A000040. - Mario C. Enriquez, Dec 13 2016

Extensions

More terms from Vasiliy Danilov (danilovv(AT)usa.net), Jul 1998
Correction for Aug 2009 change of offset in A158611 and A008578 by Jaroslav Krizek, Jan 27 2010

A014285 a(n) = Sum_{j=1..n} j*prime(j).

Original entry on oeis.org

2, 8, 23, 51, 106, 184, 303, 455, 662, 952, 1293, 1737, 2270, 2872, 3577, 4425, 5428, 6526, 7799, 9219, 10752, 12490, 14399, 16535, 18960, 21586, 24367, 27363, 30524, 33914, 37851, 42043, 46564, 51290, 56505, 61941, 67750, 73944, 80457, 87377, 94716, 102318
Offset: 1

Views

Author

Keywords

Comments

Two consecutive terms cannot both be divisible by 4. - Tamas Sandor Nagy, Aug 04 2024

Crossrefs

Partial sums of A033286. - Michel Marcus, Jun 18 2019

Programs

Formula

a(n) = n*A007504(n) - Sum_{k=1..n-1} A007504(k) = n*A007504(n) - A014148(n-1). - Pontus von Brömssen, Aug 29 2021

Extensions

Offset changed to 1 and six terms added by Bruno Berselli, Apr 30 2011

A152535 a(n) = n*prime(n) - Sum_{i=1..n} prime(i).

Original entry on oeis.org

0, 1, 5, 11, 27, 37, 61, 75, 107, 161, 181, 247, 295, 321, 377, 467, 563, 597, 705, 781, 821, 947, 1035, 1173, 1365, 1465, 1517, 1625, 1681, 1797, 2217, 2341, 2533, 2599, 2939, 3009, 3225, 3447, 3599, 3833, 4073, 4155, 4575, 4661
Offset: 1

Views

Author

Omar E. Pol, Dec 06 2008

Keywords

Comments

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

Examples

			From _Omar E. Pol_, Apr 27 2015: (Start)
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.
Illustration of a(5) = 27:
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:
.      _ _ _ _ _ _ _ _ _ _ _
. 11  |_ _ _ _ _ _ _ _ _ _ _|
.  7  |_ _ _ _ _ _ _|* * * *
.  5  |_ _ _ _ _|* * * * * *
.  3  |_ _ _|* * * * * * * *
.  2  |_ _|* * * * * * * * *
.
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.
(End)
		

Crossrefs

Programs

  • Mathematica
    nn = 100; p = Prime[Range[nn]]; Range[nn] p - Accumulate[p] (* T. D. Noe, May 02 2011 *)
  • PARI
    vector(80, n, n*prime(n) - sum(k=1, n, prime(k))) \\ Michel Marcus, Apr 20 2015
    
  • Python
    from sympy import prime, primerange
    def A152535(n): return (n-1)*(p:=prime(n))-sum(primerange(p)) # Chai Wah Wu, Jan 01 2024
  • 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
    

Formula

a(n) = A033286(n) - A007504(n). - Omar E. Pol, Aug 09 2012
a(n) = A046992(A006093(n)). - Omar E. Pol, Apr 21 2015
a(n+1) = Sum_{k=A000124(n-1)..A000217(n)} A204890(k). - Benedict W. J. Irwin, May 23 2016
a(n) = Sum_{k=1..n-1} k*A001223(k). - François Huppé, Mar 16 2022

A076146 a(1) = 1; a(n) = a(n-1)*prime(a(n-1)).

Original entry on oeis.org

1, 2, 6, 78, 30966, 11234495766, 3197149582479668022558
Offset: 1

Views

Author

Zak Seidov, Nov 02 2002

Keywords

Comments

Previous term * prime(previous term). Previous term + prime(previous term) is A074271.
Matula-Goebel numbers of the finite ordinal numbers; see also A007097. - Gus Wiseman, Aug 30 2016

Crossrefs

Programs

Extensions

a(7) from Gus Wiseman, Aug 30 2016

A084122 Numbers k such that k*prime(k) is a palindrome.

Original entry on oeis.org

1, 2, 5, 12, 16, 3623, 4119, 618725, 708567, 1498739, 2762990591
Offset: 1

Views

Author

Giovanni Resta, May 14 2003

Keywords

Comments

a(12) > 3.7*10^12. - Giovanni Resta, Jun 28 2013

Examples

			4119 is in the sequence since the 4119th prime is 39119 and 4199*39119 = 161131161 is a palindrome.
		

Crossrefs

Programs

  • Maple
    ispal:= proc(n) local L;
      L:= convert(n,base,10);
      L = ListTools:-Reverse(L);
    end proc:
    R:= NULL: count:= 0: p:= 1:
    for k from 1 while count < 11 do
      p:= nextprime(p);
      if ispal(k*p) then R:= R,k; count:= count+1 fi
    od:
    R; # Robert Israel, Feb 22 2023
  • Mathematica
    palQ[n_]:=FromDigits[Reverse[IntegerDigits[n]]]==n; t={}; Do[If[palQ[Prime[n]*n],AppendTo[t,n]],{n,15*10^5}]; t (* Jayanta Basu, May 11 2013 *)
  • PARI
    ispal(n) = my(d=digits(n)); d == Vecrev(d); \\ A002113
    isok(k) = ispal(k*prime(k)) \\ Alexandru Petrescu, Feb 22 2023
    
  • Python
    from sympy import sieve
    def ok(n): return n and (s := str(n*sieve[n])) ==  s[::-1]
    print([k for k in range(10**6) if ok(k)]) # Michael S. Branicky, Feb 22 2023

A105455 Numbers k such that k*prime(k)+(k+1)*prime(k+1)+(k+2)*prime(k+2) is prime.

Original entry on oeis.org

1, 6, 12, 20, 22, 24, 28, 30, 34, 56, 60, 142, 144, 148, 168, 192, 196, 230, 252, 260, 276, 282, 304, 322, 334, 344, 346, 352, 366, 374, 380, 386, 394, 404, 418, 424, 432, 440, 444, 470, 478, 484, 572, 590, 610, 612, 630, 642, 662, 684, 754, 766, 784, 790, 840, 842, 874, 886
Offset: 1

Views

Author

Zak Seidov, May 02 2005

Keywords

Examples

			k=1: 1*prime(1) + 2*prime(2) + 3*prime(3) = 1*2 + 2*3 + 3*5 = 23 prime,
k=6: 6*prime(6) + 7*prime(7) + 8*prime(8) = 6*13 + 7*17 + 8*19 = 349 prime. - _Zak Seidov_, Feb 18 2016
		

Crossrefs

Programs

  • Magma
    [n: n in [1..1000] | IsPrime(n*NthPrime(n)+(n+1)*NthPrime(n+1)+(n+2)*NthPrime(n+2))]; // Vincenzo Librandi, Feb 06 2016
    
  • Mathematica
    bb={};Do[If[PrimeQ[n Prime[n]+(n+1) Prime[n+1]+(n+2) Prime[n+2]], bb=Append[bb, n]], {n, 1, 400}];bb
    Select[Range@ 900, PrimeQ[# Prime[#] + (# + 1) Prime[# + 1] + (# + 2) Prime[# + 2]] &] (* Michael De Vlieger, Feb 05 2016 *)
  • PARI
    lista(nn) = {for(n=1, nn, if(ispseudoprime(n*prime(n)+(n+1)*prime(n+1)+(n+2)*prime(n+2)), print1(n, ", "))); } \\ Altug Alkan, Feb 05 2016
    
  • Python
    from itertools import islice
    from sympy import isprime, nextprime
    def agen(): # generator of terms
        m, p, q, r = 1, 2, 3, 5
        while True:
            t = m*p + (m+1)*q + (m+2)*r
            if isprime(t): yield m
            m, p, q, r = m+1, q, r, nextprime(r)
    print(list(islice(agen(), 58))) # Michael S. Branicky, May 17 2022

A152117 a(n) = n*(n-th prime) + (n+1)*((n+1)-th prime).

Original entry on oeis.org

8, 21, 43, 83, 133, 197, 271, 359, 497, 631, 785, 977, 1135, 1307, 1553, 1851, 2101, 2371, 2693, 2953, 3271, 3647, 4045, 4561, 5051, 5407, 5777, 6157, 6551, 7327, 8129, 8713, 9247, 9941, 10651, 11245, 12003, 12707, 13433, 14259, 14941, 15815, 16705
Offset: 1

Views

Author

Klaus Brockhaus, Dec 10 2008

Keywords

Comments

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

Examples

			5*(fifth prime) + 6*(sixth prime) = 5*11 + 6*13 = 55 + 78 = 133.
		

Crossrefs

Cf. A000040 (prime numbers), A033286 (n*(n-th prime)), A033287 (first differences of A033286), A119487 (primes in this sequence).

Programs

  • Magma
    [ n*NthPrime(n)+(n+1)*NthPrime(n+1): n in [1..43] ];
    
  • Mathematica
    Total/@Partition[Times@@@Table[{n,Prime[n]},{n,50}],2,1] (* Harvey P. Dale, Aug 13 2019 *)
  • PARI
    a(n) = n*prime(n) + (n+1)*prime(n+1); \\ Michel Marcus, Feb 05 2016
Showing 1-10 of 49 results. Next