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.

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))