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

A194939 Table T read by rows, where T(n, k) is the sum of the largest k primes up to and including prime(n), for 1 <= k <= n.

Original entry on oeis.org

2, 3, 5, 5, 8, 10, 7, 12, 15, 17, 11, 18, 23, 26, 28, 13, 24, 31, 36, 39, 41, 17, 30, 41, 48, 53, 56, 58, 19, 36, 49, 60, 67, 72, 75, 77, 23, 42, 59, 72, 83, 90, 95, 98, 100, 29, 52, 71, 88, 101, 112, 119, 124, 127, 129, 31, 60, 83, 102, 119, 132, 143, 150, 155, 158, 160
Offset: 1

Views

Author

Alonso del Arte, Sep 07 2011

Keywords

Comments

From the left, the second column gives the sums of two consecutive primes, the third column gives the sums of three consecutive primes, etc. Thus, from the right, the rightmost column gives the running sum of all prime numbers up to that row.
This triangle is the mirror image of A143121: left border are the primes (right border in the other one) while the right border is the sum of the first n primes (A007504, left border in the other one). Row sums are given by A014285, just like the other triangle.
On odd numbered rows, the central entry is exactly the same as the corresponding position in A143121: T(n, (n + 1)/2) = A143121(n, (n + 1)/2). The rest of the row is of course the reverse.

Examples

			First few rows of triangle are:
2
3,   5
5,   8, 10
7,  12, 15, 17
11, 18, 23, 26, 28
...
T(5, 2) = 18 because the sum of the fourth and fifth primes (two consecutive primes) is 7 + 11 = 18.
T(5, 3) = 23 because the sum of the third, fourth and fifth primes (three consecutive primes) is 5 + 7 + 11 = 23.
		

Crossrefs

Cf. A143121 (rows reversed), A014285 (row sums).
Cf. A000040 (column k=1), A007504 (main diagonal).
Cf. A067377.

Programs

  • Mathematica
    a[n_, k_] := a[n, k] = Plus@@Prime[Range[n - k + 1, n]]; Column[Table[a[n, k], {n, 15}, {k, n}], Center]

Formula

T(n, k) = Sum_{i = n-k+1..n} prime(i), where prime(i) is the i-th prime number.

Extensions

More terms from Michel Marcus, Aug 31 2020
New name from David A. Corneth, Aug 31 2020

A339269 a(n) is the least number that is the product of n primes (not necessarily distinct) and is the sum of n consecutive primes, or 0 if there are none.

Original entry on oeis.org

2, 0, 425, 36, 243, 756, 29889, 4704, 207765, 8448, 4465125, 108864, 13640319, 1022976, 146146275, 3010560, 6500054871, 4259840, 60767621145, 36864000, 454444233597, 167215104, 8664659236485, 796262400, 49362406764957, 7935623168, 2310430513712625, 4160749568, 4216955409197811, 28538044416
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Nov 29 2020

Keywords

Comments

Conjecture: a(n) > 0 for every n > 2.
If n > 2 is odd, the sum of n consecutive odd primes is odd, so (if nonzero) a(n) >= 3^n.

Examples

			a(3)=425 because 425 = 5^2*7 is the product of three primes and 425 = 137+139+149 is the sum of three consecutive primes, and no smaller number has this property.
		

Crossrefs

Programs

  • Maple
    sumofconsecprimes:= proc(x, n)
      local P, k, p, q, t;
      P:= nextprime(floor(x/n));
      p:= P; q:= P;
      for k from 1 to n-1 do
        if k::even or q = 2 then p:= nextprime(p); P:= P, p;
        else q:= prevprime(q); P:= q, P;
        fi
      od;
      P:= [P];
      t:= convert(P, `+`);
      if t = x then return P fi;
      if t > x then
        while t > x do
          if q = 2 then return false fi;
          q:= prevprime(q);
          t:= t + q - p;
          P:= [q, op(P[1..-2])];
          p:= P[-1];
          if t = x then return P fi;
        od
      else
        while t < x do
          p:= nextprime(p);
          t:= t + p - q;
          P:= [op(P[2..-1]), p];
          q:= P[1];
          if t = x then return P fi;
        od
      fi;
      false
    end proc:
    children:= proc(r) local L, x, p, q, t, R;
      x:= r[1];
      L:= r[2];
      t:= L[-1];
      p:= t[1]; q:= nextprime(p);
      if t[2]=1 then t:= [q, 1];
      else t:= [p, t[2]-1], [q, 1]
      fi;
      R:= [x*q/p, [op(L[1..-2]), t]];
      if nops(L) >= 2 then
        p:= L[-2][1];
        q:= L[-1][1];
        if L[-2][2]=1 then t:= [q, L[-1][2]+1]
        else t:= [p, L[-2][2]-1], [q, L[-1][2]+1]
        fi;
        R:= R, [x*q/p, [op(L[1..-3]), t]]
      fi;
      [R]
    end proc:
    f:= proc(n) local Q, t, x, v;
          uses priqueue;
          initialize(Q);
          if n::even then insert([-2^n, [[2, n]]], Q)
          else insert([-3^n, [[3, n]]], Q)
          fi;
          do
            t:= extract(Q);
            x:= -t[1];
            v:= sumofconsecprimes(x, n);
            if v <> false then return x fi;
            for t in children(t) do insert(t, Q) od;
          od
       end proc:
    f(1):= 2:
    f(2):= 0:
    map(f, [$1..34]);

Formula

a(n) = A143121(A339185(n)+n, A339185(n)).

A339185 a(n) is the least prime p such that the sum of n consecutive primes starting with p has exactly n prime factors, counted with multiplicity, or 0 if no such p exists.

Original entry on oeis.org

2, 0, 137, 5, 41, 109, 4253, 569, 23057, 821, 405863, 9013, 1049173, 73009, 9742969, 188017, 382355863, 236527, 3198295691, 1843111, 21640201361, 7600499, 376724314301, 33177461, 1974496270177, 305216017, 85571500507397, 148597987, 145412255489161, 951267841, 2609815945304401, 1140850357, 24575914221842531
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Nov 26 2020

Keywords

Comments

Conjecture: Such p exists for every n > 2.

Examples

			a(3)=137 because the sum of 3 consecutive primes starting with 137 is 137+139+149=425=5^2*7 is the product of 3 primes counting multiplicity, and 137 is the least prime with this property.
		

Crossrefs

Programs

  • Maple
    sumofconsecprimes:= proc(x,n)
      local P,k,p,q,t;
      P:= nextprime(floor(x/n));
      p:= P; q:= P;
      for k from 1 to n-1 do
        if k::even or q = 2 then p:= nextprime(p); P:= P,p;
        else q:= prevprime(q); P:= q,P;
        fi
      od;
      P:= [P];
      t:= convert(P,`+`);
      if t = x then return P fi;
      if t > x then
        while t > x do
          if q = 2 then return false fi;
          q:= prevprime(q);
          t:= t + q - p;
          P:= [q, op(P[1..-2])];
          p:= P[-1];
          if t = x then return P fi;
        od
      else
        while t < x do
          p:= nextprime(p);
          t:= t + p - q;
          P:= [op(P[2..-1]),p];
          q:= P[1];
          if t = x then return P fi;
        od
      fi;
      false
    end proc:
    children:= proc(r) local L,x,p,q,t,R;
      x:= r[1];
      L:= r[2];
      t:= L[-1];
      p:= t[1]; q:= nextprime(p);
      if t[2]=1 then t:= [q,1];
      else t:= [p,t[2]-1],[q,1]
      fi;
      R:= [x*q/p,[op(L[1..-2]),t]];
      if nops(L) >= 2 then
        p:= L[-2][1];
        q:= L[-1][1];
        if L[-2][2]=1 then t:= [q,L[-1][2]+1]
        else t:= [p,L[-2][2]-1],[q,L[-1][2]+1]
        fi;
        R:= R, [x*q/p, [op(L[1..-3]),t]]
      fi;
      [R]
    end proc:
    f:= proc(n) local Q,t,x,v;
          uses priqueue;
          initialize(Q);
          if n::even then insert([-2^n,[[2,n]]],Q)
          else insert([-3^n,[[3,n]]],Q)
          fi;
          do
            t:= extract(Q);
            x:= -t[1];
            v:= sumofconsecprimes(x,n);
            if v <> false then return v[1] fi;
            for t in children(t) do insert(t,Q) od;
          od
       end proc:
    f(1):= 2:
    f(2):= 0:
    map(f, [$1..34]);

Formula

A339269(n) = A143121(a(n)+n, a(n)).
Showing 1-3 of 3 results.