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

A353889 Lexicographically earliest sequence of distinct positive integers with no finite subset summing to a power of 2.

Original entry on oeis.org

3, 6, 9, 11, 19, 24, 43, 69, 77, 123, 192, 261, 507, 699, 1029, 1536, 2043, 4101, 5637, 8187, 12288, 16389, 32763, 45051, 65541, 98304, 131067, 262149, 360453, 524283, 786432, 1048581, 2097147, 2883579, 4194309, 6291456, 8388603, 16777221, 23068677, 33554427
Offset: 1

Views

Author

Rémy Sigrist, May 09 2022

Keywords

Comments

The sequence is well defined:
- a(1) = 3,
- for n > 0, let k be such that 2^k + 1 + a(1) + ... + a(n) < 2^(k+1),
- then a(n+1) <= 2^k + 1.
The variant where we avoid powers of 3 corresponds to the positive even numbers (A299174).

Examples

			- 1 = 2^0, so 1 is not a term,
- 2 = 2^1, so 2 is not a term,
- a(1) = 3 (as 3 is not a power of 2),
- 4 = 2^2, so 4 is not a term,
- 3 + 5 = 2^3, so 5 is not a term,
- a(2) = 6 (as neither 6 nor 3 + 6 is a power of 2),
- 3 + 6 + 7 = 2^4, so 7 is not a term,
- 8 = 2^3, so 8 is not a term,
- a(3) = 9 (as none of 9, 3 + 9, 6 + 9, 3 + 6 + 9 is a power of 2).
		

Crossrefs

Cf. similar sequences: A052349 (prime numbers), A133662 (square numbers), A353966 (Fibonacci numbers), A353969 (factorial numbers), A353980 (primorial numbers), A353983 (Catalan numbers), A354005 (Pell numbers).

Programs

  • Python
    from math import gcd
    from itertools import count, islice
    def agen(): # generator of terms
        a, ss, pows2, m = [], set(), {1, 2}, 2
        for k in count(1):
            if k in pows2: continue
            elif k > m: m <<= 1; pows2.add(m)
            if any(p2-k in ss for p2 in pows2): continue
            a.append(k); yield k
            ss |= {k} | {k+si for si in ss if k+si not in ss}
            while m < max(ss): m <<= 1; pows2.add(m)
    print(list(islice(agen(), 32))) # Michael S. Branicky, Jun 09 2023

A133660 No sum of 2 or more terms equals a prime.

Original entry on oeis.org

1, 3, 5, 87, 113, 1151, 5371, 199276, 32281747, 16946784207
Offset: 1

Views

Author

Randy L. Ekl, Dec 28 2007

Keywords

Comments

Sequence is infinite since the primes have density 0. - Charles R Greathouse IV, Apr 28 2011

Examples

			5 is a term of the series, as 5+1, 5+3 and 5+3+1 are all nonprime. The next term, 87, is the next number k such that k+1, k+3, k+1+3, k+5, k+1+5, k+3+5 and k+1+3+5 are all nonprime.
		

Crossrefs

Programs

  • Mathematica
    (* first do *) Needs["Combinatorica`"] (* then *) lst = {}; g[k_] := Block[{j = 1, l = 2^Length@lst}, While[j < l && !PrimeQ[Plus @@ NthSubset[j, lst] + k], j++ ]; If[j == l, False, True]]; f[n_] := Block[{k = lst[[ -1]] + 1}, While[g[k] == True, k++ ]; AppendTo[lst, k]; k]; Do[Print@f@n, {n, 10}]; (* Robert G. Wilson v, Dec 31 2007 *)
    (* Second program, avoids "Combinatorica`": *)
    Nest[Append[#, Block[{k = Last@ # + 1}, While[AnyTrue[Total /@ Select[Subsets[Append[#, k]], Length@ # > 1 &], PrimeQ],k++ ]; k ] ] &, {1}, 6] (* Michael De Vlieger, Jun 11 2018 *)

Extensions

a(9) from Robert G. Wilson v, Dec 31 2007
a(10) from Donovan Johnson, Feb 15 2008

A153136 Smallest sequence of primes such that no sum of at least two terms is prime.

Original entry on oeis.org

2, 7, 13, 43, 103, 1627, 25349, 315743, 7338823, 42939980423
Offset: 1

Views

Author

Benoit Jubin, Dec 19 2008

Keywords

Crossrefs

Programs

  • PARI
    a=[];for(n=1,10, forprime(p=2,,setsearch(a,p)&&next;for(i=1,2^#a-1,isprime(normlp(vecextract(a,i),1)+p)&&next(2));a=concat(a,p);print1(p","))) \\ Very simplistic, should at least avoid an odd number of odd primes in the partial sum of earlier terms. \\ M. F. Hasler, Jan 29 2015

Extensions

a(8)-a(10) from Donovan Johnson, Dec 23 2008

A128687 Smallest odd nonprime such that every subset of a(1), ..., a(n) adds to a nonprime.

Original entry on oeis.org

1, 9, 15, 39, 105, 731, 2805, 59535, 2658795, 78060135, 67554224745
Offset: 1

Views

Author

T. D. Noe, Mar 20 2007

Keywords

Comments

The first 8 terms are from Rivera's puzzle 84.
The sequences is infinite [Chris Nash]. - N. J. A. Sloane, Jan 20 2017

Crossrefs

Cf. A052349 (no restrictions on even or odd), A128688 (restricted to even numbers).

Programs

  • Mathematica
    a[1]=1; a[n_]:=a[n]=(s=Subsets[Array[a,n-1],n-1]; c=a[n-1]; While[d=1;While[!PrimeQ[Total[s[[d]]]+c]&&dGiorgos Kalogeropoulos, Nov 19 2021 *)

Extensions

a(11) from Donovan Johnson, Apr 18 2010

A128688 a(1)=1. For n>1, a(n) is the smallest even number such that every subset of a(1), ..., a(n) adds to a nonprime.

Original entry on oeis.org

1, 8, 24, 86, 90, 780, 5940, 52350, 278460, 40768260, 6847205430, 5027286840810
Offset: 1

Views

Author

T. D. Noe, Mar 20 2007

Keywords

Comments

The first 7 terms are from Rivera's puzzle 84.
The sequences is infinite [Chris Nash]. - N. J. A. Sloane, Jan 20 2017

Crossrefs

Cf. A052349 (no restrictions on even or odd), A128687 (restricted to odd numbers).

Programs

  • Mathematica
    a[1] = 1; a[n_] := a[n] = (s = Subsets[Array[a, n-1], n-1]; c = a[n-1] + 1; While[d = 1; While[!PrimeQ[Total[s[[d]]] + c] && d < Length@s, d++]; d != Length@s || PrimeQ[Total[s[[d]]] + c] || OddQ@c, c++]; c); Array[a, 8] (* Giorgos Kalogeropoulos, Nov 19 2021 *)

Extensions

a(11) from Donovan Johnson, Apr 18 2010
a(12) from Donovan Johnson, Jul 06 2010

A133661 No sum of 2 or more terms equals a prime, terms alternate parity and there are no primes in the list.

Original entry on oeis.org

1, 8, 25, 86, 209, 472, 25719, 238350, 41931245, 14426603100
Offset: 1

Views

Author

Randy L. Ekl, Dec 28 2007

Keywords

Comments

a(10) > 263811880. - Robert G. Wilson v, Jan 01 2008

Examples

			25 is a term, because 25 is odd (previous term was even), 25 is composite and 25+1, 25+8 and 25+8+1 are all composite.
		

Crossrefs

Programs

  • Mathematica
    (* first do *) Needs["Combinatorica`"] (* then *) lst = {1, 8}; g[k_] := Block[{j = 1, l = 2^Length@lst}, While[j < l && !PrimeQ[Plus @@ NthSubset[j, lst] + k], j++ ]; If[j == l, False, True]]; f[n_] := Block[{k = lst[[ -1]] + 1}, While[PrimeQ@k || g[k] == True, k++; k++ ]; AppendTo[lst, k]; k]; Do[ Print@ f@ n, {n, 10}] (* Robert G. Wilson v, Jan 01 2008 *)

Extensions

a(9) from Robert G. Wilson v, Jan 01 2008
a(10) from Donovan Johnson, Feb 15 2008

A069549 Smallest composite k such that phi(k) > k*(1-1/n).

Original entry on oeis.org

4, 4, 9, 25, 25, 49, 49, 121, 121, 121, 121, 169, 169, 289, 289, 289, 289, 361, 361, 529, 529, 529, 529, 841, 841, 841, 841, 841, 841, 961, 961, 1369, 1369, 1369, 1369, 1369, 1369, 1681, 1681, 1681, 1681, 1849, 1849, 2209, 2209, 2209, 2209, 2809, 2809, 2809
Offset: 1

Views

Author

Benoit Cloitre, Apr 21 2002

Keywords

Comments

Or, least composite k such that k is coprime to the n-1 numbers k+1 ... k+n-1. E.g., a(4) = 25 because 25 is coprime to 26, 27 and 28. - Amarnath Murthy, Apr 20 2004

Crossrefs

Cf. A000010 (phi), A007918, A052349.

Programs

  • Mathematica
    a[n_] := NextPrime[n-1]^2; Array[a, 50] (* Amiram Eldar, May 08 2025 *)
  • PARI
    a(n) = nextprime(n)^2; \\ Amiram Eldar, May 08 2025

Formula

a(n) = nextprime(n)^2 = A007918(n)^2.

Extensions

Edited by David Wasserman, Apr 23 2007

A153137 Smallest sequence of noncomposite numbers such that no sum of at least two terms is prime.

Original entry on oeis.org

1, 3, 5, 113, 181, 661, 10891, 927149, 88070399, 15288362671
Offset: 1

Views

Author

Benoit Jubin, Dec 19 2008

Keywords

Crossrefs

Programs

  • PARI
    print1(1); a=[1]; for(n=1, 10, forprime(p=vecmin(a)+1, , setsearch(a, p)&&next; for(i=1, 2^#a-1, isprime(normlp(vecextract(a, i), 1)+p)&&next(2)); a=concat(a, p); print1(","p))) \\ Very simplistic, should at least avoid an odd number of terms in the partial sum of earlier terms. \\ M. F. Hasler, Jan 29 2015

Extensions

a(8)-a(10) from Donovan Johnson, Dec 23 2008

A153138 Smallest sequence of odd primes such that no sum of at least two terms is prime.

Original entry on oeis.org

3, 5, 7, 83, 317, 383, 29567, 423509, 118661483, 52542428123
Offset: 1

Views

Author

Benoit Jubin, Dec 19 2008

Keywords

Crossrefs

Programs

  • PARI
    a=[]; for(n=1, 10, forprime(p=if(a,a[#a]+2,3), , setsearch(a, p)&&next; for(i=1, 2^#a-1, isprime(normlp(vecextract(a, i), 1)+p)&&next(2)); a=concat(a, p); print1(p", "))) \\ Very simplistic, should at least avoid an odd number of terms in the partial sum of earlier terms. \\ M. F. Hasler, Jan 29 2015

Extensions

a(8)-a(10) from Donovan Johnson, Dec 23 2008

A280708 Lexicographically earliest sequence such that no subsequence sums to a prime.

Original entry on oeis.org

1, 8, 24, 24, 86, 1260, 1890, 14136, 197400, 10467660, 1231572090
Offset: 1

Views

Author

Peter Kagey, Jan 07 2017

Keywords

Comments

This sequence is monotonically increasing.
So far, apart from a(4) this sequence is identical to A052349.

Examples

			For n = 4, a(4) = 24 because all subsets have nonprime sums:
           1 +  8 =  9 = 3^2
           1 + 24 = 25 = 5^2
           8 + 24 = 32 = 2^5
          24 + 24 = 48 = 2^4*3
      1 +  8 + 24 = 33 = 3*11
      1 + 24 + 24 = 49 = 7^2
      8 + 24 + 24 = 56 = 2^3*7
  1 + 8 + 24 + 24 = 57 = 3*19
		

Crossrefs

Cf. A052349.

Programs

  • Maple
    S:= {0}: count:= 0:
    x:= 1:
    while x < 10^6 do
      if ormap(s -> isprime(s+x), S) then x:= x+1
      else
        count:= count+1;
        A[count]:= x;
        S:= S union map(`+`,S,x);
      fi
    od:
    seq(A[i],i=1..count); # Robert Israel, Jan 20 2017
  • Mathematica
    t = {1}; c = 1; Print[1]; While[Length[t] < 11, r = Rest[Subsets[t]]; s = Table[Total[r[[i]]], {i, Length[r]}]; While[PrimeQ[c] || Union[PrimeQ[s + c]] != {False}, c++]; Print[c]; AppendTo[t, c]] (* Hans Havermann, Jan 20 2017 *)

Extensions

a(9) and a(10) from Dmitry Kamenetsky, Jan 12 2017
a(11) from Hans Havermann, Jan 20 2017
Showing 1-10 of 14 results. Next