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.

A368196 Irregular triangle read by rows where row n is the trajectory starting from n and ending with 2 of the map x -> A368241(x).

Original entry on oeis.org

4, 6, 9, 13, 2, 5, 2, 6, 9, 13, 2, 7, 2, 8, 12, 17, 4, 6, 9, 13, 2, 9, 13, 2, 10, 14, 20, 28, 37, 6, 9, 13, 2, 11, 4, 6, 9, 13, 2, 12, 17, 4, 6, 9, 13, 2, 13, 2, 14, 20, 28, 37, 6, 9, 13, 2, 15, 21, 29, 6, 9, 13, 2, 16, 22, 30, 40, 52, 67, 6, 9, 13, 2, 17, 4, 6, 9, 13, 2
Offset: 4

Views

Author

Hendrik Kuipers, Dec 16 2023

Keywords

Comments

It is conjectured that every starting n reaches 2 eventually. (If not then the sequence has an infinite final row.)
Map A368241(x) decreases to the prime gap x-prevprime(x) when x is prime, or increases to x+primepi(x) otherwise, and will reach 2 when x is the greater of a twin prime pair (A006512, preceding prime gap 2).
Prime gaps and x+primepi(x) may become large, but if the twin prime conjecture is true then there would be large twin primes they might reach too.

Examples

			Table T(n,k) begins:
  n\k    0   1   2   3   4   5   6   7   8   9
  --------------------------------------------
   4:    4   6   9  13   2
   5:    5   2
   6:    6   9  13   2
   7:    7   2
   8:    8  12  17   4   6   9  13   2
   9:    9  13   2
  10:   10  14  20  28  37   6   9  13   2
  11:   11   4   6   9  13   2
  12:   12  17   4   6   9  13   2
  13:   13   2
  14:   14  20  28  37   6   9  13   2
  15:   15  21  29   6   9  13   2
  16:   16  22  30  40  52  67   6   9  13   2
  17:   17   4   6   9  13   2
  18:   18  25  34  45  59   6   9  13   2
  19:   19   2
  20:   20  28  37   6   9  13   2
		

Crossrefs

Programs

  • PARI
    row(n) = my(list=List(n)); while(n!=2, n = if (isprime(n), n - precprime(n-1), n + primepi(n)); listput(list, n)); Vec(list); \\ Michel Marcus, Dec 17 2023

Formula

T(n,0) = n.
T(n,k) = A368241(T(n,k-1)) for k >= 1.

A368690 Number of terms in the trajectory from n to 2 of the map x -> A368241(x), or -1 if n never reaches 2.

Original entry on oeis.org

5, 2, 4, 2, 8, 3, 9, 6, 7, 2, 8, 7, 10, 6, 9, 2, 7, 6, 9, 6, 17, 8, 16, 8, 6, 5, 8, 2, 3, 16, 7, 15, 7, 5, 9, 10, 7, 6, 8, 2, 15, 6, 14, 6, 5, 10, 8, 9, 6, 5, 7, 7, 16, 3, 14, 5, 13, 2, 14, 4, 9, 7, 8, 5, 5, 13, 6, 6, 15, 2, 13, 11, 10, 12, 28, 5, 13, 3, 8, 6, 7, 15, 3, 4, 12, 5
Offset: 4

Views

Author

Hendrik Kuipers, Jan 03 2024

Keywords

Comments

It is conjectured that every starting n reaches 2 eventually.
A368241(x) decreases to the prime gap x-prevprime(x) when x is prime, or increases to x+primepi(x) otherwise, and will reach 2 when x is the greater of a twin prime pair (A006512, preceding prime gap 2).
Prime gaps and x+primepi(x) may become large, but if the twin prime conjecture is true then there would be large twin primes they might reach too.

Examples

			For n=4 the trajectory is 4 -> 6 -> 9 -> 13 -> 2 (row 4 of A368196) which has a(4) = 5 terms.
		

Crossrefs

Programs

  • PARI
    f(n) = if (isprime(n), n - precprime(n-1), n + primepi(n)); \\ A368241
    a(n) = my(k=1); while ((n = f(n)) != 2, k++); k+1; \\ Michel Marcus, Jan 03 2024
Showing 1-2 of 2 results.