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 11-14 of 14 results.

A111287 a(n) = smallest k such that prime(n) divides Sum_{i=1..k} prime(i).

Original entry on oeis.org

1, 10, 2, 5, 8, 49, 4, 23, 23, 7, 39, 29, 6, 10, 39, 25, 30, 151, 38, 19, 139, 27, 174, 21, 287, 422, 240, 24, 94, 22, 16, 173, 861, 231, 143, 140, 213, 902, 18, 134, 143, 310, 70, 58, 12, 550, 237, 210, 229, 57, 221, 271, 194, 540, 145, 718, 116, 184, 90, 14, 168, 455, 61, 454
Offset: 1

Views

Author

N. J. A. Sloane, Nov 03 2005

Keywords

Comments

It follows from a theorem of Daniel Shiu that k always exists. Shiu has proved that if (a,b) = 1 then the arithmetic progression a, a + b, ..., a + k*b, ... contains arbitrarily long sequences of consecutive primes. Since, for any positive integer b, there are thus arbitrarily long sequences of consecutive primes congruent to 1 mod b, there must be infinitely many a(n) that are divisible by b.
To clarify the previous comment: If the sum of the primes up to some point is s (mod b), then we need exactly b-s consecutive primes equal to 1 (mod b) to produce a sum divisible by b. Hence when there are b-1 consecutive primes congruent to 1 (mod b), then the sum of primes up to one of those primes will be divisible by b. - T. D. Noe, Dec 02 2009

Examples

			A007504 begins 2,5,10,17,28,41,58,77,100,129,... and the k=10th term is the first one that is divisible by prime(2) = 3, so a(2) = 10 (see also A103208).
		

Crossrefs

Programs

  • Maple
    read transforms; M:=1000; p0:=[seq(ithprime(i),i=1..M)]; q0:=PSUM(p0); w:=[]; for n from 1 to M do p:=p0[n]; hit := 0; for i from 1 to M do if q0[i] mod p = 0 then w:=[op(w),i]; hit:=1; break; fi; od: if hit = 0 then break; fi; od: w;
  • Mathematica
    Table[p=Prime[n]; s=0; k=0; While[k++; s=Mod[s+Prime[k],p]; s>0]; k, {n,10}] (* T. D. Noe, Dec 02 2009 *)
  • PARI
    A111287(n)= n=Mod(0,prime(n)); for(k=1,1e9, (n+=prime(k)) || return(k)) \\ M. F. Hasler, Nov 29 2009

Extensions

The comments are based on correspondence with Paul Pollack and a posting to sci.math by Fred Helenius.
Typo in reference fixed by David Applegate, Dec 18 2009

A327449 Number of ways the first n primes can be partitioned into three sets with equal sums.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 423, 0, 2624, 0, 13474, 0, 0, 0, 611736, 0, 4169165, 0, 30926812, 0, 214975174, 0, 1590432628, 0, 11431365932, 0, 83946004461, 0, 0, 0, 4615654888831, 0, 35144700468737, 0, 271133285220726, 0, 2103716957561013, 0, 0, 0, 0, 0, 990170108748552983, 0, 7855344215856348141
Offset: 1

Views

Author

N. J. A. Sloane, Sep 19 2019

Keywords

Comments

It is not true that a(2k+1) is always 0.

Examples

			One of the three solutions for n = 10: 3 + 17 + 23 = 2 + 5 + 7 + 29 = 11 + 13 + 19.
		

References

  • Keith F. Lynch, Posting to Math Fun Mailing List, Sep 17 2019.

Crossrefs

Programs

  • Maple
    s:= proc(n) option remember; `if`(n<2, 0, ithprime(n)+s(n-1)) end:
    b:= proc(n, x, y) option remember; `if`(n=1, 1, (p-> (l->
          add(`if`(p>l[i], 0, b(n-1, sort(subsop(i=l[i]-p, l))
          [1..2][])), i=1..3))([x, y, s(n)-x-y]))(ithprime(n)))
        end:
    a:= n-> `if`(irem(2+s(n), 3, 'q')=0, b(n, q-2, q)/2, 0):
    seq(a(n), n=1..40);  # Alois P. Heinz, Sep 19 2019
  • Mathematica
    s[n_] := s[n] = If[n < 2, 0, Prime[n] + s[n - 1]];
    b[n_, x_, y_] := b[n, x, y] = If[n == 1, 1, Function[p, Function[l, Sum[If[ p > l[[i]], 0, b[n - 1, Sequence @@ Sort[ReplacePart[l, i -> l[[i]] - p]][[1;; 2]]]], {i, 1, 3}]][{x, y, s[n] - x - y}]][Prime[n]]];
    a[n_] := If[Mod[2+s[n], 3]==0, q = Quotient[2+s[n], 3]; b[n, q-2, q]/2, 0];
    Array[a, 40] (* Jean-François Alcover, Apr 09 2020, after Alois P. Heinz *)
  • PARI
    EqSumThreeParts(v)={ my(n=#v, vs=vector(n), m=vecsum(v)/3, brk=0);
      for(i=1, n-1, vs[i+1]=vs[i]+v[i]; if(vs[i]<=min(1000,m), brk=i));
      my(q=Vecrev(prod(i=1, brk, 1+x^v[i]+y^v[i])));
      my(recurse(k,s,p)=if(k==brk, if(s<#q, polcoef(p*q[s+1],m,y)), if(s<=vs[k], self()(k-1, s, p*(1 + y^v[k]))) + if(s>=v[k], self()(k-1, s-v[k], p)) ));
      if(frac(m), 0, recurse(n-1, m, 1 + O(y*y^m))/2);
    }
    a(n)={EqSumThreeParts(primes(n))} \\ Andrew Howroyd, Sep 19 2019

Formula

a(n) > 0 <=> n in { A103208 }, with odd n in { A111320 }. - Alois P. Heinz, Sep 19 2019

Extensions

Corrected and a(30)-a(52) added by Andrew Howroyd, Sep 19 2019
a(53) and beyond from Alois P. Heinz, Sep 19 2019

A053095 Number of primes having exactly the same digits as appear in first n primes.

Original entry on oeis.org

1, 1, 1, 8, 62, 568, 5370, 114546, 2898058, 0, 1119268465, 26053674813
Offset: 1

Views

Author

Enoch Haga, Mar 19 2000

Keywords

Comments

a(n) = 0 if sum of digits is a multiple of three (see A103208). - Ray Chandler, Apr 07 2010

Examples

			a(4) = 8 because the first four prime n, concatenated, are 2+3+5+7 or 2357. There are 8 prime arrangements: 2357, 2753, 3257, 3527, 5237, 5273, 7253, 7523.
		

Crossrefs

Programs

  • Python
    from sympy import isprime, prime
    from sympy.utilities.iterables import multiset_permutations
    def A053095(n):
        return sum(1 for d in multiset_permutations(''.join(str(prime(m+1)) for m in range(n))) if isprime(int(''.join(d)))) # Chai Wah Wu, Mar 17 2019

Extensions

a(7)-a(9) from Ray Chandler, Apr 07 2010
a(10) from Ray Chandler, Apr 08 2010
a(11) from Michael S. Branicky, Mar 17 2025
a(12) from Michael S. Branicky, Apr 07 2025

A102066 Sum of the first n primes, mod 6.

Original entry on oeis.org

2, 5, 4, 5, 4, 5, 4, 5, 4, 3, 4, 5, 4, 5, 4, 3, 2, 3, 4, 3, 4, 5, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 2, 3, 2, 3, 4, 5, 4, 3, 2, 3, 2, 3, 2, 3, 4, 5, 4, 5, 4, 3, 4, 3, 2, 1, 0, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 3, 2, 1, 2, 3, 4, 3, 2, 3, 2, 3, 2, 3, 2, 3, 4, 3
Offset: 1

Views

Author

Alan Sutcliffe (alansut(AT)ntlworld.com), Dec 28 2004

Keywords

Comments

Curiosity, it takes almost 60 terms before 1 and 0 appear. Stability arises from near equal (often alternating) occurrences of p mod 6 = 1 and p mod 6 = 5.

Examples

			a(5) = 4 since (2+3+5+7+11) mod 6 = 4.
		

References

  • H. L. Nelson, "Prime Sums", J. Rec. Math., 14 (1981), 205-206.

Crossrefs

Programs

  • Mathematica
    Mod[Accumulate[Prime[Range[120]]],6] (* Harvey P. Dale, Jun 19 2014 *)
  • PARI
    a(n) = sum(i=1, n, prime(i)) % 6 \\ Michel Marcus, Jul 12 2013

Formula

sum(p(n)) mod 6.

Extensions

More terms from Harvey P. Dale, Jun 19 2014
Previous Showing 11-14 of 14 results.