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-8 of 8 results.

A024011 Numbers k such that the k-th prime divides the sum of the first k primes.

Original entry on oeis.org

1, 3, 20, 31464, 22096548, 1483892396791177
Offset: 1

Views

Author

Keywords

Comments

a(6) > pi(10^12) = 37607912018. - Jon E. Schoenfield, Sep 11 2008
a(6) > pi(10^14) = 3204941750802. - Giovanni Resta, Jan 09 2014
a(7) > 6.5*10^15. - Paul W. Dyson, Sep 27 2022

Examples

			The third prime, 5, divides 2 + 3 + 5 = 10, so 3 is in the sequence.
2 + 3 + 5 + 7 = 17, which is not divisible by the fourth prime, 7, so 4 is not in the sequence.
		

Crossrefs

Programs

  • Mathematica
    s = 0; For[i = 1, i <= 5 * 10^7, i++, s = s + Prime[i]; If[Mod[s, Prime[i + 1]] == 0, Print[i + 1]]]
    With[{prs = Prime[Range[221000000]]}, PrimePi /@ Transpose[Select[ Thread[ {Accumulate[prs], prs}], Divisible[#[[1]], #[[2]]] &]][[2]]] (* Harvey P. Dale, Jul 23 2013 *)
    nMax = 50000; primeSums = Accumulate[Prime[Range[nMax]]]; Select[Range[nMax], Divisible[primeSums[[#]], Prime[#]] &] (* Alonso del Arte, Nov 11 2019 *)
  • PARI
    s=0; t=0; for(w=2,1000000000,if(isprime(w),s=s+w; t=t+1; if(s%w,print(t)),))

Extensions

a(5) from Kok Seng Chua (chuaks(AT)ihpc.nus.edu.sg), May 14 2000
a(6) from Paul W. Dyson, Apr 16 2022

A082974 a(n) = (a(n-1) + p(n)) mod p(n+1).

Original entry on oeis.org

2, 0, 5, 1, 12, 8, 6, 2, 25, 23, 17, 13, 11, 7, 1, 54, 52, 46, 42, 40, 34, 30, 24, 16, 12, 10, 6, 4, 0, 113, 109, 103, 101, 91, 89, 83, 77, 73, 67, 61, 59, 49, 47, 43, 41, 29, 17, 13, 11, 7, 1, 240, 230, 224, 218, 212, 210, 204, 200, 198, 188, 174, 170, 168, 164, 150, 144, 134
Offset: 1

Views

Author

Jon Perry, May 28 2003

Keywords

Comments

Differences when decreasing are essentially A001223, so increases occur when primes being used are roughly double those at previous increase; e.g. a(3352)=(12+31123)mod 31139=31135 and a(6257)=(1+62273)mod 62297=62274 - Henry Bottomley, Jul 13 2003

Examples

			a(2) = (a(1) + 3) mod 5 = 5 mod 5 = 0.
a(3) = (a(2) + 5) mod 7 = 5 mod 7 = 5.
a(4) = (a(3) + 7) mod 11 = 12 mod 11 = 1.
		

Crossrefs

Programs

  • Mathematica
    nxt[{n_,a_}]:={n+1,Mod[a+Prime[n+1],Prime[n+2]]}; NestList[nxt,{1,2},70][[All,2]] (* Harvey P. Dale, Sep 13 2016 *)
  • PARI
    ps=0; pc=1; while (pc<100,ps+=prime(pc); ps%=prime(pc++); print1(ps","))

Extensions

Edited by Henry Bottomley, Jul 13 2003
Definition clarified by Harvey P. Dale, Sep 13 2016

A274995 a(n) is the smallest odd prime that divides (-n) + the sum of all smaller primes, or 0 if no such prime exists.

Original entry on oeis.org

5, 19, 3, 7, 82811, 3, 11, 17, 3, 191, 5, 3, 37, 29, 3, 5, 69431799799, 3, 1105589, 28463, 3, 431, 2947308589, 3, 7, 5, 3, 59, 11, 3, 5, 7, 3, 41
Offset: 0

Views

Author

Neil Fernandez, Nov 11 2016

Keywords

Comments

From Robert G. Wilson v, Nov 15 2016: (Start)
If n == 2 (mod 3) then a(n) = 3;
If n == 0 (mod 5) then a(n) = 5;
If n == 3 (mod 7) then a(n) = 7;
If n == 6 (mod 11) then a(n) = 11;
If n == 2 (mod 13) then a(n) = 13;
If n == 7 (mod 17) then a(n) = 17;
If n == 1 (mod 19) then a(n) = 19;
If n == 8 (mod 23) then a(n) = 23;
in that order; i.e., from smaller to greater prime modulus, etc.
First occurrence of p>2: 2, 0, 3, 6, 54, 7, 1, 123, 13, 36, 12, 33, 453, 46, ..., .
(End)
The congruence classes in the above list, modulo the prime bases, namely 2, 0, 3, 6, 2, ..., are given by A071089, in which each term is the remainder when the sum of the first n primes is divided by the n-th prime. - Neil Fernandez, Nov 23 2016

Examples

			a(1) = 19 because 19 is the smallest odd prime that divides the sum of (-1) + (sum of all primes smaller than itself), that is, -1 + 58 = 57.
a(7) = 17 because -7 + 2 + 3 + 5 + 7 + 11 + 13 + 17 = 49 and 49/7 = 7.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{p = 3, s = 2 - n}, While[ Mod[s, p] != 0, s = s + p; p = NextPrime@ p]; p]; Array[f, 16, 0] (* Robert G. Wilson v, Nov 15 2016 *)
  • PARI
    sump(n) = s = 0; forprime(p=2, n-1, s+=p); s;
    a(n) = {my(p=3); while ((sump(p)-n) % p, p = nextprime(p+1)); p;} \\ Michel Marcus, Nov 12 2016
    
  • PARI
    a(n)=my(s=2); forprime(p=3,, if((s-n)%p==0, return(p)); s+=p) \\ Charles R Greathouse IV, Nov 15 2016

Extensions

a(16)-a(33) from Charles R Greathouse IV, Nov 15 2016

A330578 a(n) is the remainder when the sum of the first n composite numbers is divided by the n-th composite number.

Original entry on oeis.org

0, 4, 2, 0, 7, 1, 7, 3, 14, 4, 12, 6, 21, 7, 24, 16, 7, 25, 5, 15, 4, 26, 14, 1, 11, 36, 22, 34, 4, 33, 17, 31, 14, 46, 28, 9, 23, 3, 38, 17, 53, 9, 25, 2, 42, 18, 59, 9, 52, 26, 44, 64, 37, 9, 57, 28, 48, 18, 69, 7, 60, 28, 82, 49, 71, 37, 2, 59, 23, 81, 44
Offset: 1

Views

Author

Rémy Sigrist, Dec 18 2019

Keywords

Examples

			a(3) = (4 + 6 + 8) mod 8 = 2.
		

Crossrefs

Cf. A002808, A053767, A071089 (prime variant), A330579 (positions of zeros).

Programs

  • PARI
    s=0; forcomposite (c=4, 96, s+=c; print1 (s%c", "))

Formula

a(n) = A053767(n) mod A002808(n).

A066913 (sum of primes < n that do not divide n) (mod n).

Original entry on oeis.org

0, 0, 2, 3, 0, 5, 3, 7, 5, 0, 6, 11, 2, 4, 3, 7, 7, 17, 1, 10, 4, 20, 8, 23, 20, 7, 16, 7, 13, 29, 5, 30, 14, 5, 8, 11, 12, 24, 25, 30, 33, 16, 23, 4, 3, 26, 46, 35, 27, 21, 2, 1, 10, 52, 35, 36, 17, 2, 27, 10, 13, 34, 50, 51, 28, 23, 32, 5, 59, 64, 0, 58, 55, 7, 29, 7, 1, 70, 1
Offset: 1

Views

Author

Leroy Quet, Jan 22 2002

Keywords

Examples

			a(8) = (3 + 5 + 7) (mod 8) = 7 because 3, 5 and 7 are the primes < 8 that do not divide 8.
		

Crossrefs

Programs

  • Mathematica
    Table[Mod[Total[Select[Prime[Range[PrimePi[n]]],Mod[n,#]!=0&]],n],{n,80}] (* Harvey P. Dale, Aug 06 2019 *)
  • PARI
    a(n) = sum(i=1, n-1, if (isprime(i) && (n%i), i)) % n; \\ Michel Marcus, May 20 2014

Formula

a(n) = A066911(n) modulo n. - Michel Marcus, May 20 2014
a(prime(n)) = A071089(n). - Michel Marcus, May 20 2014

A259643 Numbers n such that sum of first n odd primes divides product of first n odd primes.

Original entry on oeis.org

1, 3, 5, 11, 25, 29, 41, 49, 51, 59, 69, 81, 99, 103, 113, 131, 133, 135, 147, 149, 153, 181, 187, 193, 197, 199, 205, 211, 213, 217, 219, 229, 235, 239, 243, 255, 271, 277, 281, 287, 289, 303, 309, 313, 323, 333, 335, 343, 347, 357, 359, 365, 367, 381, 383, 389
Offset: 1

Views

Author

Altug Alkan, Oct 02 2015

Keywords

Comments

Obviously, a(n) is always an odd number.

Examples

			a(1) = 1 because prime(2) mod prime(2) = 3 mod 3 = 0.
a(2) = 3 because (prime(2) * prime(3) * prime(4)) mod (prime(2) + prime(3) + prime(4)) = 105 mod 15 = 0.
a(3) = 5 because (prime(2) * prime(3) * prime(4) * prime(5) * prime(6)) mod (prime(2) + prime(3) + prime(4) + prime(5) + prime(6)) = 15015 mod 39 = 0.
		

Crossrefs

Programs

  • Mathematica
    Module[{nn=400,op},op=Prime[Range[2,nn+1]];Select[Range[nn],Divisible[ Times@@ Take[op,#],Total[Take[op,#]]]&]] (* Harvey P. Dale, Nov 16 2022 *)

A262807 a(n) = (Product_{k=1..n} prime(k+1)) mod (Sum_{k=1..n} prime(k+1)) where prime(k) is the k-th prime number.

Original entry on oeis.org

0, 7, 0, 11, 0, 7, 45, 91, 24, 55, 0, 113, 93, 175, 308, 153, 414, 395, 273, 355, 609, 779, 558, 23, 0, 843, 962, 185, 0, 547, 1634, 21, 170, 1149, 1455, 2483, 1830, 2275, 2865, 1989, 0, 1515, 1211, 2013, 1105, 403, 2733, 819, 0, 4011, 0, 1457, 4278, 1155, 391, 1717, 2596, 2163, 0, 5985
Offset: 1

Views

Author

Altug Alkan, Oct 02 2015

Keywords

Comments

Remainder when product of first n odd primes is divided by sum of first n odd primes.
Obviously a(2n) cannot be 0. Does 0 appear in the sequence infinitely often?

Examples

			a(1) = prime(2) mod prime(2) = 3 mod 3 = 0.
a(2) = (prime(2) * prime(3)) mod (prime(2) + prime(3)) = 15 mod 8 = 7.
a(3) = (prime(2) * prime(3) * prime(4)) mod (prime(2) + prime(3) + prime(4)) = 105 mod 15 = 0.
a(4) = (prime(2) * prime(3) * prime(4) * prime(5)) mod (prime(2) + prime(3) + prime(4) + prime(5)) = 1155 mod 26 = 11.
		

Crossrefs

Programs

  • Mathematica
    Table[Mod[Product[Prime[k + 1], {k, n}], Sum[Prime[k + 1], {k, n}]], {n, 60}] (* Michael De Vlieger, Oct 02 2015 *)
  • PARI
    a(n) = prod(k=1, n, prime(k+1)) % sum(k=1, n, prime(k+1));
    vector(60, n, a(n))

Formula

a(n) = A070826(n+1) mod A071148(n).

A301852 Integers k such that the remainder of the sum of the first k primes divided by the k-th prime is equal to k.

Original entry on oeis.org

2, 7, 12, 83408, 5290146169416
Offset: 1

Views

Author

J. M. Bergot, Mar 27 2018

Keywords

Comments

Integers k such that A071089(k) = k.
From Robert Israel, Mar 27 2018: (Start)
No more terms below 10^7.
Heuristically, the probability that k is a term is 1/prime(k) ~ 1/(k log k).
Since Sum_{k>=2} 1/(k log(k)) diverges, there should be infinitely many terms. However, the sum diverges very slowly, so terms may be very sparse: approximately log(log(k)) terms <= k. (End)
No more terms below 10^9. - Michel Marcus, Mar 28 2018
No more terms below 1.44*10^12. - Giovanni Resta, Apr 06 2018
No mroe terms below 10^13. - Lucas A. Brown, May 18 2023

Examples

			2 is a term because prime(1)+prime(2) = 5 = 2 mod prime(2).
		

Crossrefs

Programs

  • Maple
    res:= NULL: p:= 1: s:= 0:
    for m from 1 to 10^6 do
      p:= nextprime(p);
      s:= s+p;
      if s mod p = m then res:= res, m fi
    od:
    res; # Robert Israel, Mar 27 2018
  • PARI
    lista(nn)= my(p = 2, s = 2); for (n=1, nn, if ((s % p) == n, print1(n, ", ")); q = nextprime(p+1); s += q; p = q;); \\ Michel Marcus, Mar 27 2018

Extensions

a(4) from Michel Marcus, Mar 27 2018
a(5) from Lucas A. Brown, May 18 2023
Showing 1-8 of 8 results.