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-4 of 4 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

A045985 a(n) = least k such that sum of first k primes is n times a prime.

Original entry on oeis.org

1, 3, 10, 5, 3, 123, 8, 15, 20, 147, 8, 97, 92, 5, 414, 27, 120, 739, 144, 9, 86, 69, 858, 99, 62, 61, 26, 33, 7, 57, 456, 11, 76, 13, 180, 207, 58, 23, 166, 17, 38, 339, 10, 693, 242, 23, 1162, 169, 440, 9, 374, 117, 682, 187, 1284, 683, 70, 281, 48
Offset: 1

Views

Author

Keywords

Examples

			a(3) = 10 because the partial sum of the first 10 primes is 3*43 = 129.
		

Crossrefs

Programs

  • Haskell
    a045985 n = head [k | (k, x) <- zip [1..] a007504_list,
                          let (y, r) = divMod x n, r == 0, a010051' y == 1]
    -- Reinhard Zumkeller, Oct 05 2015
  • Mathematica
    a[n_] := Catch[For[p=0; sp=0; k=1, True, k++, p = NextPrime[p]; sp = sp+p; If[PrimeQ[sp/n], Throw[k]]]]; Table[a[n], {n, 1, 59}] (* Jean-François Alcover, Nov 13 2012 *)
    Module[{nn=1500,p,t},p=Accumulate[Prime[Range[nn]]];t=Thread[{Range[ nn],p}];Table[SelectFirst[t,PrimeQ[ #[[2]]/n]&],{n,60}]][[All,1]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Mar 16 2020 *)

Extensions

More terms from David W. Wilson

A308749 Smallest positive m such that n*m is a partial sum of primes.

Original entry on oeis.org

2, 1, 43, 7, 1, 1145, 4, 20, 71, 1, 7, 1879, 376, 2, 458, 10, 1, 1763, 46, 5, 147, 20, 38, 983, 4, 188, 43, 1, 2, 229, 94, 5, 397, 7, 2531, 988, 40, 23, 912, 4, 1, 6692, 3, 10, 3769, 19, 62, 741, 63, 2, 1716, 94, 20, 1783, 8, 589, 191, 1, 27, 430, 986, 47, 49
Offset: 1

Views

Author

Alois P. Heinz, Jun 21 2019

Keywords

Crossrefs

Programs

  • Maple
    s:= proc(n) option remember; `if`(n=0, 0, ithprime(n)+s(n-1)) end:
    a:= proc(n) option remember; local k; for k
          while irem(s(k), n)>0 do od; s(k)/n
        end:
    seq(a(n), n=1..70);
  • Mathematica
    s[n_] := s[n] = If[n == 0, 0, Prime[n] + s[n-1]];
    a[n_] := a[n] = Module[{k}, For[k = 1, True, k++, If[Mod[s[k], n] <= 0, Return[s[k]/n]]]];
    Table[a[n], {n, 1, 70}] (* Jean-François Alcover, Dec 08 2023, after Alois P. Heinz *)

Formula

a(n) = A007504(A053050(n))/n.
a(n) = 1 <=> n in { A007504 } \ { 0 }.

A331479 Table read by rows: row n lists the numbers m such that the first n primes can be partitioned into m subsets all of which have the same sum.

Original entry on oeis.org

1, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 3, 1, 2, 4, 1, 1, 2, 1, 1, 2, 4, 1, 3, 1, 2, 4, 5, 1, 3, 1, 2, 4, 1, 3, 1, 2, 4, 1, 7, 1, 2, 1, 3, 1, 2, 4, 5, 1, 3, 1, 2, 4, 1, 3, 1, 2, 4, 5, 8, 1, 3, 9, 1, 2, 4, 5, 8, 1, 3, 1, 2, 4, 7, 1, 3, 1, 2, 4, 1, 3, 1, 2, 4, 8
Offset: 1

Views

Author

Jon E. Schoenfield, Jan 17 2020

Keywords

Comments

Consider the following one-dimensional bin packing problem: given n items whose sizes are the first n primes, list the numbers m such that all the items can be packed into m bins of identical capacity, with each bin packed completely full. The resulting list is row n.
If a row contains a number m, it necessarily contains all divisors of m.

Examples

			In bin-packing terms, for n=19, the sum of the 19 item sizes, i.e., the sum of the first n primes, is 2 + 3 + ... + 67 = 568, whose divisors begin 1, 2, 4, 8, ...; the bin capacity must be at least 67 (the size of the largest item), and 568/67 < 9, so the number of bins m cannot exceed 8. However, the 19 items cannot be packed into 8 bins: the bin capacity would be 568/8 = 71 (which, as an odd sum, would require that each bin containing only odd-sized items -- i.e., every bin other than the one containing the item of size 2 -- contain an odd number of items, hence at least 3 items, but there are only 19 items in total). So the remaining values of m are 1 (i.e., packing all 19 items in a single bin), 2 (e.g., 568/2 = 284 = 67 + 61 + 59 + 53 + 41 + 3 = 47 + 43 + 37 + 31 + 29 + 23 + 19 + 17 + 13 + 11 + 7 + 5 + 2), and 4 (e.g., 568/4 = 142 = 67 + 61 + 11 + 3 = 59 + 53 + 23 + 7 = 47 + 43 + 37 + 13 + 2 = 41 + 31 + 29 + 19 + 17 + 5), so row 19 consists of the numbers 1, 2, and 4.
.                                       Numbers m such that
             Sum of  Divisors m of sum  1st n primes can be
      n-th   1st n       such that      partitioned into m
   n  prime  primes  m <= sum/prime(n)  subsets w/same sum
  --  -----  ------  -----------------  -------------------
   1     2       2   1                  1;
   2     3       5   1                  1;
   3     5      10   1, 2               1, 2;
   4     7      17   1                  1;
   5    11      28   1, 2               1, 2;
   6    13      41   1                  1;
   7    17      58   1, 2               1, 2;
   8    19      77   1                  1;
   9    23     100   1, 2, 4            1, 2;
  10    29     129   1, 3               1, 3;
  11    31     160   1, 2, 4, 5         1, 2, 4;
  12    37     197   1                  1;
  13    41     238   1, 2               1, 2;
  14    43     281   1                  1;
  15    47     328   1, 2, 4            1, 2, 4;
  16    53     381   1, 3               1, 3;
  17    59     440   1, 2, 4, 5         1, 2, 4, 5;
  18    61     501   1, 3               1, 3;
  19    67     568   1, 2, 4, 8         1, 2, 4;
  20    71     639   1, 3, 9            1, 3;
  21    73     712   1, 2, 4, 8         1, 2, 4;
  22    79     791   1, 7               1, 7;
  23    83     874   1, 2               1, 2;
  24    89     963   1, 3, 9            1, 3;
  25    97    1060   1, 2, 4, 5, 10     1, 2, 4, 5;
  26   101    1161   1, 3, 9            1, 3;
  27   103    1264   1, 2, 4, 8         1, 2, 4;
  28   107    1371   1, 3               1, 3;
  29   109    1480   1, 2, 4, 5, 8, 10  1, 2, 4, 5, 8;
  30   113    1593   1, 3, 9            1, 3, 9;
  31   127    1720   1, 2, 4, 5, 8, 10  1, 2, 4, 5, 8;
  32   131    1851   1, 3               1, 3;
  33   137    1988   1, 2, 4, 7, 14     1, 2, 4, 7;
  34   139    2127   1, 3               1, 3;
  35   149    2276   1, 2, 4            1, 2, 4;
  36   151    2427   1, 3               1, 3;
  37   157    2584   1, 2, 4, 8         1, 2, 4, 8;
		

Crossrefs

Showing 1-4 of 4 results.