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.

Previous Showing 31-40 of 47 results. Next

A120850 Numbers n such that n is prime and is equal to the sum of the first k primes plus the product of the first k primes, for some k.

Original entry on oeis.org

11, 227, 30071, 24647906487115793512432470614609487044327490547070674282967249490409801198254927547005559122946385681862066942903289, 62797802135946735863734268232365323600796854989079318289826397214991489160762431714712874321823048719463864215556568570809157897364620234601356930764612312239892910549558645813243759770009793795858849126389709
Offset: 1

Views

Author

Carlos Alves, Jul 08 2006

Keywords

Comments

It is in the spirit of A096342 (only for 2 consecutive primes) and of A013918 (all primes but only the sum).
The corresponding values of k are 2, 4, 6, 60, 96, ... - Amiram Eldar, Dec 19 2018

Examples

			11=(2+3)+(2*3) and 11 is prime.
227= (2+3+5+7)+(2*3*5*7) and 227 is prime.
		

Crossrefs

Programs

  • Mathematica
    tb = {};Do[pq = Plus @@ Prime[Range[1, k]] + Times @@ Prime[Range[1, k]]; If[PrimeQ[pq], AppendTo[tb, pq]], {k, 1, 200}]; tb

A136288 Primes which are the absolute value of the alternating sum and difference of the first n primes.

Original entry on oeis.org

2, 3, 5, 7, 13, 19, 29, 53, 61, 71, 79, 83, 97, 103, 113, 139, 149, 151, 157, 163, 167, 191, 199, 233, 251, 281, 337, 347, 353, 397, 421, 433, 461, 563, 599, 643, 719, 773, 797, 811, 859, 883, 953, 977, 1031, 1039, 1061, 1063, 1091, 1097, 1153, 1187, 1201, 1213
Offset: 1

Views

Author

Keywords

Examples

			5 = abs(2-3+5-7+11-13) (first 6 primes),
7 = abs(2-3+5-7+11-13+17-19) (first 8 primes),
etc.
		

Crossrefs

Programs

  • Maple
    P:=proc(n) local i,s; s:=0; for i from 1 by 1 to n do s:=s+(-1)^i*ithprime(i); if isprime(abs(s)) then print(abs(s)); fi; od; end: P(1000);
  • Mathematica
    Select[Abs@Accumulate@Table[(-1)^(k+1)*Prime@k,{k,355}],PrimeQ] (* Giorgos Kalogeropoulos, Sep 22 2021 *)

Formula

A000040 INTERSECT A008347. - R. J. Mathar, Apr 04 2008

A155851 n is prime and is the sum of the first k primes for some k, start from 5.

Original entry on oeis.org

5, 23, 53, 233, 563, 1259, 2579, 2909, 12713, 22543, 28099, 31729, 39607, 41017, 42463, 87511, 110359, 115279, 117787, 138863, 141671, 213533, 242243, 257353, 265117, 269069, 289171, 310019, 318557, 327193, 331603, 354097, 372607, 441101
Offset: 1

Views

Author

Keywords

Comments

Analogous to A013918, A071151. Number '5' is first prime number after first composite number '4'.

Crossrefs

Programs

  • Mathematica
    s=0;lst={};Do[p=Prime[n];s+=p;If[PrimeQ[s],AppendTo[lst,s]],{n,3,7!}];lst
    Select[Accumulate[Prime[Range[3,500]]],PrimeQ] (* Harvey P. Dale, Jun 22 2015 *)

A178532 Partial sums of problimes (third definition, A003068).

Original entry on oeis.org

2, 6, 13, 24, 39, 58, 81, 109, 142, 180, 223, 271, 324, 382, 445, 513, 586, 665, 750, 841, 938, 1041, 1150, 1265, 1386, 1513, 1646, 1785, 1930, 2081, 2238, 2401, 2570, 2745, 2926, 3113, 3306, 3505, 3710, 3921, 4138, 4362, 4593, 4831, 5076
Offset: 1

Views

Author

Jonathan Vos Post, Dec 28 2010

Keywords

Comments

The subsequence of prime partial sums of problimes begins: 2, 13, 109, 223, 271, 2081, 4831, 8233.
The subsequence of problime partial sums of problimes begins: 2, 58, 109.

Examples

			a(12) = 2 + 4 + 7 + 11 + 15 + 19 + 23 + 28 + 33 + 38 + 43 + 48 = 271 is prime.
		

Crossrefs

Formula

SUM[i=1..n] A003068(i).

A235431 The smallest positive number that must be added to or subtracted from the sum of the first n primes in order to get a prime.

Original entry on oeis.org

1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 1, 2, 3, 2, 1, 2, 1, 2, 3, 4, 3, 4, 1, 2, 5, 2, 1, 4, 1, 4, 1, 2, 3, 4, 5, 2, 3, 2, 5, 2, 1, 2, 1, 2, 3, 2, 1, 2, 1, 2, 3, 2, 1, 2, 1, 10, 1, 4, 11, 2, 1, 6
Offset: 1

Views

Author

R. J. Cano, Jan 17 2014

Keywords

Comments

The primes in A013918 would have associated a(n)=0 if not for the qualifier "positive" in the definition.
The sum of the first n primes appears to be close to a prime. For illustration, the maximum for a(n) among the first 5 million terms is a(808500) = 218.
See A013916 for the above mentioned indices, numbers n such that the sum of the first n primes is prime. - M. F. Hasler, Jan 20 2014

Examples

			The sum of the first 9 primes is 100, and by adding 1 we get 101. Since 101 is a prime, a(9) = 1.
The sum of the first 10 primes is 129, since 129 - 2 = prime(31) = 127 or 129 + 2 = prime(32) = 131, a(10) = 2.
The sum of the first 129 primes minus 1 is a prime, this is 42468 - 1 = prime(4443), so a(129) = 1.
		

Crossrefs

Programs

  • PARI
    a(n)=my(u=sum(j=1,n,prime(j)),k=1);while(!(isprime(u+k)||isprime(u-k)),k++);k

Formula

Algorithm:
Let S be the sum of the first n primes;
initially, let k=1;
increment k while neither S-k nor S+k is prime;
return a(n)=k.
a(n) = min(A013632(A007504(n)), A049711(A007504(n))). - M. F. Hasler, Jan 20 2014

A257077 a(n) = prime(n)-prime(1)-prime(2)-...-prime(k), while the result > 0.

Original entry on oeis.org

2, 1, 3, 2, 1, 3, 7, 2, 6, 1, 3, 9, 13, 2, 6, 12, 1, 3, 9, 13, 15, 2, 6, 12, 20, 1, 3, 7, 9, 13, 27, 2, 8, 10, 20, 22, 28, 3, 7, 13, 19, 21, 31, 33, 37, 2, 14, 26, 30, 32, 36, 1, 3, 13, 19, 25, 31, 33, 39, 43, 2, 12, 26, 30, 32, 36, 3, 9, 19, 21, 25, 31, 39
Offset: 1

Views

Author

Keywords

Comments

It appears that a(n) = n occurs only for n=3, 7, 13. It also appears that a(n+1) is never equal to a(n).
The list of indices such that a(n)=1 correspond to the primes in A053845. - Michel Marcus, Apr 16 2015
In other words, a(n) = prime(n) - A007504(k) for largest k such that prime(n) > A007504(k). - Danny Rorabaugh, Apr 20 2015

Examples

			a(1) = 2, since there is no previous prime.
a(2) = 1, since 3 - 2 = 1.
a(3) = 3, since 5 - 2 = 3.
a(4) = 2, since 7 - 2 - 3 = 2.
a(5) = 1, since 11 - 2 - 3 - 5 = 1.
a(6) = 3, since 13 - 2 - 3 - 5 = 3.
a(13) = 13, since 41 - 2 - 3 - 5 - 7 - 11 = 13.
		

Crossrefs

Programs

  • Mathematica
    lst = {}; i = 1; While[i <= 1000, x = Prime[i]; k = 1; While[x > 0, x -= Prime[k]; k++]; x += Prime[k - 1]; AppendTo[lst, x]; i++]; lst
  • PARI
    a(n) = {s = prime(n); k = 1; while ((ns = (s - prime(k))) > 0, s = ns; k++); s;} \\ Michel Marcus, Apr 16 2015
    
  • PARI
    s=0; q=2; forprime(p=2,10, if(s+q>p, s+=q; q=nextprime(q+1)); print1(p-s", ")) \\ Charles R Greathouse IV, Apr 22 2015

Formula

a(n) << sqrt(n)*log(n). - Charles R Greathouse IV, Apr 23 2015

A282246 Primes p such that the sum of all primes <= p has no prime divisor > p.

Original entry on oeis.org

2, 5, 11, 19, 23, 31, 41, 47, 59, 71, 83, 97, 101, 103, 109, 113, 127, 137, 157, 163, 167, 173, 179, 191, 197, 223, 227, 229, 233, 239, 241, 263, 269, 271, 317, 337, 349, 353, 367, 389, 401, 409, 433, 439, 449, 457, 461, 463, 467, 491, 521, 563, 571, 607, 613, 617, 631, 641, 653, 661, 701, 709, 719, 739, 757, 797
Offset: 1

Views

Author

Emmanuel Vantieghem, Feb 09 2017

Keywords

Comments

Number of terms < 10^k: 2, 12, 79, 523, 4124, 32678, 267850, etc. Compare these to A006880. - Robert G. Wilson v, Feb 09 2017
Primes p such that A006530(A007504(i)) <= p, where i is the index of p in A000040. - Felix Fröhlich, Feb 12 2017

Examples

			5 is in the sequence for the sum of all primes <= 5 is 10, and 10 has no prime divisor > 5.
17 is not in the sequence for the corresponding sum is 58 which has a prime divisor > 17.
		

Crossrefs

Programs

  • Mathematica
    p = s = 2; lst = {}; While[p < 1000, If[ FactorInteger[s][[-1, 1]] <= p, AppendTo[lst, p]]; p = NextPrime@ p; s = s + p]; lst (* Robert G. Wilson v, Feb 09 2017 *)
  • PARI
    isok(n) = isprime(n) && (vecmax(factor(sum(k=1, primepi(n), prime(k)))[,1]) <= n); \\ Michel Marcus, Feb 12 2017

A325957 Sophie Germain primes equal to the sum of the first k Sophie Germain primes for some k.

Original entry on oeis.org

2, 5, 39233, 50969, 5402909, 6899969, 7722119, 10490933, 24296873, 46322183, 95837639, 117933353, 122693729, 132514703, 181862003, 303953873, 762321281, 929234279, 1044329843, 1150361501, 1335588539, 1353590321, 1662019811, 2048876033, 2176318433, 2250982931
Offset: 1

Views

Author

Metin Sariyar, Sep 10 2019

Keywords

Comments

The sum of first 268 terms of this sequence is also a Sophie Germain prime. 2 + 5 + 39233 + ... + 1187321288921 = 91753770231881.

Examples

			39233 is a term because sum of the first 56 Sophie Germain primes 2 + 3 + 5 + ... + 1811 = 39233 is prime and 39233*2+1 = 78467 is prime.
		

Crossrefs

Programs

  • Mathematica
    lst={}; s=0; Do[If[PrimeQ[n]&&PrimeQ[2*n+1], s=s+n; If[PrimeQ[s]&&PrimeQ[s*2+1], AppendTo[lst, s]]], {n, 1, 1000000}]; lst
  • PARI
    issg(p) = isprime(2*p+1);
    lista(nn) = {my(s=0); forprime(p=2, nn, if (issg(p), s + = p; if (isprime(s) && issg(s), print1(s, ", "); ); ); ); } \\ Michel Marcus, Sep 11 2019

Formula

Equals A005384 Intersection A066819.

A364947 Prime powers that are equal to the sum of the first k prime powers (including 1) for some k.

Original entry on oeis.org

1, 3, 79, 163, 499, 947, 1279, 5297, 6689, 9629, 10853, 17467, 21001, 23887, 25411, 29761, 32089, 33289, 47947, 49429, 55633, 80687, 84697, 96157, 116719, 119159, 126641, 131783, 136991, 153371, 156227, 167861, 182969, 215249, 243161, 257921, 280897, 288853
Offset: 1

Views

Author

Ilya Gutkovskiy, Aug 14 2023

Keywords

Examples

			79 is a term because 79 is a prime power and 79 = 1 + 2 + 3 + 4 + 5 + 7 + 8 + 9 + 11 + 13 + 16 = 1 + 2 + 3 + 2^2 + 5 + 7 + 2^3 + 3^2 + 11 + 13 + 2^4.
		

Crossrefs

Intersection of A000961 and A024918.

Programs

  • Mathematica
    Select[Accumulate[Select[Range[2000], # == 1 || PrimePowerQ[#] &]], # == 1 || PrimePowerQ[#] &]
  • PARI
    isp(n) = n == 1 || isprimepower(n);
    list(lim) = {my(s = 0); for(p = 1, lim, if(isp(p), s += p; if(isp(s), print1(s, ", "))));} \\ Amiram Eldar, Jun 20 2025

A379426 Prime terms in A287353.

Original entry on oeis.org

2, 23, 2357, 23581, 2358247, 235824913, 235824916247, 2358249162515829584909, 235824916251582958491829824917162558516292249258249589629182571583855789, 2358249162515829584918298249171625585162922492582495896291825715838558298516316558918298250261
Offset: 1

Views

Author

Ya-Ping Lu, Dec 22 2024

Keywords

Comments

Primes Sum_{i=1..k} 10^(k-i)*prime(i) for some k.

Examples

			k    prime(k)  A287353(k)  n    a(n)
---  --------  ----------  ---  -------
1    2         2           1    2
2    3         23          2    23
3    5         235
4    7         2357        3    2357
5    11        23581       4    23581
6    13        235823
7    17        2358247     5    2358247
		

Crossrefs

Programs

  • Python
    from sympy import isprime, nextprime
    m = p = 0
    while p < 500:
        p = nextprime(p); m = 10*m + p
        if isprime(m): print(m, end = ', ')
Previous Showing 31-40 of 47 results. Next