|
Search: id:A078373
|
|
|
| A078373 |
|
n sets a record for the number of primes in {n, f(n), f(f(n)), ...., 1}, where f is the Collatz function defined by f(x) = x/2 if x is even; f(x) = 3x + 1 if x is odd. |
|
+0 1
|
|
| 2, 3, 7, 19, 27, 97, 171, 231, 487, 763, 1071, 4011, 6171, 10971, 17647, 47059, 99151
(list; graph; listen)
|
|
|
OFFSET
|
1,1
|
|
|
LINKS
|
J. C. Lagarias, The 3x+1 problem and its generalizations, Amer. Math. Monthly, 92 (1985), 3-23.
|
|
EXAMPLE
|
The sequence n, f(n), f(f(n)), ...., 1 for n = 7 is: 7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1, which has six prime terms, more prime terms than for any n < 7. Hence 7 sets a record, and so belongs to a(n).
|
|
MATHEMATICA
|
f[n_] := n/2 /; Mod[n, 2] == 0 f[n_] := 3 n + 1 /; Mod[n, 2] == 1 g[n_] := Module[{i, p}, i = n; p = 0; While[i > 1, If[PrimeQ[i], p = p + 1]; i = f[i]]; p]; high = 0; a = {}; For[j = 1, j <= 10^5, j++, k = g[j]; If[k > high, high = k; a = Append[a, j]]]; a
|
|
CROSSREFS
|
Sequence in context: A100388 A073641 A138111 this_sequence A038878 A040112 A074855
Adjacent sequences: A078370 A078371 A078372 this_sequence A078374 A078375 A078376
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
Joseph L. Pe (joseph_l_pe(AT)hotmail.com), Dec 24 2002
|
|
|
Search completed in 0.002 seconds
|