[go: up one dir, main page]

login
Search: a033286 -id:a033286
     Sort: relevance | references | number | modified | created      Format: long | short | data
First differences of A033286.
+20
2
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,1
KEYWORD
nonn
AUTHOR
STATUS
approved
Decimal expansion of Sum_{n>=1} 1/A033286(n)^2.
+20
0
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,1
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
EXAMPLE
0.284170705470...
PROG
(PFGW & SCRIPT)
SCRIPT
DIM i, 0
DIM j, 0
DIM n
DIM m
DIMS t
OPENFILEOUT myf, a(n).txt
OPENFILEIN maf, pre.txt
LABEL loop1
SET i, i+1
IF i>10000000 THEN END
GETNEXT n, maf
SET j, j+10^10000/((i*n)^2)
IF i%1000000==0 THEN SET m, j/10^9970
IF i%1000000==0 THEN WRITE myf, m
GOTO loop1
CROSSREFS
Cf. A033286 (n*prime(n)), A124012.
KEYWORD
nonn,cons,more
AUTHOR
Pierre CAMI, Jan 07 2015
STATUS
approved
Sum of the first n primes.
(Formerly M1370)
+10
495
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,2
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).
LINKS
C. Axler, On a Sequence involving Prime Numbers, J. Int. Seq. 18 (2015) # 15.7.6.
Christian Axler, New bounds for the sum of the first n prime numbers, arXiv:1606.06874 [math.NT], 2016.
P. Hecht, Post-Quantum Cryptography: S_381 Cyclic Subgroup of High Order, International Journal of Advanced Engineering Research and Science (IJAERS, 2017) Vol. 4, Issue 6, 78-86.
Nilotpal Kanti Sinha, On the asymptotic expansion of the sum of the first n primes, arXiv:1011.1667 [math.NT], 2010-2015.
Lawrence C. Washington, Sums of Powers of Primes II, arXiv preprint (2022). arXiv:2209.12845 [math.NT]
Eric Weisstein's World of Mathematics, Prime Sums
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
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 *)
PROG
(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
(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)
(Haskell)
a007504 n = a007504_list !! n
a007504_list = scanl (+) 0 a000040_list
-- Reinhard Zumkeller, Oct 01 2014, Oct 03 2011
(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
(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
CROSSREFS
See A122989 for the value of Sum_{n >= 1} 1/a(n).
KEYWORD
nonn,nice
EXTENSIONS
More terms from Stefan Steinerberger, Apr 11 2006
a(0) = 0 prepended by M. F. Hasler, Mar 05 2014
STATUS
approved
a(n) = prime(n)-n, the number of nonprimes less than prime(n).
+10
72
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,3
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
FORMULA
G.f: b(x) - x/((1-x)^2), where b(x) is the g.f. of A000040. - Mario C. Enriquez, Dec 13 2016
MATHEMATICA
Table[Prime[n] - n, {n, 61}] (* Alonso del Arte *)
PROG
(PARI) a(n) = prime(n)-n \\ Charles R Greathouse IV, Sep 05 2011
(Haskell)
a014689 n = a000040 n - fromIntegral n
-- Reinhard Zumkeller, Apr 09 2012
(Magma) [NthPrime(n)-n: n in [1..70]]; // Vincenzo Librandi, Mar 20 2013
(Python)
from sympy import prime
def A014689(n): return prime(n)-n # Chai Wah Wu, Oct 11 2024
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).
KEYWORD
nonn,easy,nice
EXTENSIONS
More terms from Vasiliy Danilov (danilovv(AT)usa.net), July 1998
Correction for Aug 2009 change of offset in A158611 and A008578 by Jaroslav Krizek, Jan 27 2010
STATUS
approved
a(n) = Sum_{j=1..n} j*prime(j).
+10
14
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,1
COMMENTS
Two consecutive terms cannot both be divisible by 4. - Tamas Sandor Nagy, Aug 04 2024
LINKS
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
MATHEMATICA
Join[{s=2}, Table[s+=Prime[n]*n, {n, 2, 33}]] (* Vladimir Joseph Stephan Orlovsky, Dec 30 2010 *)
Accumulate[Table[i*Prime[i], {i, 40}]] (* Harvey P. Dale, Sep 10 2014 *)
PROG
(Magma) [&+[k*NthPrime(k): k in [1..n]]: n in [1..40]]; // Bruno Berselli, Apr 30 2011
(PARI) {a(n) = sum(j=1, n, j*prime(j))}; \\ G. C. Greubel, Jun 18 2019
(Sage) [sum(j*nth_prime(j) for j in (1..n)) for n in (1..40)] # G. C. Greubel, Jun 18 2019
CROSSREFS
Partial sums of A033286. - Michel Marcus, Jun 18 2019
KEYWORD
nonn,easy
EXTENSIONS
Offset changed to 1 and six terms added by Bruno Berselli, Apr 30 2011
STATUS
approved
a(n) = n*prime(n) - Sum_{i=1..n} prime(i).
+10
12
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,3
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
LINKS
Christian Axler, On a sequence involving the prime numbers, arXiv:1504.04467 [math.NT], 2015 and J. Int. Seq. 18 (2015) # 15.7.6.
Christian Axler, Improving the Estimates for a Sequence Involving Prime Numbers, arXiv:1706.04049 [math.NT], 2017.
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
EXAMPLE
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)
MATHEMATICA
nn = 100; p = Prime[Range[nn]]; Range[nn] p - Accumulate[p] (* T. D. Noe, May 02 2011 *)
PROG
(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
(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
KEYWORD
easy,nonn
AUTHOR
Omar E. Pol, Dec 06 2008
STATUS
approved
a(1) = 1; a(n) = a(n-1)*prime(a(n-1)).
+10
10
1, 2, 6, 78, 30966, 11234495766, 3197149582479668022558
OFFSET
1,2
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
MATHEMATICA
NestList[# Prime@ # &, 1, 6] (* Michael De Vlieger, Aug 30 2016 *)
KEYWORD
nonn,hard,more
AUTHOR
Zak Seidov, Nov 02 2002
EXTENSIONS
a(7) from Gus Wiseman, Aug 30 2016
STATUS
approved
Numbers k such that k*prime(k) is a palindrome.
+10
9
1, 2, 5, 12, 16, 3623, 4119, 618725, 708567, 1498739, 2762990591
OFFSET
1,2
COMMENTS
a(12) > 3.7*10^12. - Giovanni Resta, Jun 28 2013
EXAMPLE
4119 is in the sequence since the 4119th prime is 39119 and 4199*39119 = 161131161 is a palindrome.
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 *)
PROG
(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
CROSSREFS
KEYWORD
base,nonn,more
AUTHOR
Giovanni Resta, May 14 2003
STATUS
approved
Numbers n such that n*prime(n)+(n+1)*prime(n+1)+(n+2)*prime(n+2) is prime.
+10
9
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,2
LINKS
EXAMPLE
n=1: 1*prime(1) + 2*prime(2) + 3*prime(3) = 1*2 + 2*3 + 3*5 = 23 prime,
n=6: 6*prime(6) + 7*prime(7) + 8*prime(8) = 6*13 + 7*17 + 8*19 = 349 prime. - Zak Seidov, Feb 18 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 *)
PROG
(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
(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
(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
CROSSREFS
KEYWORD
nonn
AUTHOR
Zak Seidov, May 02 2005
STATUS
approved
a(n) = n*(n-th prime) + (n+1)*((n+1)-th prime).
+10
9
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,1
COMMENTS
a(n) = A033286(n) + A033286(n+1).
LINKS
EXAMPLE
5*(fifth prime) + 6*(sixth prime) = 5*11 + 6*13 = 55 + 78 = 133.
MATHEMATICA
Total/@Partition[Times@@@Table[{n, Prime[n]}, {n, 50}], 2, 1] (* Harvey P. Dale, Aug 13 2019 *)
PROG
(Magma) [ n*NthPrime(n)+(n+1)*NthPrime(n+1): n in [1..43] ];
(PARI) a(n) = n*prime(n) + (n+1)*prime(n+1); \\ Michel Marcus, Feb 05 2016
CROSSREFS
Cf. A000040 (prime numbers), A033286 (n*(n-th prime)), A033287 (first differences of A033286), A119487 (primes in this sequence).
KEYWORD
nonn
AUTHOR
Klaus Brockhaus, Dec 10 2008
STATUS
approved

Search completed in 0.021 seconds