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

A059456 Unsafe primes: primes not in A005385.

Original entry on oeis.org

2, 3, 13, 17, 19, 29, 31, 37, 41, 43, 53, 61, 67, 71, 73, 79, 89, 97, 101, 103, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 173, 181, 191, 193, 197, 199, 211, 223, 229, 233, 239, 241, 251, 257, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337
Offset: 1

Views

Author

Labos Elemer, Feb 02 2001

Keywords

Comments

A010051(a(n))*(1-A156659(a(n))) = 1; subsequence of A156657. - Reinhard Zumkeller, Feb 18 2009
Also, primes p such that p-1 is a non-semiprime. - Juri-Stepan Gerasimov, Apr 28 2010
Conjecture: From the sequence of prime numbers, let 2 and remove the first data iteration of 2*p+1; leave 3 and remove the prime data by the iteration 2*p+1 and we get the sequence. Example for p=2, remove(5,11,23,47); p=3, remove(7); p=13, p=17, p=19, p=23, remove(47); and so on. - Vincenzo Librandi, Aug 07 2010

Examples

			31 is here because (31-1)/2=15 is not prime. 2 and 3 are here because 1/2 and 1 are not prime numbers.
		

Crossrefs

Initial terms for groups in A075712.

Programs

  • Mathematica
    Complement[Prime@ Range@ PrimePi@ Max@ #, #] &@ Select[Prime@ Range@ 90, PrimeQ[(# - 1)/2] &] (* Michael De Vlieger, May 01 2016 *)
    Select[Prime[Range[100]],PrimeOmega[#-1]!=2&] (* Harvey P. Dale, May 13 2018 *)
  • PARI
    is(n)=isprime(n) && !isprime(n\2) \\ Charles R Greathouse IV, May 02 2016

Formula

a(n) ~ n log n. - Charles R Greathouse IV, Dec 29 2024

A181697 Length of the complete Cunningham chain of the first kind starting with prime(n).

Original entry on oeis.org

5, 2, 4, 1, 3, 1, 1, 1, 2, 2, 1, 1, 3, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 6, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 5, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 2, 1, 1
Offset: 1

Views

Author

M. F. Hasler, Nov 17 2010

Keywords

Comments

Number of iterations x->2x+1 needed to get a composite number, when starting with prime(n).
prime(n) is in A005384, i.e., a Sophie Germain prime, iff a(n)>1.
a(n) is the least k such that 2^k * (prime(n)+1) - 1 is composite. Note that a(n) is well defined since 2^(p-1) * (p+1) - 1 is divisible by p for odd primes p. - Jianing Song, Nov 24 2021

Examples

			2 -> 5 -> 11 -> 23 -> 47 -> 95 = 5*19, so a(1) = 5, a(3) = 4, a(5) = 3, a(9) = 2, and a(15) = 1. - _Jonathan Sondow_, Oct 30 2015
		

Crossrefs

Programs

  • Mathematica
    Table[p = Prime[n]; cnt = 1; While[p = 2*p + 1; PrimeQ[p], cnt++]; cnt, {n, 100}] (* T. D. Noe, Jul 12 2012 *)
  • PARI
    a(n)= n=prime(n); for(c=1,1e9, is/*pseudo*/prime(n=2*n+1) || return(c))

Formula

a(n) < prime(n) for n > 1; see Löh (1989), p. 751. - Jonathan Sondow, Oct 28 2015
max(a(n), A181715(n)) = A263879(n) for n > 2. - Jonathan Sondow, Oct 30 2015

Extensions

Definition clarified by Jonathan Sondow, Oct 28 2015

A338945 Lengths of Cunningham chains of the first kind that are sorted by first prime in the chain.

Original entry on oeis.org

5, 2, 1, 1, 1, 2, 1, 1, 3, 1, 2, 1, 1, 1, 1, 1, 6, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 2, 2, 1, 2, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 1, 2, 1
Offset: 1

Views

Author

Michael De Vlieger, Nov 17 2020

Keywords

Comments

Row lengths of A075712.

Examples

			We begin with the smallest prime 2. Since 2(5) + 1 = 11 is prime, further, 2(11) + 1 = 23, 2(23) + 1 = 47 are prime but 2(47) + 1 = 95 is not, we have the complete chain {2, 5, 11, 23, 47} of length 5, thus a(1) = 5.
We resume with 3, since 3 has not appeared in any chain generated thus far. Since 2(3) + 1 = 7, but 2(7) + 1 = 15, we have the complete chain {3, 7}, therefore a(2) = 2.
Starting from 13, we find 2(13) + 1 = 27, thus we have a singleton chain and have a(3) = 1, etc.
		

Crossrefs

Programs

  • Mathematica
    Block[{a = {2}, b = {}, j = 0, k, p}, Do[k = Length@ b + 1; If[PrimeQ@ a[[-1]], AppendTo[a, 2 a[[-1]] + 1]; j++, While[! FreeQ[a, Set[p, Prime[k]]], k++]; AppendTo[b, j]; Set[j, 0]; Set[a, Append[a[[1 ;; -2]], p]]], {10^3}]; b]

A338944 Rearrangement of primes into complete Cunningham chains of the second kind, sorted by first prime in the chain.

Original entry on oeis.org

2, 3, 5, 7, 13, 11, 17, 19, 37, 73, 23, 29, 31, 61, 41, 43, 47, 53, 59, 67, 71, 79, 157, 313, 83, 89, 97, 193, 101, 103, 107, 109, 113, 127, 131, 137, 139, 277, 149, 151, 163, 167, 173, 179, 181, 191, 197, 199, 397, 211, 421, 223, 227, 229, 457, 233, 239, 241
Offset: 1

Views

Author

Michael De Vlieger, Nov 17 2020

Keywords

Comments

Analogous to A075712 but pertaining instead to primes of the form found in A005382.

Examples

			Triangle begins:
2, 3, 5;
7, 13;
11;
17;
19, 37, 73;
23;
29;
31, 61;
41;
...
		

Crossrefs

Programs

  • Mathematica
    Block[{a = {2}, j = 1, k, p}, Do[k = j; If[PrimeQ@ a[[-1]], AppendTo[a, 2 a[[-1]] - 1], While[! FreeQ[a, Set[p, Prime[k]]], k++]; j++; Set[a, Append[a[[1 ;; -2]], p]]], 10^3]; a]

A338946 Lengths of Cunningham chains of the second kind that are sorted by first prime in the chain.

Original entry on oeis.org

3, 2, 1, 1, 3, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 3, 2, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 2, 2, 1, 3, 1, 1, 1, 1, 1, 1
Offset: 1

Views

Author

Michael De Vlieger, Nov 17 2020

Keywords

Comments

Row lengths of A338944.

Examples

			We start with p = 2. Since 2(2) - 1 = 3 is prime, and further 2(3) - 1 = 5 is prime, but 2(5) - 1 is composite, we have chain length 3, so a(1) = 3.
p = 7 is the smallest prime that hasn't appeared in a chain thus far; since 2(7) - 1 = 13 is prime but 2(13) - 1 = 25 is composite, we have a chain of length 2, so a(2) = 2.
p = 11 is the smallest prime that hasn't appeared in a chain; 2(11) - 1 = 21 is composite, so we have a singleton chain, thus a(3) = 1, etc.
		

Crossrefs

Programs

  • Mathematica
    Block[{a = {2}, b = {}, j = 0, k, p}, Do[k = Length@ b + 1; If[PrimeQ@ a[[-1]], AppendTo[a, 2 a[[-1]] - 1]; j++, While[! FreeQ[a, Set[p, Prime[k]]], k++]; AppendTo[b, j]; Set[j, 0]; Set[a, Append[a[[1 ;; -2]], p]]], {10^3}]; b]

A348855 a(1) = 1. If a(n) is prime, a(n+1) = 2*a(n) + 1. If a(n) is not prime, a(n+1) = least prime not already in the sequence.

Original entry on oeis.org

1, 2, 5, 11, 23, 47, 95, 3, 7, 15, 13, 27, 17, 35, 19, 39, 29, 59, 119, 31, 63, 37, 75, 41, 83, 167, 335, 43, 87, 53, 107, 215, 61, 123, 67, 135, 71, 143, 73, 147, 79, 159, 89, 179, 359, 719, 1439, 2879, 5759, 97, 195, 101, 203, 103, 207, 109, 219, 113, 227, 455
Offset: 1

Views

Author

David James Sycamore, Nov 01 2021

Keywords

Comments

The sequence exhibits consecutive terms of "nearly doubled primes", namely Cunningham Chains (of the first kind), the first of which is 2,5,11,23,47. Each prime in such a chain, except for the last is a term in A005384, and each prime except the first is a term in A005385. Every chain is terminated by composite number m = 2*q + 1, where q is the last prime in the chain. At this point the sequence resets to the smallest prime which has not yet been seen, from which the next chain is propagated, and so on. Since by definition every prime appears, so does every possible Cunningham chain. A similar (companion) sequence can be defined using a(n+1) = 2*a(n) - 1 for a(n) a prime term.

Examples

			a(1) = 1 is not prime, so a(2) = 2, the smallest prime not seen so far. Then a(3) = 2*2 + 1 = 5, a(4) = 2*5 + 1 = 11, and so on, generating the chain 2,5,11,23,47.
47 is not a term in A005384 since 2*47 + 1 = 95 is not prime, after which the sequence resets to 3, the least unused prime so far, from which the next chain 3,7,15 arises, and so on.
As an irregular table (each row after the first beginning with a prime and ending with a nonprime), the sequence begins:
1;
2, 5, 11, 23, 47, 95;
3, 7, 15;
13, 27;
17, 35;
19, 39;
29, 59, 119;
31, 63;
37, 75;
41, 83, 167, 335;
43, 87; ...
		

Crossrefs

Programs

  • Mathematica
    a[1]=1;a[n_]:=a[n]=If[PrimeQ@a[n-1],2a[n-1]+1,k=2;While[MemberQ[Array[a,n-1],k],k=NextPrime@k];k];Array[a,60] (* Giorgos Kalogeropoulos, Nov 02 2021 *)
  • Python
    from sympy import isprime, nextprime
    def aupton(terms):
        alst, aset = [1], {1}
        while len(alst) < terms:
            if isprime(alst[-1]):
                an = 2*alst[-1] + 1
            else:
                p = 2
                while p in aset: p = nextprime(p)
                an = p
            alst.append(an); aset.add(an)
        return alst
    print(aupton(60)) # Michael S. Branicky, Nov 02 2021
Showing 1-6 of 6 results.