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

A354747 Start with 2*n-1; repeatedly triple and add 2 until reaching a prime. a(n) = number of steps until reaching a prime > 2*n-1, or 0 if no prime is ever reached.

Original entry on oeis.org

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

Views

Author

Felix Fröhlich, Jun 06 2022

Keywords

Comments

a(n) is the smallest m >= 1 such that 2*n*3^m - 1 is prime.
The smallest unknown case is n = 100943. Is a(100943) = 0?
If it exists, a(100943) > 30000. - Michael S. Branicky and Jon E. Schoenfield, Jun 07 2022

Examples

			For n = 21: Successively applying the map x -> 3*x+2 to 2*21-1 = 41 yields the sequence 41, 125, 377, 1133, 3401, 10205, 30617, 91853, 275561, 826685, 2480057, reaching the prime 2480057 after 10 steps, so a(21) = 10.
		

Crossrefs

Programs

  • PARI
    a(n) = my(x=2*n-1, i=0); while(1, x=3*x+2; i++; if(ispseudoprime(x), return(i)))
    
  • Python
    from sympy import isprime
    def f(x): return 3*x + 2
    def a(n):
        fn, c = f(2*n-1), 1
        while not isprime(fn): fn, c = f(fn), c+1
        return c
    print([a(n) for n in range(1, 88)]) # Michael S. Branicky, Jun 06 2022

A355142 a(n) = 33648*3^n - 1.

Original entry on oeis.org

33647, 100943, 302831, 908495, 2725487, 8176463, 24529391, 73588175, 220764527, 662293583, 1986880751, 5960642255, 17881926767, 53645780303, 160937340911, 482812022735, 1448436068207, 4345308204623, 13035924613871, 39107773841615, 117323321524847, 351969964574543
Offset: 0

Views

Author

Felix Fröhlich, Jun 20 2022

Keywords

Comments

For n > 0, this is the trajectory of 100943 under the map x -> 3*x+2.
100943 is the least starting value > 0 where the trajectory under the map in the previous comment does not reach a prime after a small number of steps.
Are there any primes > 100943 in the sequence (cf. A354747 and A354748)?

Crossrefs

Programs

  • Mathematica
    33648*3^Range[0,30]-1 (* or *) LinearRecurrence[{4,-3},{33647,100943},30] (* Harvey P. Dale, Mar 03 2023 *)
  • PARI
    a(n) = 33648*3^n-1
    
  • Python
    a = [33647]; [a.append(3*a[-1]+2) for n in range(21)]
    print(a) # Michael S. Branicky, Jun 20 2022

Formula

G.f.: (33647 - 33645*x)/((1 - x)*(1 - 3*x)). - Stefano Spezia, Jun 21 2022
Showing 1-2 of 2 results.