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

A052349 Lexicographically earliest sequence of distinct positive integers such that no subsequence sums to a prime.

Original entry on oeis.org

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

Views

Author

Carlos Rivera, Mar 07 2000

Keywords

Comments

This set was defined by T. W. A. Baumann in The Prime Puzzles and Problems pages. He and C. Rivera obtained the first 10 members. Chris Nash proved that this sequence is infinite.

Examples

			a(4) = 25 as 25+1, 25+8, 25+24, 25+1+8, 25+1+24, 25+8+24 and finally 25+1+8+24 all are composite numbers.
		

Crossrefs

Cf. A068638.
Cf. A128687 (restricted to odd numbers), 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 *)
  • Python
    from sympy import isprime
    from itertools import islice
    def agen(start=1): # generator of terms
        alst, k, sums = [start], 1, {0} | {start}
        while True:
            yield alst[-1]
            while any(isprime(k + s) for s in sums): k += 1
            alst.append(k)
            sums.update([k + s for s in sums])
            k += 1
    print(list(islice(agen(), 9))) # Michael S. Branicky, Dec 12 2022

Extensions

One more term from T. D. Noe, Mar 20 2007
a(12) from Donovan Johnson, Jun 26 2010
New name from Charles R Greathouse IV, Jan 13 2014
Name clarified by Peter Kagey, Jan 07 2017

A025044 a(n) not of form prime - a(k), k < n.

Original entry on oeis.org

0, 1, 8, 14, 20, 24, 25, 26, 32, 38, 44, 50, 56, 62, 68, 74, 80, 86, 90, 92, 94, 98, 104, 110, 116, 118, 120, 122, 128, 134, 140, 144, 146, 152, 158, 160, 164, 170, 176, 182, 184, 188, 194, 200, 206, 212, 218, 220, 224, 230, 234, 236, 242, 248, 254, 260, 264, 266, 272, 274
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    a1 = {0}; nmax = 275; Do[ If[Select[n + a1, PrimeQ] == {}, AppendTo[a1, n]] , {n, nmax}]; a1 (* Ray Chandler, Jan 15 2017 *)

A072545 a(0) = 1, a(n) for n > 0 is the smallest number > a(n-1) such that a(n)-a(k) is nonprime for 0 <= k < n.

Original entry on oeis.org

1, 2, 10, 11, 26, 35, 36, 50, 56, 86, 92, 101, 116, 122, 126, 134, 146, 156, 170, 176, 188, 196, 206, 218, 236, 248, 254, 260, 266, 290, 296, 302, 310, 311, 320, 326, 336, 344, 356, 362, 376, 386, 392, 396, 404, 416, 426, 446, 452, 470, 476, 482, 486, 494
Offset: 0

Views

Author

Amarnath Murthy, Aug 04 2002

Keywords

Comments

a(0) = 1, a(3) = 11, a(5) = 35, a(11) = 101 and a(33) = 311 are the only odd elements <= 10^6 and probably the only ones. If so, then for n >= 34, a(n) is the smallest even k >= a(n-1)+4 for which none of k-1, k-11, k-35, k-101 or k-311 is prime. - David W. Wilson, Dec 14 2006

Examples

			26 is the smallest number > 11 which differs from 1, 2, 10, 11 by a nonprime (25, 24, 16, 15), so 26 is the next term after 11.
		

Crossrefs

Programs

  • PARI
    print1(a=1,","); v=[1]; n=1; while(n<55,a++; k=1; while(k<=n&&!isprime(a-v[k]), k++); if(k>n,n++; v=concat(v,a); print1(a,",")))

Extensions

Edited and extended by Klaus Brockhaus, Aug 09 2002

A068640 Define f(n) = 2n+1, a(n) = largest prime of the form f(f(f(...(n))). If no such prime exists then a(n) = 0.

Original entry on oeis.org

7, 47, 7, 0, 47, 13, 0, 17, 19, 0, 47, 0, 0, 59, 31, 0, 0, 37, 0, 167, 43, 0, 47, 0, 0, 107, 0, 0, 59, 61, 0, 0, 67, 0, 71, 73, 0, 0, 79, 0, 167, 0, 0, 2879, 0, 0, 0, 97, 0, 101, 103, 0, 107, 109, 0, 227, 0, 0, 0, 0, 0, 0, 127, 0, 263, 0, 0, 137, 139, 0, 0, 0, 0, 149, 151, 0, 0, 157, 0
Offset: 1

Views

Author

Amarnath Murthy, Feb 27 2002

Keywords

Examples

			a(2) = 47 as f(2) = 5, f(5) = 11,f(11) = 23, f(23) = 47 is the largest such prime . f(47) = 95 is not a prime. a(4) = 0 as f(4) = 9 is composite.
		

Crossrefs

Cf. A068638.

Programs

  • Maple
    for k from 1 to 500 do a := 2*k+1; while(isprime(a)) do a := 2*a+1; end do; c[k] := (a-1)/2; if(not isprime(c[k])) then c[k] := 0; end if; if(c[k]<2*k+1) then c[k] := 0; end if; end do:q := seq(c[i],i=1..500);

Extensions

More terms from Sascha Kurz, Mar 17 2002

A359065 Lexicographically earliest sequence of distinct positive composite integers such that no subsequence sums to a prime and in which all terms are coprime.

Original entry on oeis.org

4, 21, 65, 209, 391, 3149, 9991, 368131, 57556589, 14865154981
Offset: 1

Views

Author

Conor Houghton, Dec 15 2022

Keywords

Comments

The sequences A052349 and A068638 are composed of integers starting from one with the rule that no subsequence has a prime sum; these sequences start with one. Starting with a different number seems to result in straightforward geometric sequences, for example the sequence with no prime subsequence sums starting with four is 4, 6, 8, and so on. One way to avoid this is to enforce a coprime rule, requiring that the entries to the sequence are coprime. It is not clear whether the sequence is infinite.

Crossrefs

Programs

  • Mathematica
    k = 4; K = {k}; f = {2}; q = Subsets[K]; While[Length@K < 10, k++; If[! PrimeQ[k] && ! IntersectingQ[FactorInteger[k][[All, 1]], f], s = k; z = 0; For[p = 1, p <= Length@q, p++, If[PrimeQ[Total[q[[p]]] + k], z = 1; Break[]]]; If[z == 0, AppendTo[K, k]; q = Subsets[K]; AppendTo[f, FactorInteger[k][[All, 1]]]; f = Flatten[f]]]]; Print[K] (* Samuel Harkness, Apr 11 2023 *)
  • Python
    import sys
    import math
    from sympy.ntheory import primefactors
    from sympy.ntheory import primerange
    def intersection(lst1, lst2):
        lst3 = [value for value in lst1 if value in lst2]
        return len(lst3)
    n_primes=1000000
    factors=[primefactors(n) for n in range(0,n_primes)]
    primes=list(primerange(0, n_primes))
    sequence=[4]
    sums=[sequence[0]]
    prime_factors=[f for f in factors[sequence[0]]]
    big_n=8
    while len(sequence)
    				
  • Python
    from math import gcd
    from sympy import isprime
    from itertools import islice
    def agen(start=4): # generator of terms
        alst, k, sums = [start], start+1, {0} | {start}
        while True:
            yield alst[-1]
            while any(gcd(k, an) != 1 for an in alst) or \
                  any(k+s not in sums and isprime(k+s) for s in sums):
                k += 1
            alst.append(k)
            sums.update([k + s for s in sums])
            k += 1
    print(list(islice(agen(), 8))) # Michael S. Branicky, Dec 16 2022

Extensions

a(8)-a(9) from Michael S. Branicky, Dec 15 2022
a(10) from Rémy Sigrist, Dec 16 2022
Showing 1-5 of 5 results.