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

A194638 Smallest prime either of the form (2*n-1)*2^k - 1 or (2*n-1)*2^k + 1, k >= 0, or 0 if no such prime exists.

Original entry on oeis.org

2, 2, 11, 13, 17, 23, 53, 29, 67, 37, 41, 47, 101, 53, 59, 61, 67, 71, 73, 79, 83, 173, 89, 751, 97, 101, 107, 109, 113, 1889, 487, 127, 131, 269, 137, 283, 293, 149, 307, 157, 163, 167, 1361, 173, 179, 181, 373, 191, 193, 197, 809, 823, 211, 857, 6977, 223, 227
Offset: 1

Views

Author

Arkadiusz Wesolowski, Aug 31 2011

Keywords

Comments

Bisection of A194603.
Primes arising from A194636 (or 0 if no such prime exists).

Examples

			For n=4, 7*2^0-1 and 7*2^0+1 are composite, but 7*2^1-1=13 is prime, so a(4)=13.
		

Crossrefs

Programs

  • Mathematica
    Table[n = 2*n - 1; k = 0; While[! PrimeQ[a = n*2^k - 1] && ! PrimeQ[a = n*2^k + 1], k++]; a, {n, 100}] (* Arkadiusz Wesolowski, Sep 04 2011 *)

A050921 Smallest prime of form n*2^m+1, m >= 0, or 0 if no such prime exists.

Original entry on oeis.org

2, 3, 7, 5, 11, 7, 29, 17, 19, 11, 23, 13, 53, 29, 31, 17, 137, 19, 1217, 41, 43, 23, 47, 97, 101, 53, 109, 29, 59, 31, 7937, 257, 67, 137, 71, 37, 149, 1217, 79, 41, 83, 43, 173, 89, 181, 47
Offset: 1

Views

Author

N. J. A. Sloane, Dec 30 1999

Keywords

Comments

Primes arising from A040076 (or 0 if no such prime exists).
Or: Starting with x=n+1, the first prime created by iterating the map x-> 2*x-1. - Kevin L. Schwartz and Christian N. K. Anderson, May 13 2013

Crossrefs

Programs

  • Maple
    A050921 := proc(n)
        for m from 0 do
            if isprime(n*2^m+1) then
                return n*2^m+1 ;
            end if;
        end do;
    end proc; # R. J. Mathar, Jun 01 2013
  • Mathematica
    Do[m = 0; While[ !PrimeQ[n*2^m + 1], m++ ]; Print[n*2^m + 1], {n, 1, 47} ]

Extensions

The next term (47*2^583 + 1) is too large to show.

A108129 Riesel problem: let k=2n-1; then a(n)=smallest m >= 1 such that k*2^m-1 is prime, or -1 if no such prime exists.

Original entry on oeis.org

2, 1, 2, 1, 1, 2, 3, 1, 2, 1, 1, 4, 3, 1, 4, 1, 2, 2, 1, 3, 2, 7, 1, 4, 1, 1, 2, 1, 1, 12, 3, 2, 4, 5, 1, 2, 7, 1, 2, 1, 3, 2, 5, 1, 4, 1, 3, 2, 1, 1, 10, 3, 2, 10, 9, 2, 8, 1, 1, 12, 1, 2, 2, 25, 1, 2, 3, 1, 2, 1, 1, 2, 5, 1, 4, 5, 3, 2, 1, 1, 2, 3, 2, 4, 1, 2, 2, 1, 1, 8, 3, 4, 2, 1, 3, 226, 3, 1, 2, 1, 1, 2
Offset: 1

Views

Author

Jorge Coveiro, Jun 04 2005

Keywords

Comments

It is conjectured that the integer k = 509203 is the smallest Riesel number, that is, the first n such that a(n) = -1 is 254602.
Browkin & Schinzel, having proved that 509203*2^k - 1 is composite for all k > 0, ask for the first such number with this property, noting that the question is implicit in Aigner 1961. - Charles R Greathouse IV, Jan 12 2018
Record values begin a(1) = 2, a(7) = 3, a(12) = 4, a(22) = 7, a(30) = 12, a(64) = 25, a(96) = 226, a(330) = 800516; the next record appears to be a(1147), unless a(1147) = -1. (The value for a(330), i.e., for k = 659, is from the Ballinger & Keller link, which also lists k = 2293, i.e., n = (k+1)/2 = (2293+1)/2 = 1147, as the smallest of 50 values of k < 509203 for which no prime of the form k*2^m-1 had yet been found.) - Jon E. Schoenfield, Jan 13 2018
Same as A046069 except for a(2) = 1. - Georg Fischer, Nov 03 2018

References

  • Hans Riesel, Några stora primtal, Elementa 39 (1956), pp. 258-260.

Crossrefs

Main sequences for Riesel problem: A038699, A040081, A046069, A050412, A052333, A076337, A101036, A108129.

Programs

  • Mathematica
    Array[Function[k, SelectFirst[Range@300, PrimeQ[k 2^# - 1] &]][2 # - 1] &, 102] (* Michael De Vlieger, Jan 12 2018 *)
    smk[n_]:=Module[{m=1,k=2n-1},While[!PrimeQ[k 2^m-1],m++];m]; Array[smk,120] (* Harvey P. Dale, Dec 26 2023 *)
  • PARI
    forstep(k=1,301,2,n=1;while(!isprime(k*2^n-1),n++);print1(n,","))

Extensions

Edited by Herman Jamke (hermanjamke(AT)fastmail.fm), Oct 25 2006
Name corrected by T. D. Noe, Feb 13 2011

A103963 Record values in A040081.

Original entry on oeis.org

2, 3, 4, 7, 12, 23, 25, 2551, 800516
Offset: 1

Views

Author

Lei Zhou, Feb 24 2005

Keywords

Comments

A040081(659) not yet found. The index sequence of this one is 1, 13, 23, 43, 59, 88, 127, 148, 659.
800516 was found by Dave Linton in 2004.

Examples

			A040081(1)=2; A040081(13)=3; A040081(659)>8192
		

Crossrefs

Programs

  • Mathematica
    kmax=8192; k = 0; n = 0; km = k; While[k < kmax, n++; k = 0; cp = n*(2^k) - 1; While[(!PrimeQ[cp]) && (k < kmax), k++; cp = n*(2^k) - 1]; If[k > km, km = k; Print[{n, km}]]]

Extensions

Edited by T. D. Noe, Nov 15 2010

A057026 Smallest prime of form (2n+1)*2^m-1 for some m, or 0 if no such prime exists.

Original entry on oeis.org

3, 2, 19, 13, 17, 43, 103, 29, 67, 37, 41, 367, 199, 53, 463, 61, 131, 139, 73, 311, 163, 5503, 89, 751, 97, 101, 211, 109, 113, 241663, 487, 251, 1039, 2143, 137, 283, 9343, 149, 307, 157, 647, 331, 2719, 173, 1423, 181, 743, 379, 193, 197, 103423, 823, 419
Offset: 0

Views

Author

Henry Bottomley, Jul 24 2000

Keywords

Comments

If a(329) > 0 it is greater than 659*2^10000. - Robert Israel, Jul 01 2014
Indeed, a(329) > 659*2^100000 if it is nonzero. There does not appear to be a covering set, though, so probably a(329) > 0. - Charles R Greathouse IV, Jul 02 2014
a(329) = 659*2^800516 - 1 (found by David W Linton in 2004). - Robert Israel, Jul 04 2014

Examples

			a(5)=43 because 2*5+1=11 and smallest prime of the form 11*2^m-1 is 43 (since 10 and 21 are not prime)
		

Crossrefs

Programs

  • Maple
    A057026:= proc(n)
    local t;
         t:= 2*n;
         while not isprime(t) do t:= 2*t+1 od;
         t
    end proc;
    seq(A057026(n),n=0..328); # Robert Israel, Jul 01 2014

A093007 First nonprime number reached when iterating n under x->2*x+1.

Original entry on oeis.org

1, 95, 15, 4, 95, 6, 15, 8, 9, 10, 95, 12, 27, 14, 15, 16, 35, 18, 39, 20, 21, 22, 95, 24, 25, 26, 27, 28, 119, 30, 63, 32, 33, 34, 35, 36, 75, 38, 39, 40, 335, 42, 87, 44, 45, 46, 95, 48, 49, 50, 51, 52, 215, 54, 55, 56, 57, 58, 119, 60, 123, 62, 63, 64, 65, 66, 135
Offset: 1

Views

Author

Reinhard Zumkeller, Mar 14 2004

Keywords

Examples

			n = 41 = A000040(13) -> 2*41+1 = 83 = A000040(23) -> 2*83+1 = 167 = A000040(39) -> 2*167+1 = 335 = 67*5, therefore a(41) = 335, A063377(41) = 3.
		

Crossrefs

Programs

  • Mathematica
    Table[NestWhile[2#+1&,n,PrimeQ],{n,70}] (* Harvey P. Dale, Sep 25 2012 *)

Formula

n>1: A070939(a(n)) = A070939(n) + A063377(n), A000120(a(n)) = A000120(n) + A063377(n).

Extensions

Definition corrected by Harvey P. Dale, Sep 25 2012

A093009 Smallest number m such that m is prime iff n is not prime and the binary representation of m equals n with appended trailing 1's.

Original entry on oeis.org

3, 95, 15, 19, 95, 13, 15, 17, 19, 43, 95, 103, 27, 29, 31, 67, 35, 37, 39, 41, 43, 367, 95, 199, 103, 53, 223, 463, 119, 61, 63, 131, 67, 139, 71, 73, 75, 311, 79, 163, 335, 5503, 87, 89, 367, 751, 95, 97, 199, 101, 103, 211, 215, 109, 223, 113, 463, 241663
Offset: 1

Views

Author

Reinhard Zumkeller, Mar 14 2004

Keywords

Comments

a(n) = Max{A093007(n), A038699(n)};
n>1: A070939(a(n))=A070939(n)+A093008(n), A000120(a(n))=A000120(n)+A093008(n).

A225721 Starting with x = n, the number of iterations of x := 2x - 1 until x is prime, or -1 if no prime exists.

Original entry on oeis.org

-1, 0, 0, 1, 0, 1, 0, 2, 1, 1, 0, 1, 0, 2, 1, 1, 0, 3, 0, 6, 1, 1, 0, 1, 2, 2, 1, 2, 0, 1, 0, 8, 3, 1, 2, 1, 0, 2, 5, 1, 0, 1, 0, 2, 1, 2, 0, 583, 1, 2, 1, 1, 0, 1, 1, 4, 1, 2, 0, 5, 0, 4, 7, 1, 2, 1, 0, 2, 1, 1, 0, 3, 0, 2, 1, 1, 4, 3, 0, 2, 3, 1, 0, 1, 2, 4
Offset: 1

Views

Author

Keywords

Comments

This appears to be a shifted variant of A040076. - R. J. Mathar, May 28 2013
If n is prime, then a(n) = 0. If the sequence never reaches a prime number (for n = 1) or the prime number has more than 1000 digits, -1 is used instead. There are 22 such numbers for n < 10000.

Examples

			For a(20), the trajectory is 20->39->77->153->305->609->1217, a prime number. That required 6 steps, so a(20)=6.
		

Crossrefs

Cf. A050921 (primes obtained).
Cf. A040081, A038699, A050412, A052333, A046069 (related to the Riesel problem).
Cf. A000668, A000043, A065341 (Mersenne primes), A000079 (powers of 2).
Cf. A007770 (happy numbers), A031177 (unhappy numbers).
Cf. A037274 (home primes), A037271 (steps), A037272, A037272.

Programs

  • R
    y=as.bigz(rep(0,500)); ys=rep(0,500);
    for(i in 1:500) { n=as.bigz(i); k=0;
        while(isprime(n)==0 & ndig(n)<1000 & k<5000) { k=k+1; n=2*n-1 }
        if(ndig(n)>=1000 | k>=5000) { ys[i]=-1; y[i]=-1;
        } else {ys[i]=k; y[i]=n; }
    }

A244609 Least prime divisor of 659*2^n-1.

Original entry on oeis.org

2, 3, 5, 3, 13, 3, 5, 3, 73, 3, 5, 3, 7, 3, 5, 3, 13, 3, 5, 3, 977, 3, 5, 3, 7, 3, 5, 3, 13, 3, 5, 3, 31, 3, 5, 3, 7, 3, 5, 3, 13, 3, 5, 3, 73, 3, 5, 3, 7, 3, 5, 3, 13, 3, 5, 3, 13477, 3, 5, 3, 7, 3, 5, 3, 13, 3, 5, 3, 48430237, 3, 5, 3, 7, 3, 5, 3, 13
Offset: 0

Views

Author

Robert Israel, Jul 01 2014

Keywords

Comments

a(n) = 3 if n is odd.
a(n) = 5 if n == 2 (mod 4).
From Bruno Berselli, Jul 02 2014: (Start)
a(n) = 7 if n == 0 (mod 12) for n>0.
a(n) = 13 if n == 4 (mod 12).
a(n) == 3 or 7 (mod 12) for n>1. (End)
A040081(659) = 800516, so 800516 is the first n for which a(n) = 659*2^n-1 (found by David W Linton in 2004). - Jens Kruse Andersen, Jul 02 2014

Examples

			For n=4, 659*2^4-1 = 10543 = 13 * 811 so a(4) = 13.
		

Crossrefs

Programs

  • Magma
    [PrimeDivisors(659*2^n-1)[1]: n in [0..100]]; // Bruno Berselli, Jul 02 2014
  • Maple
    f:= proc(m) local F;
       F:= map(t -> t[1],ifactors(659*2^m-1,easy)[2]);
       F:= select(type,F,integer);
       if nops(F) = 0 then
         F:= map(t -> t[1],ifactors(659*2^m-1)[2]);
         min(F);
       else min(F)
       fi
    end proc;
    seq(f(n), n= 0 .. 100);

A178948 a(n) = smallest m>=0 such that n*(3^m)-1 is prime, or -1 if no such prime exists.

Original entry on oeis.org

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

Views

Author

Jonathan Vos Post, Dec 31 2010

Keywords

Comments

For odd n>=5, a(n)=-1 because then n*3^m is odd, therefore n*3^m-1 even and not prime. - R. J. Mathar, Jan 03 2011

Examples

			a(1) = 1 because 1*(3^1) - 1 = 2 is prime.
a(5) = -1 because 5*(3^m) - 1 is even and >=4.
a(22) = 2 because 22*(3^2)-1 = 197 is prime.
		

Crossrefs

Previous Showing 11-20 of 20 results.