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

A250205 Riesel problem in base 6: Least k > 0 such that n*6^k-1 is prime, or 0 if no such k exists.

Original entry on oeis.org

1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 2, 1, 1, 0, 1, 1, 1, 2, 0, 1, 1, 2, 1, 0, 2, 1, 1, 1, 0, 1, 1, 2, 2, 0, 4, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 4, 1, 3, 0, 1, 1, 6, 2, 0, 5, 1, 1, 1, 0, 6, 2, 1, 1, 0, 1, 2, 10, 1, 0, 1, 3, 1, 1, 0, 1, 1, 2, 1, 0, 1, 8, 1, 1, 0, 1, 2, 2, 4, 0, 49, 1, 1, 1, 0, 2, 1, 1, 1, 0, 2, 1, 6, 2, 0, 1, 1, 1, 1, 0, 5, 1, 1, 2, 0, 1, 10, 2, 1
Offset: 1

Views

Author

Eric Chen, Mar 13 2015

Keywords

Comments

a(5j+1) = 0 except for a(1), since (5j+1)*6^k-1 is always divisible by 5, but there are infinitely many numbers not in the form 5j+1 such that a(n) = 0.
a(n) = 0 for n == 84687 mod 10124569, because then n*6^k-1 is always divisible by at least one of 7, 13, 31, 37, 97. - Robert Israel, Mar 17 2015
Conjecture: if n is not in the form 5j+1 and n < 84687, then a(n) > 0.

Crossrefs

Cf. A250204 (Least k > 0 such that n*6^k+1 is prime).

Programs

  • Maple
    N:= 1000: # to get a(1) to a(N), using k up to 10000
    a[1]:= 1:
    for n from 2 to N do
    if n mod 5 = 1 then a[n]:= 0
    else
        for k from 1 to 10000 do
        if isprime(n*6^k-1) then
           a[n]:= k;
             break
          fi
        od
    fi
    od:
    seq(a[n],n=1..N); # Robert Israel, Mar 17 2015
  • Mathematica
    (* m <= 10000 is sufficient up to n = 1000 *)
    a[n_] := For[k = 1, k <= 10000, k++, If[PrimeQ[n*6^k - 1], Return[k]]] /. Null -> 0; Table[a[n], {n, 1, 120}]
  • PARI
    a(n) = if(n%5==1 && n>1, 0, for(k = 1, 10000, if(ispseudoprime(n*6^k-1), return(k))))

Formula

a(A024898(n)) = 1. - Michel Marcus, Mar 16 2015

A101050 Least k such that prime(n)*2^k-1 is prime, or -1 if no such k exists.

Original entry on oeis.org

1, 0, 2, 1, 2, 3, 2, 1, 4, 4, 1, 1, 2, 7, 4, 2, 12, 3, 5, 2, 7, 1, 2, 4, 1, 10, 3, 10, 9, 8, 25, 2, 2, 1, 4, 5, 1, 3, 4, 2, 8, 3, 226, 3, 2, 1, 1, 3, 2, 1, 4, 4, 11, 6, 4, 2, 8, 1, 5, 2, 11, 2, 1, 26, 3, 6, 1, 1, 18, 3, 4, 4, 1, 7, 1, 2, 20, 5, 10, 3, 4, 7, 2, 3, 1, 6, 112, 9, 10, 7, 2, 12, 5, 46, 1, 2, 8
Offset: 1

Views

Author

Pierre CAMI, Jan 21 2005

Keywords

Comments

Primes p such that p*2^k-1 is composite for all k are called Riesel numbers. The smallest known Riesel number is the prime 509203. Currently, 2293 is the smallest prime whose status is unknown. For a(120), which corresponds to the prime 659, Dave Linton found the least k is 800516. - T. D. Noe, Aug 04 2005

References

Crossrefs

Cf. A046069 (least k such that (2n-1)*2^k-1 is prime).

Programs

  • Mathematica
    Table[p=Prime[n]; k=0; While[ !PrimeQ[ -1+p*2^k], k++ ]; k, {n, 119}] (* T. D. Noe, Aug 04 2005 *)

Extensions

Corrected and extended by T. D. Noe, Aug 04 2005

A252168 Smallest k > 0 such that |(2n-1) - 2^k| is prime, or -1 if no such k exists.

Original entry on oeis.org

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

Views

Author

Eric Chen, Dec 14 2014

Keywords

Comments

It is known that a(254602) = -1, because |509203-2^k| is always divisible by 3, 5, 7, 13, 17, or 241. a(1147) is the first unknown term.
a((A101036(n)+1)/2) = -1, so there are infinitely many n such that a(n) = -1.
a((A133122(n)+1)/2) = A096502((A133122(n)-1)/2).

Examples

			a(12) = 2 because 2*12-1 = 23 and that 23-2^1 = 21 is not prime but 23-2^2 = 19 is.
a(69) = 6 because 2*69-1 = 137, |137-2^k| is composite for k = 1, 2, 3, 4, 5 and prime for k = 6.
Even the smallest k can be also very large. For example, a(169) = 791.
a(1147) > 65536.
		

Crossrefs

Programs

  • Mathematica
    Table[k = 1; While[!PrimeQ[Abs[(2*n-1) - 2^k]], k++]; k, {n, 1, 1000}]
  • PARI
    A252168(n)={ my(k=1); n=2*n-1; while(!ispseudoprime(abs(n-2^k)), k++); k }

Extensions

a(19) corrected by Jinyuan Wang, Mar 25 2023

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; }
    }
Previous Showing 11-14 of 14 results.