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

A138753 Number of iterations of A138754 before reaching a number for the second time, when starting with n.

Original entry on oeis.org

1, 4, 5, 3, 3, 5, 3, 8, 6, 4, 21, 17, 7, 7, 5, 5, 22, 24, 20, 18, 18, 16, 8, 6, 8, 6, 29, 23, 27, 23, 23, 21, 19, 19, 17, 21, 17, 15, 7, 7, 9, 60, 9, 9, 7, 30, 28, 26, 24, 26, 24, 24, 28, 24, 22, 20, 20, 22, 20, 18, 20, 18, 20, 18, 18, 16, 14, 12, 10, 12, 10, 61, 59, 55, 12, 10, 8, 31
Offset: 1

Views

Author

M. F. Hasler, Apr 01 2008

Keywords

Comments

This is a variation of A138752, giving the number of iterations of A138754 needed to get any number for the second time, while A138752 stops counting somehow arbitrarily at 1=primepi(2) or 4=primepi(7).
The map A138754 is a variation of the Collatz map where parity of the integers is replaced by p mod 3 for the primes.
For the Collatz map, we have the only fixed point 0=f(0) and all other numbers seem to end up in the cycle 1->4->2->1.
Here the only fixed point is 1=A138754(1) and all other numbers seem to end up in the cycle 4 -> 7 -> 5 -> 4 (corresponding to primes 7 -> 17 -> 11 -> 7).
Depending on which number among primepi({2,7,11,17}) is reached first, A138753(n) = A138752(n)+1,+3,+2 resp. +1. (A138752(n) is the length of the so-called GB-sequence starting with prime(n).)

Examples

			a(1)=1 since after 1 step we find 1 again.
a(4)=3 since 4 -> 7 -> 5 -> 4 under A138754.
		

Crossrefs

Cf. A124123, A006577, A171938, A138756 (record values/indices).

Programs

Formula

a(n) = min { k>0 | A138754^k(n) = A138754^m(n) for some m>=0, m
If n is not in {1,4,5,7}, then a(n) = 1+a(A138754(n)).

A171938 Record values in A138753 (a "prime" variation of the Collatz (3n+1) problem).

Original entry on oeis.org

1, 4, 5, 8, 21, 22, 24, 29, 60, 61, 72, 73, 97, 100, 184, 216, 239, 451, 469
Offset: 1

Author

M. F. Hasler, Apr 01 2008

Keywords

Crossrefs

Cf. A124123, A138750-A138754, A138756, A006878 (analog for Collatz problem).

Programs

Formula

A171938 = { A138753(m) | A138753(k) < A138753(m) for all k

Extensions

Originally submitted as A138755, but mislaid by Editor-in-Chief; renumbered and added to OEIS, Oct 24 2010
a(15)-a(19) from Paolo Xausa, Jul 29 2023

A138757 a(n) = A007918(A138750(n)), that is, least prime > n/2 if n=2 (mod 3), > 2n otherwise.

Original entry on oeis.org

2, 2, 2, 7, 11, 3, 13, 17, 5, 19, 23, 7, 29, 29, 7, 31, 37, 11, 37, 41, 11, 43, 47, 13, 53, 53, 13, 59, 59, 17, 61, 67, 17, 67, 71, 19, 73, 79, 19, 79, 83, 23, 89, 89, 23, 97, 97, 29, 97, 101, 29, 103, 107, 29, 109, 113, 29, 127, 127, 31, 127, 127, 31, 127
Offset: 0

Author

M. F. Hasler, Apr 04 2008

Keywords

Comments

This can be considered as an analog of the Collatz (or 3n+1) map on the set of primes, see A138751 and A138754 for details.
Numbers 0,1,2 go immediately to the unique fixed point 2, all others end up in the cycle 7 -> 17 -> 11 -> 7, after a number of iterations given by A138753(A138757(n))-1 (= A138753(n)-2 if n is prime).

Examples

			a(7) = 17 since 7 = 1 (mod 3), thus A138750(7) = 2*7 = 14, nextprime(14) = 17.
a(11) = 7 since 11 = 2 (mod 3), thus A138750(11) = ceiling(11/2) = 6, nextprime(6) = 7.
		

Programs

  • Mathematica
    np1[n_]:=Module[{x=Ceiling[n/2]},If[PrimeQ[x],x,NextPrime[x]]]; np2[n_]:= Module[{x=2n},If[PrimeQ[x],x,NextPrime[x]]]; Table[If[Mod[n,3]==2, np1[n], np2[n]],{n,0,70}] (* Harvey P. Dale, Jul 10 2013 *)
  • PARI
    A138757(n)=nextprime(if(n%3==2,(n+1)\2,2*n))

Formula

a(n) = A007918(A138750(n)).
For p prime, a(p) = A138751(A000720(p))
Showing 1-3 of 3 results.