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 21-28 of 28 results.

A050544 Numbers k such that 37*2^k-1 is prime.

Original entry on oeis.org

1, 2553, 4893, 7897, 14353, 32125, 51477, 78973, 341365
Offset: 1

Views

Author

N. J. A. Sloane, Dec 29 1999

Keywords

Crossrefs

Programs

Extensions

More terms from David Broadhurst, Dec 29 1999
More terms from Herman Jamke (hermanjamke(AT)fastmail.fm), Jan 02 2008

A078681 Start with n; iterate the process x -> ceiling(3x/2) until reach a prime. Sequence gives number of steps to reach a prime or 0 if no prime is ever reached.

Original entry on oeis.org

1, 1, 1, 53, 5, 52, 1, 4, 51, 2, 1, 3, 39, 50, 1, 162, 3, 2, 1, 38, 49, 4, 2, 161, 50, 2, 1, 52, 4, 37, 1, 48, 3, 13, 1, 160, 9, 49, 1, 8, 42, 51, 18, 3, 36, 8, 1, 47, 3, 2, 12, 35, 27, 159, 1, 8, 48, 2, 1, 7, 4, 41, 50, 16, 17, 2, 1, 35, 7, 13, 1, 46, 11, 2, 1, 3, 11, 34, 2, 26, 158, 7, 6, 7
Offset: 1

Views

Author

Benoit Cloitre, Dec 17 2002

Keywords

Crossrefs

Cf. A050412.

Programs

  • PARI
    a(n)=if(n<0,0,s=n; c=1; while(isprime(ceil(3*s/2))==0,s=ceil(3*s/2); c++); c)

A138508 Semiprime analog of Riesel problem: start with n; repeatedly double and add 1 until reach a semiprime. Sequence gives number of steps to reach a semiprime or 0 if no semiprime is ever reached.

Original entry on oeis.org

3, 5, 2, 1, 4, 3, 1, 2, 2, 1, 3, 1, 2, 3, 5, 1, 1, 4, 1, 4, 2, 2, 2, 1, 1, 3, 1, 1, 2, 2, 4, 1, 4, 1, 2, 3, 3, 1, 2, 3, 3, 1, 1, 7, 1, 1, 1, 3, 4, 2, 3, 10, 2, 2, 1, 6, 1, 2, 1, 1, 1, 4, 3, 1, 3, 1, 3, 3, 3, 1, 1, 1, 2, 2, 2, 5, 1, 4, 1, 1, 2, 6, 2, 1, 3, 3, 3, 1, 6, 5, 1, 1, 1, 5, 3, 5, 2, 2, 3, 1, 1, 1, 2, 1, 9, 1, 1, 1, 1, 1, 2
Offset: 1

Views

Author

Jonathan Vos Post, May 10 2008

Keywords

Comments

This is the analog of A050412 with "prime" replaced by "semiprime". [Edited by Felix Fröhlich, Apr 21 2021]
a(n) is the smallest m>=0 such that (n+1)*2^m-1 is semiprime, or 0 if no such semiprime exists. - R. J. Mathar, May 12 2008
There is no "semiprime Riesel number" (i.e., n such that a(n) = 0) among all n up to 2*10^6. - Felix Fröhlich, Apr 21 2021

Crossrefs

Programs

  • Maple
    isA001358 := proc(n) RETURN( numtheory[bigomega](n) = 2) ; end:
    A138508 := proc(n) local a,niter ; niter := n ; a := 0 ; while not isA001358(niter) do a := a+1 ; niter := 2*niter+1 ; od: a ; end:
    seq(A138508(n),n=1..200) ; # R. J. Mathar, May 12 2008
  • PARI
    a(n) = my(x=n, i=0); while(1, x=2*x+1; i++; if(bigomega(x)==2, return(i))); \\ Felix Fröhlich, Apr 21 2021

Extensions

More terms from R. J. Mathar, May 12 2008
All terms corrected by Felix Fröhlich, Apr 21 2021

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; }
    }

A257495 The number of iterations (x -> 2x+1) until a prime is found, starting with prime(n); or 0 if a prime is never found.

Original entry on oeis.org

1, 1, 1, 2, 1, 4, 2, 2, 1, 1, 2, 2, 1, 24, 2, 1, 2, 4, 2, 4, 2552, 4, 1, 1, 4, 8, 4, 2, 2, 1, 6, 1, 3, 4, 2, 2, 2, 8, 4, 1, 1, 2, 1, 8, 3, 6, 4, 4, 2, 2, 1, 1, 2, 1, 2, 3, 8, 2, 4, 1, 12, 1, 2, 21, 4, 3, 2, 4, 6, 2, 11, 1, 2, 16, 4, 4, 2, 4, 2, 8, 1, 12, 1, 8
Offset: 1

Views

Author

Bill McEachen, Apr 26 2015

Keywords

Comments

The number of iterations is defined as in A050412 (probably always positive).
Sophie Germain primes correspond to values a(n)=1 (A156660).
The plot without largest outliers allows detail on lower bound trending. Such outliers begin beyond the 121st entry. The number of terminal primes (those from the terminating iteration) being Sophie Germain through the first 10000 seeds is approximately 910. The number of Sophie Germain primes expected below 10000 is approximately 156 (computationally the comparison is more complicated, obviously).
For prime(21) = 73, a(21) = 2552 corresponds to the prime 12525084203....315016703 with 771 digits. See A171390. - Vincenzo Librandi, Apr 27 2015
a(n) is the smallest k > 0 such that (prime(n) + 1)*2^k - 1 is prime. - Thomas Ordowski, Jun 05 2019

Examples

			Starting from prime(6)=13, sequential values for evaluation are 2*13+1=27, 2*27+1=55, 2*55+1=111, 2*111+1=223. The first prime is encountered at the 4th iteration, thus a(6)=4.
		

Crossrefs

Cf. A050412 (Riesel problem).

Programs

  • Maple
    A257495 := proc(n)
        A050412(ithprime(n)) ;
    end proc: # R. J. Mathar, Jul 23 2015 reusing code from A050412
  • Mathematica
    Length@ NestWhileList[2 # + 1 &, Prime@ #, CompositeQ, {2, 1}] - 1 & /@ Range@ 120 (* Michael De Vlieger, Apr 26 2015 *)
  • PARI
    genit()={
    my(maxx=122,istrt=1,opt=1);n=istrt;cnt=1;val=2*prime(n)+1;
    prev=val;prcnt=0;while(n<=maxx, if( val%6!=1 && val%6!=5,cnt+=1;val=2*val+1 );
    if(ispseudoprime(val), print1(cnt,",");if(opt>0&&ispseudoprime(2*val+1),prcnt+=1);
    cnt=1;n+=1;val=2*prime(n)+1;prev=val ); if(!ispseudoprime(val),cnt+=1;val=2*val+1));
    }
    
  • PARI
    a(n,k=prime(n))=my(t=1);while(!ispseudoprime(k=2*k+1),t++);t \\ Charles R Greathouse IV, May 22 2015

Formula

a(n) = A050412(prime(n)). - Michel Marcus, Jun 08 2015

A375155 a(n) = 2*a(n-1) + 1 for a(n-1) not prime, otherwise a(n) = prime(n) - 1; with a(1) = 147.

Original entry on oeis.org

147, 295, 591, 1183, 2367, 4735, 9471, 18943, 37887, 75775, 151551, 303103, 606207, 1212415, 2424831, 4849663, 9699327, 19398655, 38797311, 77594623, 155189247, 310378495, 620756991, 1241513983, 2483027967, 4966055935, 9932111871, 19864223743, 39728447487, 79456894975
Offset: 1

Views

Author

Chai Wah Wu, Aug 01 2024

Keywords

Comments

Variant of A374965 with initial condition a(1) = 147. If a(1) is prime, the trajectory is: a(1), 2, 4, 9, ... and matches A374965 after the second term. It appears that for most composite a(1), the trajectories also converge towards A374965. This could be due to A050412(n) being small for many composite n.
a(1) = 147 is the first composite number where the trajectory appears not to converge towards A374965.
Other values of a(1) for which the trajectory converges to this sequence are: 295, 591, 1183, 2278, 2367, 3328, 4557, 4602, 4735, 5950, 6072, 6657, 7227, 9115, 9205, 9471, 9612, 9912, 9955, ...

Crossrefs

Programs

  • Mathematica
    Module[{n = 1}, NestList[If[n++; PrimeQ[#], Prime[n] - 1, 2*# + 1] &, 147, 50]] (* Paolo Xausa, Aug 02 2024 *)
  • Python
    from itertools import islice
    from sympy import isprime, nextprime
    def A375155_gen(): # generator of terms
        a, p = 147, 3
        while True:
            yield a
            a, p = p-1 if isprime(a) else (a<<1)|1, nextprime(p)
    A375155_list = list(islice(A375155_gen(),40))

A377364 a(n) = least k such that 2n*3^k-2 is prime, or 0 if no prime is reached.

Original entry on oeis.org

1, 1, 1, 2, 1, 1, 1, 3, 2, 1, 1, 1, 1, 3, 2, 1, 1, 1, 4, 5, 1, 2, 1, 2, 1, 1, 1, 9, 2, 1, 4, 1, 1, 2, 1, 5, 1, 1, 11, 1, 2, 2, 4, 3, 1, 1, 1, 3, 2, 4, 1, 1, 5, 3, 1, 1, 3, 1, 2, 4, 1, 1, 1, 2, 2, 1, 5, 1, 3, 1, 2, 1, 1, 8, 3, 1, 1, 4, 2, 80, 1, 6, 1, 8, 2, 2
Offset: 1

Views

Author

Clark Kimberling, Oct 31 2024

Keywords

Examples

			a(20) = 5 because 40*3^5 + 1 is prime and 40*3^k + 1 is not prime for k=1..4.
		

Crossrefs

Programs

  • Mathematica
    {b, h} = {3, 2}; f[n_, k_] := n*b^k - h
    s[n_] := Select[Range[20], PrimeQ[f[n, #]] &, 1]
    Flatten[Table[s[n], {n, 1, 200}]]

A377365 a(n) = least k such that 2n*5^k+1 is prime, or 0 if no prime is reached.

Original entry on oeis.org

1, 2, 1, 1, 2, 1, 1, 2, 3, 1, 4, 2, 1, 2, 1, 3, 8, 1, 1, 1036, 1, 3, 2, 1, 1, 2, 1, 1, 2, 4, 1, 2, 1, 3, 6, 2, 257, 2, 2, 1, 40, 1, 1, 4, 2, 1, 2, 10, 1, 4, 2, 1, 6, 1, 3, 2, 1, 15, 4, 1, 79, 48, 1, 1, 2, 1, 5, 6, 1, 1, 6, 4, 3, 2, 1, 1, 2, 3, 3, 2, 1, 1, 6
Offset: 1

Views

Author

Clark Kimberling, Oct 31 2024

Keywords

Examples

			a(20) = 1036 because 40*5^k+1 is prime for k=1036 and not prime for k=1..1035.
		

Crossrefs

Programs

  • Mathematica
    f[n_, k_] := 2 n*5^k + 1;
    s[n_] := Select[Range[5000], PrimeQ[f[n, #]] &, 1];
    Flatten[Table[s[n], {n, 1, 500}]]
Previous Showing 21-28 of 28 results.