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

A237638 a(n) is the number of prime sets such that each set contains enough prime numbers to decompose every even number from 6 to 2n into the sum of two of its elements (reuse allowed), while none of the sets is a subset of another such set.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 2, 3, 4, 4, 5, 6, 6, 9, 11, 11, 11, 13, 16, 23, 25, 31, 47, 57, 63, 70, 74, 79, 82, 122, 131, 129, 180, 215, 219, 323, 367, 446, 501, 531, 661, 867, 897, 1311, 1471, 1691, 1695, 2130, 2288, 2833, 3363, 3891, 5435, 8068, 8867, 13476, 15451, 15897
Offset: 3

Views

Author

Lei Zhou, May 02 2014

Keywords

Examples

			n=4, 2n=8. There is only one set of primes {3,5} such that 6=3+3, 8=3+5. So a(4)=1.
...
n=8, 2n=16. We can find two sets, {3,5,7,11} and {3,5,7,13} that have such features. So a(8)=2. Here any set with more primes either contains an unused prime number or one of these two sets is a subset of them, like {3,5,7,11,13}, and thus is not considered. So a(8)=2.
...
n=13, 2n=26. Five such sets are found: {3,5,7,11,13}, {3,5,7,13,17},{3,5,7,13,19}, {3,5,7,11,17,19}, {3,5,7,11,17,23}. So a(13)=5.
		

Crossrefs

Programs

  • Mathematica
    a = {{{3}}}; Table[n2 = 2*n; na = {}; la = Last[a]; lo = Length[la]; Do[ok = 0; Do[p1 = la[[i, j]]; p2 = n2 - p1; If[MemberQ[la[[i]], p2], ok = 1], {j, 1, Length[la[[i]]]}];
      If[ok == 1, na = Sort[Append[na, la[[i]]]], Do[p1 = la[[i, j]]; p2 = n2 - p1; If[PrimeQ[p2], ng = Sort[Append[la[[i]], p2]]; big = 0; If[Length[na] > 0, Do[If[Intersection[na[[k]], ng] == na[[k]], big = 1], {k, 1, Length[na]}]]; If[big == 0, na = Sort[Append[na, ng]]]], {j, 1, Length[la[[i]]]}]], {i, 1, lo}]; AppendTo[a, na]; Length[na], {n, 4, 60}](* Program lists the 4th item and beyond *)

A242189 a(n) is the smallest prime number such that every even number from 6 to 2n can be written as the sum of two primes less than or equal to a(n).

Original entry on oeis.org

3, 5, 5, 7, 7, 11, 11, 13, 13, 13, 13, 17, 17, 19, 19, 19, 19, 23, 23, 31, 31, 31, 31, 31, 31, 37, 37, 37, 37, 41, 41, 41, 41, 41, 41, 47, 47, 47, 47, 47, 47, 47, 47, 61, 61, 61, 61, 61, 61, 61, 61, 61, 67, 67, 67, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 83
Offset: 3

Views

Author

Lei Zhou, May 06 2014

Keywords

Comments

The two primes stated in the name can be equal.

Examples

			n=3, 2*3=6=3+3. Since 3 is the smallest prime needed, a(3)=3.
n=4, 2*3=6=3+3, 2*4=8=5+3, Since 5 is the smallest prime needed, a(4)=5.
...
n=14, we need to consider the even numbers from 6 to 2*14=28, while trying to minimize the larger prime number used to decompose such even numbers. 6=3+3; 8=5+3; 10=5+5; 12=7+5; 14=7+7; 16=11+5; 18=11+7; 20=13+7; 22=11+11; 24=13+11; 26=13+13; 28=17+11. The maximum prime number used is 17. So a(14)=17.
		

Crossrefs

Programs

  • Maple
    f:= proc(m) local p,p0;
       p0:= m/2; if p0::even then p0:= p0+1 fi;
       for p from p0 by 2 do if isprime(p) and isprime(m-p) then return p fi od
    end proc:
    R:= 3: m:= 3:
    for i from 8 to 200 by 2 do
      v:= f(i);
      if v > m then R:= R,v; m:= v
      else R:= R,m
      fi
    od:
    R; # Robert Israel, Oct 10 2024
  • Mathematica
    a = {2}; Table[found = 0; While[la = Length[a]; xx = 1; Do[yy = 0; Do[If[MemberQ[a, i*2 - a[[j]]], yy = 1], {j, 1, la}]; If[yy == 0, xx = 0], {i, 3, n}]; If[xx == 1, found = 1]; found == 0, AppendTo[a, NextPrime[Last[a]]]]; Last[a], {n, 3, 68}]

Formula

a(n) = max_{3 <= i <= n} A234345(i). - Robert Israel, Oct 10 2024

Extensions

Name corrected by Robert Israel, Oct 10 2024
Showing 1-2 of 2 results.