login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A138753 Number of iterations of A138754 before reaching a number for the second time, when starting with n. 9
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 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
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).)
LINKS
Paolo Xausa, Table of n, a(n) for n = 1..1459 (terms 1..500 from M. F. Hasler)
Georges Brougnard, Definition of GB-sequences.
FORMULA
a(n) = min { k>0 | A138754^k(n) = A138754^m(n) for some m>=0, m<k }.
If n is not in {1,4,5,7}, then a(n) = 1+a(A138754(n)).
EXAMPLE
a(1)=1 since after 1 step we find 1 again.
a(4)=3 since 4 -> 7 -> 5 -> 4 under A138754.
MATHEMATICA
A138754[n_]:=A138754[n]=With[{p=Prime[n]}, PrimePi[NextPrime[If[Mod[p, 3]==2, p/2, 2p]]]];
A138753[n_]:=Length[NestWhileList[A138754, n, UnsameQ, {1, 4}]]-1;
Array[A138753, 100] (* Paolo Xausa, Jul 28 2023*)
PROG
(PARI) A138753(n, c=0, t=[1, 1, 1]) = { until( t[c++%3+1]==n=A138754(n), t[c%3+1]=n); c}
CROSSREFS
Cf. A124123, A006577, A171938, A138756 (record values/indices).
Sequence in context: A057113 A060134 A200351 * A179410 A272874 A008962
KEYWORD
nonn
AUTHOR
M. F. Hasler, Apr 01 2008
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 18 18:49 EDT 2024. Contains 371781 sequences. (Running on oeis4.)