Displaying 1-10 of 29 results found.
Record number of steps to reach 1 in '3x+1' problem, corresponding to starting values in A006877.
(Formerly M4335)
+20
11
0, 1, 7, 8, 16, 19, 20, 23, 111, 112, 115, 118, 121, 124, 127, 130, 143, 144, 170, 178, 181, 182, 208, 216, 237, 261, 267, 275, 278, 281, 307, 310, 323, 339, 350, 353, 374, 382, 385, 442, 448, 469, 508, 524, 527, 530, 556, 559, 562, 583, 596, 612, 664, 685, 688, 691, 704
COMMENTS
Both the 3x+1 steps and the halving steps are counted.
REFERENCES
D. R. Hofstadter, Goedel, Escher, Bach: an Eternal Golden Braid, Random House, 1980, p. 400.
G. T. Leavens and M. Vermeulen, 3x+1 search problems, Computers and Mathematics with Applications, 24 (1992), 79-99.
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
G. T. Leavens and M. Vermeulen, 3x+1 search programs, Computers and Mathematics with Applications, 24 (1992), 79-99. (Annotated scanned copy)
MAPLE
f := proc(n) local a, L; L := 0; a := n; while a <> 1 do if a mod 2 = 0 then a := a/2; else a := 3*a+1; fi; L := L+1; od: RETURN(L); end;
MATHEMATICA
numberOfSteps[x0_] := Block[{x = x0, nos = 0}, While[x != 1, If[Mod[x, 2] == 0, x = x/2, x = 3*x+1]; nos++]; nos]; A006878 = numberOfSteps /@ A006877 (* Jean-François Alcover, Feb 22 2012 *)
DeleteDuplicates[Table[Length[NestWhileList[If[EvenQ[#], #/2, 3#+1]&, n, #>1&]], {n, 0, 10^6}], GreaterEqual]-1 (* The program generates the first 44 terms of the sequence, derived from all starting values from 1 up to and including 1 million. *) (* Harvey P. Dale, Nov 26 2022 *)
Record number of steps to reach 1 in '3x+1' problem, corresponding to starting values in A006877 (same as A006878 except here we start counting at 1 instead of 0).
+20
9
1, 2, 8, 9, 17, 20, 21, 24, 112, 113, 116, 119, 122, 125, 128, 131, 144, 145, 171, 179, 182, 183, 209, 217, 238, 262, 268, 276, 279, 282, 308, 311, 324, 340, 351, 354, 375, 383, 386, 443, 449, 470, 509, 525, 528, 531, 557, 560, 563, 584, 597, 613, 665, 686
COMMENTS
Both the 3x+1 steps and the halving steps are counted.
REFERENCES
R. E. Maeder, Programming in Mathematica, 3rd Edition, Addison-Wesley, pages 251-252.
EXTENSIONS
Corrected and extended by Lee Corbin (lcorbin(AT)tsoft.com)
More terms from Larry Reeves (larryr(AT)acm.org), Apr 27 2001
Squarefree semiprimes: Numbers that are the product of two distinct primes.
(Formerly M4082)
+10
478
6, 10, 14, 15, 21, 22, 26, 33, 34, 35, 38, 39, 46, 51, 55, 57, 58, 62, 65, 69, 74, 77, 82, 85, 86, 87, 91, 93, 94, 95, 106, 111, 115, 118, 119, 122, 123, 129, 133, 134, 141, 142, 143, 145, 146, 155, 158, 159, 161, 166, 177, 178, 183, 185, 187, 194, 201, 202, 203, 205
COMMENTS
Numbers k such that phi(k) + sigma(k) = 2*(k+1). - Benoit Cloitre, Mar 02 2002
Numbers k such that tau(k) = omega(k)^omega(k). - Benoit Cloitre, Sep 10 2002 [This comment is false. If k = 900 then tau(k) = omega(k)^omega(k) = 27 but 900 = (2*3*5)^2 is not the product of two distinct primes. - Peter Luschny, Jul 12 2023]
From the Goldston et al. reference's abstract: "lim inf [as n approaches infinity] [(a(n+1) - a(n))] <= 26. If an appropriate generalization of the Elliott-Halberstam Conjecture is true, then the above bound can be improved to 6." - Jonathan Vos Post, Jun 20 2005
The maximal number of consecutive integers in this sequence is 3 - there cannot be 4 consecutive integers because one of them would be divisible by 4 and therefore would not be product of distinct primes. There are several examples of 3 consecutive integers in this sequence. The first one is 33 = 3 * 11, 34 = 2 * 17, 35 = 5 * 7; (see A039833). - Matias Saucedo (solomatias(AT)yahoo.com.ar), Mar 15 2008
Are these the numbers k whose difference between the sum of proper divisors of k and the arithmetic derivative of k is equal to 1? - Omar E. Pol, Dec 19 2012
a(n) are the reduced denominators of p_2/p_1 + p_4/p_3, where p_1 != p_2, p_3 != p_4, p_1 != p_3, and the p's are primes. In other words, (p_2*p_3 + p_1*p_4) never shares a common factor with p_1*p_3. - Richard R. Forberg, Mar 04 2015
Conjecture: The sums of two elements of a(n) forms a set that includes all primes greater than or equal to 29 and all integers greater than or equal to 83 (and many below 83). - Richard R. Forberg, Mar 04 2015
REFERENCES
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
Zervos, Marie: Sur une classe de nombres composés. Actes du Congrès interbalkanique de mathématiciens 267-268 (1935)
LINKS
G. T. Leavens and M. Vermeulen, 3x+1 search programs, Computers and Mathematics with Applications, 24 (1992), 79-99. (Annotated scanned copy)
Eric Weisstein's World of Mathematics, Semiprime
FORMULA
Sum_{n >= 1} 1/a(n)^s = (1/2)*(P(s)^2 - P(2*s)), where P is Prime Zeta. - Enrique Pérez Herrero, Jun 24 2012
sopf(a(n)) = a(n) - phi(a(n)) + 1 = sigma(a(n)) - a(n) - 1. - Wesley Ivan Hurt, May 18 2013
d(a(n)) = 4. Omega(a(n)) = 2. omega(a(n)) = 2. mu(a(n)) = 1. - Wesley Ivan Hurt, Jun 28 2013
For k > 1: k is a term <=> A363923(k) = k. (End)
MAPLE
N:= 1001: # to get all terms < N
Primes:= select(isprime, [2, seq(2*k+1, k=1..floor(N/2))]):
{seq(seq(p*q, q=Primes[1..ListTools:-BinaryPlace(Primes, N/p)]), p=Primes)} minus {seq(p^2, p=Primes)};
isA006881 := proc(n)
if numtheory[bigomega](n) =2 and A001221(n) = 2 then
true ;
else
false ;
end if;
end proc:
A006881 := proc(n) if n = 1 then 6; else for a from procname(n-1)+1 do if isA006881(a) then return a; end if; end do: end if;
# Alternative:
with(NumberTheory): isA006881 := n -> is(NumberOfPrimeFactors(n, 'distinct') = 2 and NumberOfPrimeFactors(n) = 2):
MATHEMATICA
mx = 205; Sort@ Flatten@ Table[ Prime[n]*Prime[m], {n, Log[2, mx/3]}, {m, n + 1, PrimePi[ mx/Prime[n]]}] (* Robert G. Wilson v, Dec 28 2005, modified Jul 23 2014 *)
sqFrSemiPrimeQ[n_] := Last@# & /@ FactorInteger@ n == {1, 1}; Select[Range[210], sqFrSemiPrimeQ] (* Robert G. Wilson v, Feb 07 2012 *)
With[{upto=250}, Select[Sort[Times@@@Subsets[Prime[Range[upto/2]], {2}]], #<=upto&]] (* Harvey P. Dale, Apr 30 2018 *)
PROG
(PARI) for(n=1, 214, if(bigomega(n)==2&&omega(n)==2, print1(n, ", ")))
(PARI) for(n=1, 214, if(bigomega(n)==2&&issquarefree(n), print1(n, ", ")))
(PARI) list(lim)=my(v=List()); forprime(p=2, sqrt(lim), forprime(q=p+1, lim\p, listput(v, p*q))); vecsort(Vec(v)) \\ Charles R Greathouse IV, Jul 20 2011
(Haskell)
a006881 n = a006881_list !! (n-1)
a006881_list = filter chi [1..] where
chi n = p /= q && a010051 q == 1 where
p = a020639 n
q = n `div` p
(Sage)
R = []
for i in (6..n) :
d = prime_divisors(i)
if len(d) == 2 :
if d[0]*d[1] == i :
R.append(i)
return R
(Magma) [n: n in [1..210] | EulerPhi(n) + DivisorSigma(1, n) eq 2*(n+1)]; // Vincenzo Librandi, Sep 17 2015
(Python)
from sympy import factorint
def ok(n): f=factorint(n); return len(f) == 2 and sum(f[p] for p in f) == 2
(Python)
from math import isqrt
from sympy import primepi, primerange
def f(x): return int(n+x+(t:=primepi(s:=isqrt(x)))+(t*(t-1)>>1)-sum(primepi(x//k) for k in primerange(1, s+1)))
m, k = n, f(n)
while m != k:
m, k = k, f(k)
CROSSREFS
Cf. A030229, A051709, A001221 (omega(n)), A001222 (bigomega(n)), A001358 (semiprimes), A005117 (squarefree), A007304 (squarefree 3-almost primes), A213952, A039833, A016105 (subsequences), A237114 (subsequence, n != 2).
Double factorials n!!: a(n) = n*a(n-2) for n > 1, a(0) = a(1) = 1.
(Formerly M0876)
+10
258
1, 1, 2, 3, 8, 15, 48, 105, 384, 945, 3840, 10395, 46080, 135135, 645120, 2027025, 10321920, 34459425, 185794560, 654729075, 3715891200, 13749310575, 81749606400, 316234143225, 1961990553600, 7905853580625, 51011754393600, 213458046676875, 1428329123020800
COMMENTS
Product of pairs of successive terms gives factorials in increasing order. - Amarnath Murthy, Oct 17 2002
a(n) = number of down-up permutations on [n+1] for which the entries in the even positions are increasing. For example, a(3)=3 counts 2143, 3142, 4132. Also, a(n) = number of down-up permutations on [n+2] for which the entries in the odd positions are decreasing. For example, a(3)=3 counts 51423, 52413, 53412. - David Callan, Nov 29 2007
The double factorial of a positive integer n is the product of the positive integers <= n that have the same parity as n. - Peter Luschny, Jun 23 2011
For n even, a(n) is the number of ways to place n points on an n X n grid with pairwise distinct abscissa, pairwise distinct ordinate, and 180-degree rotational symmetry. For n odd, the number of ways is a(n-1) because the center point can be considered "fixed". For 90-degree rotational symmetry cf. A001813, for mirror symmetry see A000085, A135401, and A297708. - Manfred Scheucher, Dec 29 2017
Could be extended to include a(-1) = 1. But a(-2) is not defined, otherwise we would have 1 = a(0) = 0*a(-2). - Jianing Song, Oct 23 2019
REFERENCES
Putnam Contest, 4 Dec. 2004, Problem A3.
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
Gary T. Leavens and Mike Vermeulen, 3x+1 search programs, Computers and Mathematics with Applications, 24 (1992), 79-99. (Annotated scanned copy)
FORMULA
a(n) = Product_{i=0..floor((n-1)/2)} (n - 2*i).
E.g.f.: 1+exp(x^2/2)*x*(1+sqrt(Pi/2)*erf(x/sqrt(2))). - Wouter Meeussen, Mar 08 2001
Satisfies a(n+3)*a(n) - a(n+1)*a(n+2) = (n+1)!. [Putnam Contest]
a(n) * a(n+3) = a(n+1) * (a(n+2) + a(n)). a(n) * a(n+1) = (n+1)!. - Michael Somos, Dec 29 2012
a(n) ~ c * n^((n+1)/2) / exp(n/2), where c = sqrt(Pi) if n is even, and c = sqrt(2) if n is odd. - Vaclav Kotesovec, Nov 08 2014
a(2*n) = 2^n*a(n)*a(n-1). a(2^n) = 2^(2^n - 1) * 1!! * 3!! * 7!! * ... * (2^(n-1) - 1)!!. - Peter Bala, Nov 01 2016
a(n) = 2^h*(2/Pi)^(sin(Pi*h)^2/2)*Gamma(h+1) where h = n/2. This analytical extension supports the view that a(-1) = 1 is a meaningful numerical extension. With this definition (-1/2)!! = Gamma(3/4)/Pi^(1/4). - Peter Luschny, Oct 24 2019
a(n) ~ (n+1/6)*sqrt((2/e)*(n/e)^(n-1)*(Pi/2)^(cos(n*Pi/2)^2)). - Peter Luschny, Oct 25 2019
EXAMPLE
G.f. = 1 + x + 2*x^2 + 3*x^3 + 8*x^4 + 15*x^5 + 48*x^6 + 105*x^7 + 384*x^8 + ...
MAPLE
A006882 := proc(n) option remember; if n <= 1 then 1 else n* A006882(n-2); fi; end;
MATHEMATICA
Array[ #!!&, 40, 0 ]
multiFactorial[n_, k_] := If[n < 1, 1, If[n < k + 1, n, n*multiFactorial[n - k, k]]]; Array[ multiFactorial[#, 2] &, 27, 0] (* Robert G. Wilson v, Apr 23 2011 *)
PROG
(PARI) {a(n) = prod(i=0, (n-1)\2, n - 2*i )} \\ Improved by M. F. Hasler, Nov 30 2013
(PARI) {a(n) = if( n<2, n>=0, n * a(n-2))}; /* Michael Somos, Apr 06 2003 */
(PARI) {a(n) = if( n<0, 0, my(E); E = exp(x^2 / 2 + x * O(x^n)); n! * polcoeff( 1 + E * x * (1 + intformal(1 / E)), n))}; /* Michael Somos, Apr 06 2003 */
(Magma) DoubleFactorial:=func< n | &*[n..2 by -2] >; [ DoubleFactorial(n): n in [0..28] ]; // Klaus Brockhaus, Jan 23 2011
(Haskell)
a006882 n = a006882_list !! n
a006882_list = 1 : 1 : zipWith (*) [2..] a006882_list
(Python)
from sympy import factorial2
CROSSREFS
Bisections are A000165 and A001147. These two entries have more information.
KEYWORD
nonn,easy,core,nice,changed
Square array T(n,k) in which row n lists the 3x+1 sequence starting at n, read by antidiagonals upwards, with n >= 1 and k >= 0.
+10
51
1, 2, 4, 3, 1, 2, 4, 10, 4, 1, 5, 2, 5, 2, 4, 6, 16, 1, 16, 1, 2, 7, 3, 8, 4, 8, 4, 1, 8, 22, 10, 4, 2, 4, 2, 4, 9, 4, 11, 5, 2, 1, 2, 1, 2, 10, 28, 2, 34, 16, 1, 4, 1, 4, 1, 11, 5, 14, 1, 17, 8, 4, 2, 4, 2, 4, 12, 34, 16, 7, 4, 52, 4, 2, 1, 2, 1, 2, 13, 6, 17, 8, 22
COMMENTS
This array gives all 3x+1 sequences.
The 3x+1 or Collatz problem is described in A006370.
Column k gives the image of n at the k-th step.
For a piping diagram of the 3x+1 problem see A235800.
EXAMPLE
The corner of the square array begins:
1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, ...
2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, ...
3,10, 5,16, 8, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, ...
4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, ...
5,16, 8, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, ...
6, 3,10, 5,16, 8, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, ...
7,22,11,34,17,52,26,13,40,20,10, 5,16, 8, 4, 2, 1, 4, 2, 1, ...
8, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, ...
9,28,14, 7,22,11,34,17,52,26,13,40,20,10, 5,16, 8, 4, 2, 1, ...
10, 5,16, 8, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, ...
11,34,17,52,26,13,40,20,10, 5,16, 8, 4, 2, 1, 4, 2, 1, 4, 2, ...
12, 6, 3,10, 5,16, 8, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, ...
13,40,20,10, 5,16, 8, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, 2, 1, 4, ...
14, 7,22,11,34,17,52,26,13,40,20,10, 5,16, 8, 4, 2, 1, 4, 2, ...
...
MAPLE
T:= proc(n, k) option remember; `if`(k=0, n, (j->
`if`(j::even, j/2, 3*j+1))(T(n, k-1)))
end:
MATHEMATICA
T[n_, k_] := T[n, k] = If[k == 0, n, Function[j,
If[EvenQ[j], j/2, 3*j + 1]][T[n, k - 1]]];
CROSSREFS
Parity of this sequence is A347283.
Largest value in row n gives A056959.
Number of nonpowers of 2 in row n gives A208981.
Some rows n are: A153727 (n=1), A033478 (n=3), A033479 (n=9), A033480 (n=15), A033481 (n=21), A008884 (n=27), A008880 (n=33), A008878 (n=39), A008883 (n=51), A008877 (n=57), A008874 (n=63), A258056 (n=75), A258098 (n=79), A008876 (n=81), A008879 (n=87), A008875 (n=95), A008873 (n=97), A008882 (n=99), A245671 (n=1729).
Cf. A006877, A014682, A057716, A070165, A078719, A135282, A235795, A235800, A235801, A347265, A347267, A347268, A347269, A347271, A347519.
In the '3x+1' problem, these values for the starting value set new records for highest point of trajectory before reaching 1.
(Formerly M0843)
+10
25
1, 2, 3, 7, 15, 27, 255, 447, 639, 703, 1819, 4255, 4591, 9663, 20895, 26623, 31911, 60975, 77671, 113383, 138367, 159487, 270271, 665215, 704511, 1042431, 1212415, 1441407, 1875711, 1988859, 2643183, 2684647, 3041127, 3873535, 4637979, 5656191
COMMENTS
Both the 3x+1 steps and the halving steps are counted.
REFERENCES
R. B. Banks, Slicing Pizzas, Racing Turtles and Further Adventures in Applied Mathematics, Princeton Univ. Press, 1999. See p. 96.
D. R. Hofstadter, Goedel, Escher, Bach: an Eternal Golden Braid, Random House, 1980, p. 400.
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
G. T. Leavens and M. Vermeulen, 3x+1 search problems, Computers and Mathematics with Applications, 24 (1992), 79-99.
G. T. Leavens and M. Vermeulen, 3x+1 search programs, Computers and Mathematics with Applications, 24 (1992), 79-99. (Annotated scanned copy)
Tomás Oliveira e Silva, Tables (gives many more terms).
MATHEMATICA
mcoll[n_]:=Max@@NestWhileList[If[EvenQ[#], #/2, 3#+1]&, n, #>1&]; t={1, max=2}; Do[If[(y=mcoll[n])>max, max=y; AppendTo[t, n]], {n, 3, 705000, 4}]; t (* Jayanta Basu, May 28 2013 *)
DeleteDuplicates[Parallelize[Table[{n, Max[NestWhileList[If[EvenQ[#], #/2, 3#+1]&, n, #>1&]]}, {n, 57*10^5}]], GreaterEqual[#1[[2]], #2[[2]]]&][[;; , 1]] (* Harvey P. Dale, Apr 23 2023 *)
PROG
(Haskell)
a006884 n = a006884_list !! (n-1)
a006884_list = f 1 0 a025586_list where
f i r (x:xs) = if x > r then i : f (i + 1) x xs else f (i + 1) r xs
(PARI) A025586(n)=my(r=n); while(n>2, if(n%2, n=3*n+1; if(n>r, r=n)); n>>=1); r
CROSSREFS
A060409 gives associated "dropping times", A060410 the maximal values and A060411 the steps at which the maxima occur.
Record highest point of trajectory before reaching 1 in '3x+1' problem, corresponding to starting values in A006884.
(Formerly M2086)
+10
14
1, 2, 16, 52, 160, 9232, 13120, 39364, 41524, 250504, 1276936, 6810136, 8153620, 27114424, 50143264, 106358020, 121012864, 593279152, 1570824736, 2482111348, 2798323360, 17202377752, 24648077896, 52483285312, 56991483520, 90239155648, 139646736808
COMMENTS
Both the 3x+1 steps and the halving steps are counted.
In an email of Aug 06 2023, Guy Chouraqui observes that the digital root of a(n) appears to be 7 for all n > 2. - N. J. A. Sloane, Aug 11 2023
REFERENCES
R. B. Banks, Slicing Pizzas, Racing Turtles and Further Adventures in Applied Mathematics, Princeton Univ. Press, 1999. See p. 96.
D. R. Hofstadter, Goedel, Escher, Bach: an Eternal Golden Braid, Random House, 1980, p. 400.
G. T. Leavens and M. Vermeulen, 3x+1 search problems, Computers and Mathematics with Applications, 24 (1992), 79-99.
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
G. T. Leavens and M. Vermeulen, 3x+1 search programs, Computers and Mathematics with Applications, 24 (1992), 79-99. (Annotated scanned copy)
MATHEMATICA
mcoll[n_]:=Max@@NestWhileList[If[EvenQ[#], #/2, 3#+1]&, n, #>=n&]; t={1, max=2}; Do[If[(y=mcoll[n])>max, AppendTo[t, max=y]], {n, 3, 10^6, 4}]; t (* Jayanta Basu, May 28 2013 *)
a(1) = 1; for n>1, a(n) is the smallest number not already present which is entailed by the rules (i) k present => 3*k+1 present; (ii) 2*k present => k present.
+10
6
1, 4, 2, 7, 13, 22, 11, 34, 17, 40, 20, 10, 5, 16, 8, 25, 31, 49, 52, 26, 61, 67, 76, 38, 19, 58, 29, 79, 88, 44, 94, 47, 103, 115, 121, 133, 142, 71, 148, 74, 37, 112, 56, 28, 14, 43, 85, 130, 65, 157, 169, 175, 184, 92, 46, 23, 70, 35, 106, 53, 139, 160, 80
COMMENTS
An analog of A109732 such that the statement 'the sequence is a permutation of the positive integers not divisible by 3' is equivalent to the (3*n+1)-conjecture for numbers not divisible by 3.
On Aug 29 2015, Max Alekseyev noted that, while the (3*n+1)-conjecture indeed implies that the sequence is a permutation of the positive integers not divisible by 3, the opposite statement is an open question. The author cannot yet prove this, so his previous comment is only a conjecture.
In connection with this, consider the following conjecture which could be called the (n-1)/3-conjecture. Let n be any number not divisible by 3. If n==1 (mod 3) and (n-1)/3 is not divisible by 3, then set n_1 = (n-1)/3. Otherwise set n_1 = 2*n. Conjecture. There exists an iteration n_m = 1. Does the (n-1)/3-conjecture imply the (3*n+1)-conjecture?
Example: 19->38->76->25->8->16->5->10->20->40->13->4->1.
In the '3x+1' problem, these values for the starting value set new records for number of steps to reach 1.
+10
5
1, 3, 7, 9, 25, 27, 73, 97, 129, 171, 231, 313, 327, 703, 871, 1161, 2463, 2919, 3711, 6171, 10971, 13255, 17647, 23529, 26623, 34239, 35655, 52527, 77031, 106239, 142587, 156159, 216367, 230631, 410011, 511935, 626331, 837799, 1117065, 1501353, 1723519, 2298025, 3064033
COMMENTS
Only the 3x+1 steps, not the halving steps, are counted.
REFERENCES
D. R. Hofstadter, Goedel, Escher, Bach: an Eternal Golden Braid, Random House, 1980, p. 400.
G. T. Leavens and M. Vermeulen, 3x+1 search problems, Computers and Mathematics with Applications, 24 (1992), 79-99.
MATHEMATICA
f[ nn_ ] := Module[ {c, n}, c = 0; n = nn; While[ n != 1, If[ Mod[ n, 2 ] == 0, n /= 2, n = 3*n + 1; c++ ] ]; Return[ c ] ] maxx = -1; For[ n = 1, n <= 10^8, n++, Module[ {val}, val = f[ n ]; If[ val > maxx, maxx = val; Print[ n, " ", val ] ] ] ] (* Winston C. Yang (winston(AT)cs.wisc.edu), Aug 27 2000 *)
PROG
(Haskell)
a033958 n = a033958_list !! (n-1)
-- For definition of a033958_list: see A033959.
EXTENSIONS
Corrected with Mathematica code by Winston C. Yang (winston(AT)cs.wisc.edu), Aug 27 2000
Record number of steps to reach 1 in '3x+1' problem, corresponding to starting values in A033958.
+10
4
0, 2, 5, 6, 7, 41, 42, 43, 44, 45, 46, 47, 52, 62, 65, 66, 76, 79, 87, 96, 98, 101, 102, 103, 113, 114, 119, 125, 129, 130, 138, 141, 142, 164, 166, 174, 189, 195, 196, 197, 207, 208, 209, 217, 222, 228, 248, 256, 257, 258, 263, 278, 357, 358, 359, 362, 370
COMMENTS
Only the 3x+1 steps, not the halving steps, are counted.
REFERENCES
D. R. Hofstadter, Goedel, Escher, Bach: an Eternal Golden Braid, Random House, 1980, p. 400.
G. T. Leavens and M. Vermeulen, 3x+1 search problems, Computers and Mathematics with Applications, 24 (1992), 79-99.
MAPLE
A033959 := proc(n) local a, L; L := 0; a := n; while a <> 1 do if a mod 2 = 0 then a := a/2; else a := 3*a+1; L := L+1; fi; od: RETURN(L); end;
MATHEMATICA
f[ nn_ ] := Module[ {c, n}, c = 0; n = nn; While[ n != 1, If[ Mod[ n, 2 ] == 0, n /= 2, n = 3*n + 1; c++ ] ]; Return[ c ] ] maxx = -1; For[ n = 1, n <= 10^8, n++, Module[ {val}, val = f[ n ]; If[ val > maxx, maxx = val; Print[ n, " ", val ] ] ] ]
PROG
(Haskell)
a033959 n = a033959_list !! (n-1)
(a033959_list, a033958_list) = unzip $ (0, 1) : f 1 1 where
f i x | y > x = (y, 2 * i - 1) : f (i + 1) y
| otherwise = f (i + 1) x
where y = a075680 i
EXTENSIONS
More terms from Winston C. Yang (winston(AT)cs.wisc.edu), Aug 27 2000
More terms from Larry Reeves (larryr(AT)acm.org), Sep 27 2000
Search completed in 0.023 seconds
|