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 61-70 of 126 results. Next

A172461 Primes p such that 2*p-1 and 2^p-1 are both primes.

Original entry on oeis.org

2, 3, 7, 19, 31, 607, 1279, 2281, 44497, 1257787, 13466917
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Feb 03 2010, Feb 06 2010

Keywords

Examples

			a(1) = 2 is a term since it is a prime and 2^2 - 1 = 3 and 2*2 - 1 = 3 are primes.
a(2) = 3 is a term since it is a prime and 2^3 - 1 = 7 and 2*3 - 1 = 5 are primes.
		

Crossrefs

Intersection of A000043 and A005382.
Cf. A000668.

Programs

  • Mathematica
    Select[MersennePrimeExponent[Range[47]], PrimeQ[2# -1] &] (* Amiram Eldar, Jul 29 2020 *)

Extensions

a(9)-a(11) from Robert G. Wilson v, Feb 26 2010

A251718 a(n) = smallest positive integer k such that both A083221(k, n) and A083221(k+1, n) have at most two prime factors (are primes or semiprimes).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Dec 15 2014

Keywords

Crossrefs

Variant: A251717.
A005382 gives the positions of 1 after the initial a(1)=1.

Programs

Formula

For all n, A251717(n) <= a(n) <= A251719(n).

A278229 Least number with the prime signature of 2*prime(n) - 1.

Original entry on oeis.org

2, 2, 4, 2, 6, 4, 6, 2, 12, 6, 2, 2, 16, 6, 6, 30, 12, 4, 6, 6, 6, 2, 30, 6, 2, 6, 6, 6, 6, 36, 6, 12, 30, 2, 24, 6, 2, 12, 12, 30, 30, 4, 6, 30, 6, 2, 2, 6, 6, 2, 30, 12, 6, 6, 24, 60, 6, 2, 6, 30, 6, 60, 2, 24, 16, 6, 2, 2, 60, 6, 30, 6, 2, 6, 2, 60, 30, 6, 12, 6, 24, 4, 30, 6, 2, 30, 30, 6, 6, 12, 6, 30, 6, 12, 2, 30, 12, 6, 30, 6, 2, 30, 72, 6, 6, 2, 30, 30
Offset: 1

Views

Author

Antti Karttunen, Nov 19 2016

Keywords

Crossrefs

Cf. A137288 (positions of 2's), A005382.
Cf. also A278227, A278228, A278230.

Programs

  • Mathematica
    Table[Times @@ MapIndexed[(Prime@ First@ #2)^#1 &, #] &@ If[Length@ # == 1 && #[[1, 1]] == 1, {0}, Reverse@ Sort@ #[[All, -1]]] &@ FactorInteger[ 2 Prime@ n - 1], {n, 120}] (* Michael De Vlieger, Nov 21 2016 *)
  • Scheme
    (define (A278229 n) (A046523 (+ -1 (* 2 (A000040 n)))))

Formula

a(n) = A046523(A076274(n)) = A046523((2*A000040(n))-1).

A285701 a(n) = number of iterations x -> A064216(x) needed to reach a nonprime number when starting from n, a(2) = a(3) = 1.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Apr 26 2017

Keywords

Examples

			For n=2, A064216(2) = 2, thus there is exactly one distinct prime that can be reached when iterating A064216 starting from 2, thus a(2) = 1.
For n=19, A064216(19) = 31 (a prime), A064216(31) = 59 (a prime) and A064216(59) = 44 (not a prime), thus there are exactly three distinct primes that are encountered when iterating A064216 starting from 19 before a nonprime is reached, thus a(19) = 3 (the count includes also the starting prime 19).
		

Crossrefs

Cf. A005382 (gives positions of terms > 1 from its third term 7 onward).

Programs

Formula

If A010051(n) = 0 [when n is a nonprime], a(n) = 0, otherwise a(n) = 1 + a(A064216(n)), with a(2) = a(3) = 1.

A301590 Primes p such that there are no other solutions to A023900(x) = A023900(p) than a power of p.

Original entry on oeis.org

2, 3, 5, 7, 11, 17, 19, 23, 29, 31, 43, 47, 53, 59, 67, 71, 79, 83, 101, 103, 107, 127, 131, 137, 139, 149, 151, 163, 167, 173, 179, 191, 197, 199, 211, 223, 227, 229, 239, 251, 257, 263, 269, 271, 283, 293, 307, 311, 317, 331, 347, 359, 367, 373, 379, 383, 389
Offset: 1

Views

Author

Michel Marcus, Mar 24 2018

Keywords

Comments

In the definition, A023900(p) = 1-p. One has sign(A023900(n)) = (-1)^A001221(n), so a different solution x can only exist if x has at least 3 distinct prime factors. The smallest number of the form p*q*r such that (p-1)*(q-1)*(r-1) = P-1 for primes p, q, r, P is 2*3*7 = 42, eliminating P = 13 = A301591(1) from this sequence. This is the case whenever (P+1)/2 = p > 3 is a prime (in A005382), whence P-1 = (2-1)*(3-1)*(p-1), which eliminates all P > 5 in A005383 from this sequence. - M. F. Hasler, Aug 14 2021

Examples

			2 is a term because there are no other solutions to A023900(x) = A023900(2) = -1 than other powers of 2.
13 is not a term because A023900(42) = -12 = A023900(13). Similarly, no P > 5 in A005383 is a term because A023900(P) = 1-P = (1-2)*(1-3)*(1-p) = A023900(2*3*p) with p = (P+1)/2. - _M. F. Hasler_, Aug 14 2021
		

Crossrefs

Complement (within the primes) of A301591, which has A005383 \ {3, 5} as a subsequence. Appears to have A079151 \ {13} as subsequence.

Programs

  • PARI
    f(n) = sumdivmult(n, d, d*moebius(d)); /* A023900 */
    isok(p, vp) = {for (k=p+1, p^2-1, if (f(k) == vp, return (0)); ); return (1); }
    lista(nn) = {forprime(p=2, nn, vp = f(p); if (isok(p, vp), print1(p, ", ")); ); }
    
  • PARI
    select( {is_A301590(p)=!forcomposite(k=p+1, p^2-1, A023900(k)!=1-p|| return)&& isprime(p)}, primes([1,399])) \\ M. F. Hasler, Aug 14 2021

A059790 Distance between 2*(n-th prime) and nearest prime.

Original entry on oeis.org

1, 1, 1, 1, 1, 3, 3, 1, 1, 1, 1, 1, 1, 3, 3, 1, 5, 5, 3, 3, 3, 1, 1, 1, 1, 3, 5, 3, 5, 1, 3, 1, 3, 1, 5, 5, 1, 5, 3, 1, 1, 3, 1, 3, 3, 1, 1, 3, 3, 1, 1, 1, 3, 1, 5, 3, 3, 1, 3, 1, 3, 1, 1, 3, 5, 3, 1, 1, 3, 3, 3, 1, 1, 3, 1, 3, 5, 3, 5, 3, 1, 3, 1, 3, 1, 1, 9, 3, 3, 3, 3, 5, 3, 1, 1, 3, 1, 3, 3, 5, 1, 3, 3, 9, 9
Offset: 1

Views

Author

Labos Elemer, Feb 22 2001

Keywords

Examples

			Distance 1 means that either 2p+1 or 2p-1 is also prime.
		

Crossrefs

Programs

  • Maple
    with(numtheory): [seq(min(2*ithprime(k)-prevprime(2*ithprime(k)), nextprime(2*ithprime(k))-2*ithprime(k)),k=1..256)];
  • Mathematica
    a[n_] := Min@ Differences[{NextPrime[#, -1], #, NextPrime[#]} & @ (2*Prime[n])]; Array[a, 100]  (* Amiram Eldar, Feb 08 2025 *)
  • PARI
    a(n) = {my(m = 2*prime(n)); min(m - precprime(m-1), nextprime(m+1) - m);} \\ Amiram Eldar, Feb 08 2025

Extensions

Offset corrected by Amiram Eldar, Feb 08 2025

A105653 Numbers n such that p1=2n+3, p2=4n+5, p3=6n+7 and p4=8n+9 are all prime.

Original entry on oeis.org

164, 764, 1529, 2129, 2474, 3419, 5414, 7694, 9059, 11504, 12704, 13019, 15884, 16649, 20054, 20744, 22529, 24914, 26939, 29669, 32924, 35069, 36884, 39269, 44369, 47729, 48464, 54734, 55859, 56309, 58859, 65654, 66599, 67364, 67649
Offset: 1

Views

Author

Zak Seidov, Apr 16 2005

Keywords

Crossrefs

A109927 First primes p connected to two primes either by 2p+1 or 2p-1 upward [downward (p-1)/2 or (p+1)/2].

Original entry on oeis.org

3, 5, 11, 23, 37, 83, 157, 179, 359, 661, 719, 877, 997, 1019, 1237, 1439, 1657, 2039, 2063, 2137, 2459, 2557, 2819, 2903, 2963, 3023, 3061, 3623, 3779, 3803, 3863, 4177, 4261, 4357, 4621, 4919, 5399, 5581, 5639, 6037, 6121, 6217, 6361, 6899, 6983, 7079
Offset: 1

Views

Author

Alexandre Wajnberg, Aug 31 2005

Keywords

Comments

These primes may be part of Cunningham chains longer than three terms. It seems the two operators are never mixed, except for 3, 5 and 7: -for 3, we have: 2 through <2p-1> -> 3 through <2p+1> -> 7 -for 5: 3 <2p-1> -> 5 <2p+1> -> 11 -for 7: 3 <2p+1> -> 7 <2p-1> -> 13
For p > 7, such a mixed chain with p in the middle is impossible because the number 3 would be a nontrivial factor of either the smallest or the largest term. - Jeppe Stig Nielsen, May 05 2019
Primes (excluding 2 and 7) that divide more than one semiprime triangular number A068443. - Jeppe Stig Nielsen, May 05 2019
The disjoint union of A059455 and A109835. - Jeppe Stig Nielsen, May 05 2019

Examples

			a(3)=11 is here because 5->11->23 through <2p+1>;
a(4)=23 because 11->23->47 through <2p+1>;
a(5)=37 because 19->37->73 through <2p-1>.
		

Crossrefs

Programs

  • PARI
    forprime(p=3,10^6,if(p%3==2,isprime((p-1)/2)&&isprime(2*p+1),isprime((p+1)/2)&&isprime(2*p-1))&&print1(p,", ")) \\ Jeppe Stig Nielsen, May 05 2019

A231814 Squarefree numbers (from A005117) with prime divisors in a 2p-1 progression.

Original entry on oeis.org

6, 15, 30, 91, 703, 1891, 2701, 12403, 18721, 38503, 49141, 51319, 79003, 88831, 104653, 146611, 188191, 218791, 226801, 269011, 286903, 385003, 497503, 597871, 665281, 721801, 736291, 765703, 873181, 954271, 1056331, 1314631, 1373653, 1537381, 1755001, 1869211
Offset: 1

Views

Author

Jaroslav Krizek, Nov 13 2013

Keywords

Comments

Squarefree numbers with k >= 2 prime factors of the form p_1 * p_2 * ... * p_k, where p_1 < p_2 < ... < p_k = primes with p_k = 2 * p_(k-1) - 1.
Each of these numbers is divisible by the arithmetic mean of its proper divisors.
Supersequence of A129521 (numbers of the form p*q, p and q prime with q=2*p-1; see A005382 and A005383).

Examples

			51319 = 19*37*73 where 37 = 2*19 - 1, 73 = 2*37 - 1.
		

Crossrefs

Cf. A057330 (first prime for such numbers that has n factors).

Programs

  • Maple
    N:= 10^7: # for terms <= N
    p:= 1: S:= NULL: count:= 0:
    do
      p:= nextprime(p);
      if p*(2*p-1) > N then break fi;
      q:= p; x:= p;
      do
        q:= 2*q-1;
        if not isprime(q) then break fi;
        x:= x*q;
        if x > N then break fi;
        S:= S,x; count:= count+1;
      od;
    od:
    sort([S]); # Robert Israel, Mar 24 2023
  • Mathematica
    geomQ[lst_] := Module[{x = lst - 1}, x = x/x[[1]]; Log[2, x] + 1 == Range[Length[x]]]; Select[Range[2, 1000000], ! PrimeQ[#] && SquareFreeQ[#] && geomQ[Transpose[FactorInteger[#]][[1]]] &] (* T. D. Noe, Nov 14 2013 *)

A232667 Primes p such that the p-th odious number is prime; odious primes p such that 2p-1 is prime.

Original entry on oeis.org

2, 7, 19, 31, 37, 79, 97, 157, 199, 211, 229, 271, 307, 331, 367, 379, 439, 499, 577, 601, 607, 661, 727, 829, 877, 967, 997, 1009, 1069, 1171, 1279, 1459, 1531, 1609, 1627, 1657, 1759, 1867, 2011, 2029, 2131, 2137, 2311, 2551, 2557, 3037, 3061, 3109, 3169, 3181
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Nov 27 2013

Keywords

Comments

From Antti Karttunen, Nov 29 & 30 2013: (Start)
This sequence is the intersection of A005382 and A027697.
Proof:
A000069(n) reduces according to the bit parity of n-1 as follows:
A000069(n) = 2n - 2 when n-1 is odious.
A000069(n) = 2n - 1 when n-1 is evil.
which means that no prime in this sequence can be evil, as then p-1 would be an odious number (true for all odd primes) and A000069(p) would be 2(p-1) which obviously cannot be a prime, contradicting the requirement. Thus all primes present must belong to the set of odious primes, A027697.
As each prime p here is thus odious, it means that each p-1 is an evil number (A001969), and thus A000069(p) = 2p-1. And the stipulation that it also must be prime, is just what is required from the terms of A005382. Thus this sequence contains exactly those primes that occur in both A005382 and A027697.
Equally: this is the intersection of A000069 and A005382, thus prime p occurs here iff A000120(p) is odd and 2p-1 is prime also.
Also, apart from the first term (2), all the primes (2*a(n))-1 are also odious. This follows because for any odd number k, A000120(2k-1) = A000120(k).
(End)

Examples

			7 is a prime and A000069(7) = 13, a prime also, thus 7 is in this sequence.
19 is a prime and A000069(19) = 37, a prime also, thus 19 is in this sequence.
Alternatively:
7 is a prime, 2*7-1 = 13 is also prime, and when written in binary, 7 = '111', with an odd number of 1-bits. Thus 7 is included in this sequence.
The next time this happens, is for 19, as it is a prime, 2*19-1 = 37 is also prime, and when written in binary, 19 = '10011', also has on odd number of 1-bits.
		

Crossrefs

Extensions

Edited and erroneous terms removed by Antti Karttunen, Nov 29-30 2013
Previous Showing 61-70 of 126 results. Next