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.

Previous Showing 11-12 of 12 results.

A110093 Smallest prime ending (through <*2+1> or/and <*2-1>) a complete Cunningham chain (of the first or the second kind) of length n.

Original entry on oeis.org

11, 7, 5, 4079, 47, 2879, 1065601
Offset: 1

Views

Author

Alexandre Wajnberg, Sep 04 2005

Keywords

Comments

The word "complete" indicates each chain is exactly n primes long for the operator in function (i.e. the chain cannot be a subchain of another one); but the first and/or last term may be involved in a chain of the other kind (i.e. the chain may be connected to another one).

Examples

			a(1)=11 because 2, 3, 5 and 7 are not ending chains; or are part of chains longer than one prime; 11, although is part of a five primes <2p+1> chain, is isolated through <2p-1>.
a(2)=7 because 7 ends through <2p+1> the first two primes chain: 3->7 (even if both primes are also part of <2p-1> chains).
		

Crossrefs

Extensions

Terms computed by Gilles Sadowski.

A320393 First members of the Cunningham chains of the first kind whose length is a prime.

Original entry on oeis.org

2, 3, 11, 23, 29, 41, 53, 83, 113, 131, 173, 179, 191, 233, 239, 251, 281, 293, 419, 431, 443, 491, 593, 641, 653, 659, 683, 719, 743, 761, 809, 911, 953, 1013, 1019, 1031, 1049, 1103, 1223, 1289, 1439, 1451, 1481, 1499, 1511, 1559, 1583, 1601, 1733, 1811, 1889, 1901, 1931, 1973, 2003, 2039, 2063, 2069, 2129, 2141
Offset: 1

Views

Author

Pierandrea Formusa, Dec 10 2018

Keywords

Examples

			41 is an item as it generates the Cunningham chain (41, 83, 167), of length 3, that is prime.
		

Crossrefs

Programs

  • Mathematica
    aQ[n_] := PrimeQ[Length[NestWhileList[2#+1&, n, PrimeQ]] - 1]; Select[Range[2200], aQ] (* Amiram Eldar, Dec 11 2018 *)
  • Python
    from sympy.ntheory import isprime
    def cunningham_chain(p,t):
        #it returns the cunningham chain generated by p of type t (1 or 2)
        if not(isprime(p)):
            raise Exception("Invalid starting number! It must be prime")
        if t!=1 and t!=2:
            raise Exception("Invalid type! It must be 1 or 2")
        elif t==1: k=t
        else: k=-1
        cunn_ch=[]
        cunn_ch.append(p)
        while isprime(2*p+k):
            p=2*p+k
            cunn_ch.append(p)
        return(cunn_ch)
    from sympy import prime
    n=350
    r=""
    for i in range(1,n):
        cunn_ch=(cunningham_chain(prime(i),1))
        lcunn_ch=len(cunn_ch)
        if isprime(lcunn_ch):
           r += ","+str(prime(i))
    print(r[1:])
Previous Showing 11-12 of 12 results.