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 10 results.

A341280 Numbers k such that A073837(k) is a multiple of k.

Original entry on oeis.org

1, 4, 6, 8, 10, 12, 17, 20, 31, 34, 52, 85, 92, 555, 1723, 2870, 2904, 3943, 19325, 41708, 145474, 225476, 240632, 666862, 8911645, 10249751, 138543006, 209659550, 265831784, 540388470, 949428097, 2813155218, 12323589092, 407224380494, 1704233306223, 3361207818001
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Feb 16 2021

Keywords

Comments

Numbers k such that the sum of primes from k to 2*k is divisible by k.
Primes in the sequence include 17, 31, 1723, 3943.
Conjecture: For n > 1, a(n) is prime if and only if a(n) is odd and not a multiple of 5. - Chai Wah Wu, Feb 17 2021
The conjecture is false because a(35) = 1704233306223 is divisible by 3 and a(36) = 3361207818001 is divisible by 11. - Martin Ehrenstein, Feb 21 2021

Examples

			a(3) = 6 is a term because A073837(6) = 7+11 = 18 is divisible by 6.
		

Crossrefs

Cf. A073837.

Programs

  • Maple
    R:= 1: S:= [2,3]: s:= 5: q:= 5: count:= 1:
    for n from 3 while count < 24 do
      if n = S[1]+1 then S:= S[2..-1]; s:= s-n+1 fi;
    if q <= 2*n then S:= [op(S), q]; s:= s+q; q:= nextprime(q) fi;
    if s mod n = 0 then count:= count+1; R:= R, n fi;
    od:
    R;
  • Python
    from sympy import isprime
    k, k2, d, A341280_list = 1, 3, 2, []
    while k < 10**10:
        if d % k == 0:
            A341280_list.append(k)
        if isprime(k):
            d -= k
        if isprime(k2):
            d += k2
        k += 1
        k2 += 2 # Chai Wah Wu, Feb 16 2021

Extensions

a(26)-a(31) from Chai Wah Wu, Feb 16 2021
a(32) from Chai Wah Wu, Feb 17 2021
a(33)-a(36) from Martin Ehrenstein, Feb 21 2021

A341631 Numbers k such that A073837(k) is prime.

Original entry on oeis.org

2, 7, 9, 14, 19, 27, 28, 29, 30, 36, 44, 60, 61, 68, 70, 71, 87, 88, 89, 100, 101, 104, 105, 108, 109, 112, 113, 138, 157, 174, 192, 193, 199, 201, 202, 203, 204, 210, 274, 275, 276, 277, 304, 305, 306, 364, 365, 366, 372, 373, 384, 387, 388, 389, 399, 400, 401, 405, 471, 472, 473, 511, 512, 513
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Feb 16 2021

Keywords

Comments

Numbers k such that the sum of primes from k to 2*k is prime.

Examples

			a(3) = 9 is in the sequence because A073837(9) = 11+13+17 = 41 is prime.
		

Crossrefs

Programs

  • Maple
    R:= 2: S:= [2, 3]: s:= 5: q:= 5: count:= 1:
    for n from 3 while count < 100 do
      if n = S[1]+1 then S:= S[2..-1]; s:= s-n+1 fi;
      if q <= 2*n then S:= [op(S), q]; s:= s+q; q:= nextprime(q) fi;
      if isprime(s) then count:= count+1; R:= R, n;  fi;
    od:
    R;

A341632 Primes in A073837.

Original entry on oeis.org

5, 31, 41, 59, 139, 281, 281, 281, 311, 479, 593, 1153, 1153, 1283, 1559, 1559, 2213, 2213, 2213, 3167, 3167, 2963, 2963, 3067, 3067, 3181, 3181, 5153, 6779, 7451, 9463, 9463, 9859, 10061, 10061, 10061, 10061, 10889, 17539, 17539, 17539, 17539, 22229, 22229, 22229, 30869, 30869, 30869, 32717
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Feb 16 2021

Keywords

Comments

Terms can occur more than once, corresponding to repeated values in A341631.

Examples

			a(3) = A073837(A341631(3)) = A073837(9) = 41.
		

Crossrefs

Programs

  • Maple
    R:= 5: S:= [2, 3]: s:= 5: q:= 5: count:= 1:
    for n from 3 while count < 100 do
      if n = S[1]+1 then S:= S[2..-1]; s:= s-n+1 fi;
    if q <= 2*n then S:= [op(S), q]; s:= s+q; q:= nextprime(q) fi;
    if s mod n = 0 then count:= count+1; R:= R, s fi;
    od:
    R;

Formula

a(n) = A073837(A341631(n)).

A034387 Sum of primes <= n.

Original entry on oeis.org

0, 2, 5, 5, 10, 10, 17, 17, 17, 17, 28, 28, 41, 41, 41, 41, 58, 58, 77, 77, 77, 77, 100, 100, 100, 100, 100, 100, 129, 129, 160, 160, 160, 160, 160, 160, 197, 197, 197, 197, 238, 238, 281, 281, 281, 281, 328, 328, 328, 328, 328, 328, 381, 381, 381, 381, 381
Offset: 1

Views

Author

Keywords

Comments

Also sum of all prime factors in n!.
For large n, these numbers can be closely approximated by the number of primes < n^2. For example, the sum of primes < 10^10 = 2220822432581729238. The number of primes < (10^10)^2 or 10^20 = 2220819602560918840. This has a relative error of 0.0000012743... - Cino Hilliard, Jun 08 2008
Equals row sums of triangle A143537. - Gary W. Adamson, Aug 23 2008
Partial sums of A061397. - Reinhard Zumkeller, Mar 21 2014

Crossrefs

This is a lower bound on A287881.

Programs

  • Haskell
    a034387 n = a034387_list !! (n-1)
    a034387_list = scanl1 (+) a061397_list
    -- Reinhard Zumkeller, Mar 21 2014
    
  • Maple
    a:= proc(n) option remember; `if`(n<1, 0,
          a(n-1)+`if`(isprime(n), n, 0))
        end:
    seq(a(n), n=1..60);  # Alois P. Heinz, Jun 29 2022
  • Mathematica
    s=0; Table[s=s+n*Boole[PrimeQ[n]],{n,100}] (* Zak Seidov, Apr 11 2011 *)
    Accumulate[Table[If[PrimeQ[n],n,0],{n,60}]] (* Harvey P. Dale, Jul 25 2016 *)
  • PARI
    a(n)=sum(i=1,primepi(n),prime(i)) \\ Michael B. Porter, Sep 22 2009
    
  • PARI
    a=0;for(k=1,100,print1(a=a+k*isprime(k),", ")) \\ Zak Seidov, Apr 11 2011
    
  • PARI
    a(n) = if(n <= 1, return(0)); my(r=sqrtint(n)); my(V=vector(r, k, n\k)); my(L=n\r-1); V=concat(V, vector(L, k, L-k+1)); my(T=vector(#V, k, V[k]*(V[k]+1)\2)); my(S=Map(matrix(#V,2,x,y,if(y==1,V[x],T[x])))); forprime(p=2, r, my(sp=mapget(S,p-1), p2=p*p); for(k=1, #V, if(V[k] < p2, break); mapput(S, V[k], mapget(S,V[k]) - p*(mapget(S,V[k]\p) - sp)))); mapget(S,n)-1; \\ Daniel Suteu, Jun 29 2022
    
  • Python
    from sympy import isprime
    from itertools import accumulate
    def alist(n): return list(accumulate(k*isprime(k) for k in range(1, n+1)))
    print(alist(57)) # Michael S. Branicky, Sep 18 2021

Formula

From the prime number theorem a(n) has the asymptotic expression: a(n) ~ n^2 / (2 log n). - Dan Fux (dan.fux(AT)OpenGaia.com), Apr 07 2001
a(n) = A158662(n) - 1. a(p) - a(p-1) = p, for p = primes (A000040), a(c) - a(c-1) = 0, for c = composite numbers (A002808). - Jaroslav Krizek, Mar 23 2009
a(n) = n^2/(2 log n) + O(n^2 log log n/log^2 n). - Vladimir Shevelev and Charles R Greathouse IV, May 29 2014
Conjecture: G.f.: Sum_{i>0} Sum_{j>=i} Sum_{k>=j|i-j+k is prime} x^k. - Benedict W. J. Irwin, Mar 31 2017
a(n) = (n+1)*A000720(n) - A046992(n). - Ridouane Oudra, Sep 18 2021
a(n) = A007504(A000720(n)). - Ridouane Oudra, Feb 22 2022
a(n) = Sum_{p<=n, p prime} p. - Wesley Ivan Hurt, Dec 31 2023

A035250 Number of primes between n and 2n (inclusive).

Original entry on oeis.org

1, 2, 2, 2, 2, 2, 3, 2, 3, 4, 4, 4, 4, 3, 4, 5, 5, 4, 5, 4, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 8, 7, 7, 8, 8, 9, 10, 9, 9, 10, 10, 10, 10, 9, 10, 10, 10, 9, 10, 10, 11, 12, 12, 12, 13, 13, 14, 14, 14, 13, 13, 12, 12, 13, 13, 14, 14, 13, 14, 15, 15, 14, 14, 13, 14, 15
Offset: 1

Views

Author

Keywords

Comments

By Bertrand's Postulate (proved by Chebyshev), there is always a prime between n and 2n, i.e., a(n) is positive for all n.
The number of primes in the interval [n,2*n) is the same sequence as this, except that a(1) = 0. - N. J. A. Sloane, Oct 18 2024
The smallest and largest primes between n and 2n inclusive are A007918 and A060308 respectively. - Lekraj Beedassy, Jan 01 2007
The number of partitions of 2n into exactly two parts with first part prime, n > 1. - Wesley Ivan Hurt, Jun 15 2013

Examples

			The primes between n = 13 and 2n = 26, inclusive, are 13, 17, 19, 23; so a(13) = 4.
a(5) = 2, since 2(5) = 10 has 5 partitions into exactly two parts: (9,1),(8,2),(7,3),(6,4),(5,5).  Two primes are among the first parts: 7 and 5.
		

References

  • Aigner, M. and Ziegler, G. Proofs from The Book (2nd edition). Springer-Verlag, 2001.

Crossrefs

Related sequences:
Primes (p) and composites (c): A000040, A002808, A000720, A065855.
Primes between p(n) and 2*p(n): A063124, A070046; between c(n) and 2*c(n): A376761; between n and 2*n: A035250, A060715, A077463, A108954.
Composites between p(n) and 2*p(n): A246514; between c(n) and 2*c(n): A376760; between n and 2*n: A075084, A307912, A307989, A376759.

Programs

Formula

a(n) = A000720(2*n) - A000720(n-1); a(n) <= A179211(n). - Reinhard Zumkeller, Jul 05 2010
a(A059316(n)) = n and a(m) <> n for m < A059316(n). - Reinhard Zumkeller, Jan 08 2012
a(n) = sum(A010051(k): k=n..2*n). [Reinhard Zumkeller, Jan 08 2012]
a(n) = pi(2n) - pi(n-1). [Wesley Ivan Hurt, Jun 15 2013]

A073838 Product of primes p satisfying n <= p <= 2n.

Original entry on oeis.org

2, 6, 15, 35, 35, 77, 1001, 143, 2431, 46189, 46189, 96577, 96577, 7429, 215441, 6678671, 6678671, 392863, 14535931, 765049, 31367009, 1348781387, 1348781387, 2756205443, 2756205443, 2756205443, 146078888479, 146078888479, 146078888479, 297194980009
Offset: 1

Views

Author

Amarnath Murthy and Benoit Cloitre, Aug 12 2002

Keywords

Comments

a(n) = A034386(2*n)/A034386(n-1); A179214(n) <= a(n). - Reinhard Zumkeller, Jul 05 2010

Examples

			a(7) = 1001 = 7*11*13 (product of primes between 7 and 14).
		

Crossrefs

Cf. A073837.

Programs

  • Maple
    for n from 1 to 50 do l := 1:for j from n to 2*n do if isprime(j) then l := l*j:fi:od:a[n] := l:od:seq(a[j],j=1..50);
  • Mathematica
    Table[Times @@ Select[Range[n, 2 n], PrimeQ], {n, 28}] (* Jayanta Basu, Aug 12 2013 *)
  • PARI
    a(n)=prod(i=n,2*n,i^isprime(i))

Extensions

More terms from Sascha Kurz, Aug 14 2002
Missing a(29) inserted by Andrew Howroyd, Feb 23 2018

A179213 Sum of squarefree numbers between n and 2*n (inclusive).

Original entry on oeis.org

3, 5, 14, 18, 28, 34, 55, 63, 80, 99, 132, 144, 170, 157, 202, 218, 285, 303, 378, 398, 481, 503, 527, 551, 551, 602, 629, 684, 799, 829, 922, 891, 1022, 1056, 1161, 1197, 1344, 1307, 1424, 1464, 1546, 1588, 1717, 1761, 1850, 1941, 2082, 2130, 2227, 2227
Offset: 1

Views

Author

Reinhard Zumkeller, Jul 05 2010

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Total[Select[Range[n,2n],SquareFreeQ]],{n,50}] (* Harvey P. Dale, Apr 29 2017 *)

Formula

a(n) = Sum_{k=n..2*n} k*A008966(k).
A073837(n) <= a(n) <= A045943(n);
a(n) = A066779(2*n) - A066779(n-1).
a(n) ~ (9/Pi^2) * n^2 + O(n^(3/2)). - Amiram Eldar, Mar 07 2021

A352754 a(n) = pi(n) * Sum_{n <= q < 2n, q prime} q.

Original entry on oeis.org

0, 5, 16, 24, 36, 54, 124, 96, 164, 240, 300, 360, 432, 354, 528, 714, 833, 714, 1112, 960, 1288, 1632, 1836, 2052, 2052, 2052, 2529, 2529, 2810, 3110, 4092, 3751, 3751, 4488, 4488, 5269, 6624, 6180, 6180, 7128, 7722, 8268, 8904, 8302, 9548, 9548, 10230, 9525, 10980, 10980
Offset: 1

Views

Author

Wesley Ivan Hurt, Apr 01 2022

Keywords

Comments

Sum of the primes q from the ordered pairs of prime numbers, (p,q), such that p <= n <= q < 2n.

Examples

			a(5) = 36; there are 6 ordered pairs of prime numbers, (p,q), such that p <= 5 <= q < 10: (2,5), (2,7), (3,5), (3,7), (5,5), and (5,7). The sum of the corresponding prime parts q gives 5+7+5+7+5+7 = 36.
		

Crossrefs

Programs

  • Mathematica
    Table[PrimePi[n] Sum[(2 n - k) (PrimePi[2 n - k] - PrimePi[2 n - k - 1]), {k, n}], {n, 100}]

Formula

a(n) = A000720(n) * A073837(n). - Bernard Schott, Apr 02 2022
a(n) = A352775(n) - A352753(n).

A341700 Sum of the primes p satisfying n < p <= 2n.

Original entry on oeis.org

2, 3, 5, 12, 7, 18, 24, 24, 41, 60, 49, 72, 59, 59, 88, 119, 102, 102, 120, 120, 161, 204, 181, 228, 228, 228, 281, 281, 252, 311, 341, 341, 341, 408, 408, 479, 515, 515, 515, 594, 553, 636, 593, 593, 682, 682, 635, 635, 732, 732, 833, 936, 883, 990, 1099, 1099
Offset: 1

Views

Author

Chai Wah Wu, Feb 17 2021

Keywords

Comments

For n >= 2, a(n) is the sum of the prime numbers appearing in the 2nd row of an n X n square array whose elements are the numbers from 1..n^2, listed in increasing order by rows. - Wesley Ivan Hurt, May 17 2021

Examples

			a(7) = 24 = 11+13 (sum of primes larger than 7 and less than or equal to 14).
		

Crossrefs

Programs

  • Mathematica
    Array[Total@ Select[Range[# + 1, 2 #], PrimeQ] &, 56] (* Michael De Vlieger, Feb 17 2021 *)
  • Python
    from sympy import nextprime
    def A341700(n):
        s, m = 0, nextprime(n)
        while m <= 2*n:
            s += m
            m = nextprime(m)
        return s

Formula

a(n) = A034387(2*n) - A034387(n).
a(n) = A073837(n) if n is not a prime. Otherwise, a(n) = A073837(n)-n.
For n >= 2, a(n) = Sum_{k=(n^2-n+2)/2..(n^2+n-2)/2} A010051(A128076(k)) * A128076(k). - Wesley Ivan Hurt, Jan 08 2022

A352775 a(n) = pi(n) * (Sum_{n <= q < 2n, q prime} q) + (pi(2n-1) - pi(n-1)) * (Sum_{p <= n, p prime} p).

Original entry on oeis.org

0, 9, 26, 34, 56, 74, 175, 130, 215, 308, 412, 472, 596, 477, 692, 919, 1123, 946, 1497, 1268, 1673, 2094, 2436, 2652, 2652, 2652, 3229, 3229, 3713, 4013, 5372, 4871, 4871, 5768, 5768, 6709, 8594, 7953, 7953, 9098, 10102, 10648, 11714, 10831, 12358, 12358, 13510
Offset: 1

Views

Author

Wesley Ivan Hurt, Apr 02 2022

Keywords

Comments

Sum of all the parts from all ordered pairs of prime numbers, (p,q), such that p <= n <= q < 2n.

Examples

			a(5) = 56; there are 6 ordered pairs of prime numbers, (p,q), such that p <= 5 <= q < 10: (2,5), (2,7), (3,5), (3,7), (5,5), and (5,7). The sum of all the parts gives 2+5+2+7+3+5+3+7+5+5+5+7 = 56.
		

Crossrefs

Programs

  • Mathematica
    Table[Sum[Sum[k (PrimePi[k] - PrimePi[k - 1]) (PrimePi[2 n - i] - PrimePi[2 n - i - 1]), {k, n}], {i, n}] + PrimePi[n] Sum[(2 n - k) (PrimePi[2 n - k] - PrimePi[2 n - k - 1]), {k, n}], {n, 100}]

Formula

a(n) = A352753(n) + A352754(n).
Showing 1-10 of 10 results.