|
|
A293982
|
|
Length (= size) of the orbit of n under iterations of A293975: x -> x/2 if even, x + nextprime(x) if odd; or -1 if the orbit is infinite.
|
|
3
|
|
|
1, 5, 5, 5, 5, 8, 6, 13, 5, 11, 9, 9, 7, 10, 14, 8, 6, 14, 12, 14, 10, 12, 10, 13, 8, 19, 11, 17, 15, 11, 9, 17, 7, 17, 15, 15, 13, 15, 15, 13, 11, 15, 13, 18, 11, 16, 14, 22, 9, 16, 20, 14, 12, 18, 18, 16, 16, 14, 12, 12, 10, 10, 18, 22, 8, 20, 18, 20, 16, 18, 16, 16, 14
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
COMMENTS
|
The orbit of x under f is O(x; f) = { f^k(x); k = 0, 1, 2,... }.
It is conjectured that for f = A293975, the trajectory (f^k(x); k >= 0) ends in the cycle 1 -> 3 -> 8 -> 4 -> 2 -> 1 for any starting value x.
|
|
LINKS
|
|
|
EXAMPLE
|
a(0) = 1 = # { 0 }, since 0 -> 0 -> 0 ... under A293975.
a(1) = 5 = # { 1, 3, 8, 4, 2 }, since 1 -> (1 + 2 =) 3 -> (3 + 5 =) 8 -> 4 -> 2 -> 1 -> 3 etc... under A293975.
a(2) = 5 = # { 2, 1, 3, 8, 4 }, since 2 -> 1 -> 3 -> 8 -> 4 -> 2 -> 1 etc... under A293975.
a(5) = 8 = # { 5, 12, 6, 3, 8, 4, 2, 1 }, since 5 -> (5 + 7 =) 12 -> 6 -> 3 -> (3 + 5 =) 8 -> 4 -> 2 -> 1 -> 3 etc... under A293975.
|
|
MATHEMATICA
|
Table[Flatten[FindTransientRepeat[NestList[If[EvenQ[#], #/2, #+ NextPrime[ #]]&, n, 100], 3]]//Length, {n, 0, 80}] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jun 13 2018 *)
|
|
PROG
|
(PARI) A293982(n, S=[n])={while(#S<#S=setunion(S, [n=A293975(n)]), ); #S}
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|