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.

A006370 The Collatz or 3x+1 map: a(n) = n/2 if n is even, 3n + 1 if n is odd.

Original entry on oeis.org

0, 4, 1, 10, 2, 16, 3, 22, 4, 28, 5, 34, 6, 40, 7, 46, 8, 52, 9, 58, 10, 64, 11, 70, 12, 76, 13, 82, 14, 88, 15, 94, 16, 100, 17, 106, 18, 112, 19, 118, 20, 124, 21, 130, 22, 136, 23, 142, 24, 148, 25, 154, 26, 160, 27, 166, 28, 172, 29, 178, 30, 184, 31, 190, 32, 196, 33
Offset: 0

Views

Author

Keywords

Comments

The 3x+1 or Collatz problem is as follows: start with any number n. If n is even, divide it by 2, otherwise multiply it by 3 and add 1. Do we always reach 1? This is an unsolved problem. It is conjectured that the answer is yes.
The Krasikov-Lagarias paper shows that at least N^0.84 of the positive numbers < N fall into the 4-2-1 cycle of the 3x+1 problem. This is far short of what we think is true, that all positive numbers fall into this cycle, but it is a step. - Richard C. Schroeppel, May 01 2002
Also A001477 and A016957 interleaved. - Omar E. Pol, Jan 16 2014, updated Nov 07 2017
a(n) is the image of a(2*n) under the 3*x+1 map. - L. Edson Jeffery, Aug 17 2014
The positions of powers of 2 in this sequence are given in A160967. - Federico Provvedi, Oct 06 2021
If displayed as a rectangular array with six columns, the columns are A008585, A350521, A016777, A082286, A016789, A350522 (see example). - Omar E. Pol, Jan 03 2022

Examples

			G.f. = 4*x + x^2 + 10*x^3 + 2*x^4 + 16*x^5 + 3*x^6 + 22*x^7 + 4*x^8 + 28*x^9 + ...
From _Omar E. Pol_, Jan 03 2022: (Start)
Written as a rectangular array with six columns read by rows the sequence begins:
   0,   4,  1,  10,  2,  16;
   3,  22,  4,  28,  5,  34;
   6,  40,  7,  46,  8,  52;
   9,  58, 10,  64, 11,  70;
  12,  76, 13,  82, 14,  88;
  15,  94, 16, 100, 17, 106;
  18, 112, 19, 118, 20, 124;
  21, 130, 22, 136, 23, 142;
  24, 148, 25, 154, 26, 160;
  27, 166, 28, 172, 29, 178;
  30, 184, 31, 190, 32, 196;
...
(End)
		

References

  • R. K. Guy, Unsolved Problems in Number Theory, E16.
  • J. C. Lagarias, ed., The Ultimate Challenge: The 3x+1 Problem, Amer. Math. Soc., 2010.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

A006577 gives number of steps to reach 1.
Column k=1 of A347270, n >= 1.

Programs

  • Haskell
    a006370 n | m /= 0    = 3 * n + 1
              | otherwise = n' where (n',m) = divMod n 2
    -- Reinhard Zumkeller, Oct 07 2011
    
  • Magma
    [(1/4)*(7*n+2-(-1)^n*(5*n+2)): n in [1..70]]; // Vincenzo Librandi, Dec 20 2016
  • Maple
    f := n-> if n mod 2 = 0 then n/2 else 3*n+1; fi;
    A006370:=(4+z+2*z**2)/(z-1)**2/(1+z)**2; # Simon Plouffe in his 1992 dissertation; uses offset 0
  • Mathematica
    f[n_]:=If[EvenQ[n],n/2,3n+1];Table[f[n],{n,50}] (* Geoffrey Critzer, Jun 29 2013 *)
    LinearRecurrence[{0,2,0,-1},{4,1,10,2},70] (* Harvey P. Dale, Jul 19 2016 *)
  • PARI
    for(n=1,100,print1((1/4)*(7*n+2-(-1)^n*(5*n+2)),","))
    
  • PARI
    A006370(n)=if(n%2,3*n+1,n/2) \\ Michael B. Porter, May 29 2010
    
  • Python
    def A006370(n):
        q, r = divmod(n, 2)
        return 3*n+1 if r else q # Chai Wah Wu, Jan 04 2015
    

Formula

G.f.: (4*x+x^2+2*x^3) / (1-x^2)^2.
a(n) = (1/4)*(7*n+2-(-1)^n*(5*n+2)). - Benoit Cloitre, May 12 2002
a(n) = ((n mod 2)*2 + 1)*n/(2 - (n mod 2)) + (n mod 2). - Reinhard Zumkeller, Sep 12 2002
a(n) = A014682(n+1) * A000034(n). - R. J. Mathar, Mar 09 2009
a(n) = a(a(2*n)) = -A001281(-n) for all n in Z. - Michael Somos, Nov 10 2016
E.g.f.: (2 + x)*sinh(x)/2 + 3*x*cosh(x). - Ilya Gutkovskiy, Dec 20 2016
From Federico Provvedi, Aug 17 2021: (Start)
Dirichlet g.f.: (1-2^(-s))*zeta(s) + (3-5*2^(-s))*zeta(s-1).
a(n) = ( a(n+2k) + a(n-2k) ) / 2, for every integer k. (End)
a(n) + a(n+1) = A047374(n+1). - Leo Ortega, Aug 22 2025

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Apr 27 2001
Zero prepended and new Name from N. J. A. Sloane at the suggestion of M. F. Hasler, Nov 06 2017

A016945 a(n) = 6*n+3.

Original entry on oeis.org

3, 9, 15, 21, 27, 33, 39, 45, 51, 57, 63, 69, 75, 81, 87, 93, 99, 105, 111, 117, 123, 129, 135, 141, 147, 153, 159, 165, 171, 177, 183, 189, 195, 201, 207, 213, 219, 225, 231, 237, 243, 249, 255, 261, 267, 273, 279, 285, 291, 297, 303, 309, 315, 321, 327
Offset: 0

Views

Author

Keywords

Comments

Apart from initial term(s), dimension of the space of weight 2n cuspidal newforms for Gamma_0(37).
Continued fraction expansion of tanh(1/3).
If a 2-set Y and a 3-set Z are disjoint subsets of an n-set X then a(n-4) is the number of 3-subsets of X intersecting both Y and Z. - Milan Janjic, Sep 08 2007
Leaves of the Odd Collatz-Tree: a(n) has no odd predecessors in all '3x+1' trajectories where it occurs: A139391(2*k+1) <> a(n) for all k; A082286(n)=A006370(a(n)). - Reinhard Zumkeller, Apr 17 2008
Let random variable X have a uniform distribution on the interval [0,c] where c is a positive constant. Then, for positive integer n, the coefficient of determination between X and X^n is (6n+3)/(n+2)^2, that is, A016945(n)/A000290(n+2). Note that the result is independent of c. For the derivation of this result, see the link in the Links section below. - Dennis P. Walsh, Aug 20 2013
Positions of 3 in A020639. - Zak Seidov, Apr 29 2015
a(n+2) gives the sum of 6 consecutive terms of A004442 starting with A004442(n). - Wesley Ivan Hurt, Apr 08 2016
Numbers k such that Fibonacci(k) mod 4 = 2. - Bruno Berselli, Oct 17 2017
Also numbers k such that t^k == -1 (mod 7), where t is a member of A047389. - Bruno Berselli, Dec 28 2017

Crossrefs

Third row of A092260.
Subsequence of A061641; complement of A047263; bisection of A047241.
Cf. A000225. - Loren Pearson, Jul 02 2009
Cf. A020639. - Zak Seidov, Apr 29 2015
Odd numbers in A355200.

Programs

Formula

a(n) = 3*(2*n + 1) = 3*A005408(n), odd multiples of 3.
A008615(a(n)) = n. - Reinhard Zumkeller, Feb 27 2008
A157176(a(n)) = A103333(n+1). - Reinhard Zumkeller, Feb 24 2009
a(n) = 12*n - a(n-1) for n>0, a(0)=3. - Vincenzo Librandi, Nov 20 2010
G.f.: 3*(1+x)/(1-x)^2. - Mario C. Enriquez, Dec 14 2016
E.g.f.: 3*(1 + 2*x)*exp(x). - G. C. Greubel, Sep 18 2019
Sum_{n>=0} (-1)^n/a(n) = Pi/12 (A019679). - Amiram Eldar, Dec 10 2021
From Amiram Eldar, Nov 22 2024: (Start)
Product_{n>=0} (1 - (-1)^n/a(n)) = sqrt(2)/2 (A010503).
Product_{n>=0} (1 + (-1)^n/a(n)) = sqrt(3/2) (A115754). (End)
a(n) = (n+2)^2 - (n-1)^2. - Alexander Yutkin, Mar 15 2025

A155151 Triangle T(n, k) = 4*n*k + 2*n + 2*k + 2, read by rows.

Original entry on oeis.org

10, 16, 26, 22, 36, 50, 28, 46, 64, 82, 34, 56, 78, 100, 122, 40, 66, 92, 118, 144, 170, 46, 76, 106, 136, 166, 196, 226, 52, 86, 120, 154, 188, 222, 256, 290, 58, 96, 134, 172, 210, 248, 286, 324, 362, 64, 106, 148, 190, 232, 274, 316, 358, 400, 442, 70, 116, 162
Offset: 1

Views

Author

Vincenzo Librandi, Jan 21 2009

Keywords

Comments

First column: A016957, second column: A017341, third column: 2*A017029, fourth column: A082286. - Vincenzo Librandi, Nov 21 2012
Conjecture: Let p = prime number. If 2^p belongs to the sequence, then 2^p-1 is not a Mersenne prime. - Vincenzo Librandi, Dec 12 2012
Conjecture is true because if T(n, k) = 2^p with p prime, then 2^p-1 = 4*n*k + 2*n + 2*k + 1 = (2*n+1)*(2*k+1) hence 2^p-1 is not prime. - Michel Marcus, May 31 2015
It appears that T(m,p) = 2^p for Lucasian primes (A002515) greater than 3. For instance: T(44, 11) = 2^11, T(89240, 23) = 2^23. - Michel Marcus, May 28 2015
For n > 1, ascending numbers along the diagonal are also terms of the even principal diagonal of a 2n X 2n spiral (A137928). - Avi Friedlich, May 21 2015

Examples

			Triangle begins
  10;
  16,  26;
  22,  36,  50;
  28,  46,  64,  82;
  34,  56,  78, 100, 122;
  40,  66,  92, 118, 144, 170;
  46,  76, 106, 136, 166, 196, 226;
  52,  86, 120, 154, 188, 222, 256, 290;
  58,  96, 134, 172, 210, 248, 286, 324, 362;
  64, 106, 148, 190, 232, 274, 316, 358, 400, 442;
		

Crossrefs

Programs

  • Magma
    [4*n*k + 2*n + 2*k + 2: k in [1..n], n in [1..11]]; // Vincenzo Librandi, Nov 21 2012
    
  • Maple
    seq(seq( 2*(2*n*k+n+k+1), k=1..n), n=1..15) # G. C. Greubel, Mar 21 2021
  • Mathematica
    T[n_,k_]:=4*n*k + 2*n + 2*k + 2; Table[T[n, k], {n, 11}, {k, n}]//Flatten (* Vincenzo Librandi, Nov 21 2012 *)
  • Sage
    flatten([[2*(2*n*k+n+k+1) for k in (1..n)] for n in (1..15)]) # G. C. Greubel, Mar 21 2021

Formula

T(n, k) = 2*A144650(n, k).
Sum_{k=1..n} T(n,k) = n*(2*n^2 + 5*n + 3) = n*A014105(n+2) =

Extensions

Edited by Robert Hochberg, Jun 21 2010
Showing 1-3 of 3 results.