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.

A248573 An irregular triangle giving the Collatz-Terras tree.

Original entry on oeis.org

1, 2, 4, 8, 5, 16, 3, 10, 32, 6, 20, 21, 64, 12, 13, 40, 42, 128, 24, 26, 80, 84, 85, 256, 48, 17, 52, 53, 160, 168, 170, 512, 96, 11, 34, 104, 35, 106, 320, 336, 113, 340, 341, 1024, 192, 7, 22, 68, 69, 208, 23, 70, 212, 213, 640, 672, 75, 226, 680, 227, 682, 2048
Offset: 0

Views

Author

Nico Brown, Oct 08 2014

Keywords

Comments

From Wolfdieter Lang, Oct 31 2014: (Start)
(old name corrected)
Irregular triangle CT(l, m) such that the first three rows l = 0, 1 and 2 are 1, 2, 4, respectively, and for l >= 3 the row entries CT(l, m) are obtained from replacing the numbers of row l-1 by (2*x-1)/3, 2*x if they are 2 (mod 3) and by 2*x otherwise.
The modified Collatz (or Collatz-Terras) map sends a positive number x to x/2 if it is even and to (3*x+1)/2 if it is odd (see A060322). The present tree (without the complete tree originating at CT(2,1) = 1) can be considered as an incomplete binary tree, with nodes (vertices) of out-degree 2 if they are 2 (mod 3) and out-degree 1 otherwise. In the example below, the edges (branches) could be labeled L (left) or V (vertical).
The row length sequence is A060322(l+1), l>=0. (End)
The Collatz conjecture is true if and only if all odd numbers appear in this sequence.
This sequence is similar to A127824.

Examples

			The irregular triangle CT(l,m) begins:
l\m   1   2  3   4   5   6   7   8   9  10  11   12  13   14   15  16  17   18   19  20  21   22   23   24 ...
0:    1
1:    2
2:    4  here the 1, which would generate the complete tree again, is omitted
3:    8
4:    5  16
5:    3  10 32
6:    6  20 21  64
7:   12  13 40  42 128
8:   24  26 80  84  85 256
9:   48  17 52  53 160 168 170 512
10:  96  11 34 104  35 106 320 336 113 340 341 1024
11: 192   7 22  68  69 208  23  70 212 213 640  672  75  226  680 227 682 2048
12: 384  14 44  45 136 138 416  15  46 140 141  424 426 1280 1344 150 452  453 1360 151 454 1364 1365 4096
... reformatted, and extended - _Wolfdieter Lang_, Oct 31 2014
--------------------------------------------------------------------------------------------------------------
From _Wolfdieter Lang_, Oct 31 2014: (Start)
The Collatz-Terras tree starting with 4 looks like (numbers x == 2 (mod 3) are marked with a left bar, and the left branch ends then in (2*x-1)/3 and the vertical one in 2*x)
l=2:                                                                                        4
l=3:                                                                                       |8
l=4:                                                    |5                                 16
l=5:    3                                               10                                |32
l=6:    6                                              |20   21                            64
l=7:   12                     13                        40   42                          |128
l=8:   24                    |26                       |80   84            85             256
l=9:   48           |17       52              |53      160  168          |170            |512
l=10:  96     |11    34     |104        |35   106      320  336     |113  340      |341  1024
l=11: 192   7  22   |68  69  208   23|   70   212  213 640  672  75  226  680  227  682  2048
...
E.g., x = 7 = CT(11, 2) leads back to 4 via 7, 11, 17, 26, 13, 20, 10, 5, 8, 4, and from there back to 2, 1.
(End)
--------------------------------------------------------------------------------------------------------------
		

Crossrefs

Programs

  • Mathematica
    Join[{{1}, {2}}, NestList[Flatten[Map[If[Mod[#, 3] == 2, {(2*#-1)/3, 2*#}, 2*#]&, #]]&, {4}, 10]] (* Paolo Xausa, Jan 25 2024 *)
  • PARI
    rows(N) = my(r=List(),x); for(i=0, min(2, N), listput(r, x=[2^i])); for(n=3, N, my(w=List()); for(i=1, #x, my(q=2*x[i]); if(1==q%3, listput(w, (q-1)/3)); listput(w, q)); listput(r, x=Vec(w))); Vec(r); \\ Ruud H.G. van Tol, Jan 25 2024

Extensions

Edited. New name (old corrected name as comment). - Wolfdieter Lang, Oct 31 2014

A131450 a(n) is the number of integers x that can be written x = (2^c(1) - 2^c(2) - 3*2^c(3) - 3^2*2^c(4) - ... - 3^(m-2)*2^c(m) - 3^(m-1)) / 3^m for integers c(1), c(2), ..., c(m) such that n = c(1) > c(2) > ... > c(m) > 0 and c(1) - c(2) != 2 if m >= 2.

Original entry on oeis.org

0, 1, 0, 1, 1, 1, 1, 1, 2, 4, 6, 6, 7, 8, 11, 18, 23, 29, 39, 52, 71, 99, 124, 160, 220, 302, 403, 532, 707, 936, 1249, 1668, 2220, 2976, 3966, 5278, 7028, 9386, 12531, 16696, 22246, 29622, 39540, 52768, 70395, 93795, 124977, 166619, 222222, 296358, 395213
Offset: 1

Views

Author

Perry Dobbie, Jul 11 2007, Jul 12 2007, Jul 13 2007, Jul 17 2007, Jul 22 2007, Oct 15 2008

Keywords

Comments

For m = 1, the expression for x becomes x = (2^c(1) - 1) / 3.
Also the number of odd x with stopping time n for the Collatz or 3x+1 problem where x->x/2 if x is even, x->(3x+1)/2 if x is odd (see A060322), except that 1 is counted as having stopping time 2 instead of 0.
Equivalently, a(n) is the number of x == 2 (mod 3) with stopping time n-1.
The number of possible c(1),...,c(m) is 2^(n-1) - 2^(n-3); most do not yield integer x.
n-c(m), n-c(m-1), ..., n-c(2) are the stopping times of the odd integers in the Collatz trajectory of x.
For n > 4, a(n) = a(n-2) + a(n-2):(x is 1 mod 6) + a(n-1):(x is 5 mod 6). [I.e., for n > 4, a(n) = a(n-2) + (number of values of x counted in a(n-2) such that x == 1 (mod 6)) + (number of values of x counted in a(n-1) such that x == 5 (mod 6)). - Jon E. Schoenfield, Mar 14 2022]
It is conjectured that lim_{n->oo} a(n)/a(n-1) = 4/3.
With a(2) = 0 this is the first difference sequence of A060322, the row length sequence of A248573 (Collatz-Terras tree). - Wolfdieter Lang, May 04 2015
From Jon E. Schoenfield, Mar 15 2022: (Start)
For n > 4, the set of integers counted in a(n) is the union of three disjoint sets:
(1) the set of integers 4*x+1 obtained using all integers x counted by a(n-2),
(2) the set of integers (4*x-1)/3 obtained using only those integers x counted by a(n-2) that satisfy x == 1 (mod 6), and
(3) the set of integers (2*x-1)/3 obtained using only those integers x counted by a(n-1) that satisfy x == 5 (mod 6). (See Example.) (End)

Examples

			For n=3, the only valid c are:
  c = (3,2,1): (2^3 - 2^2 - 3^1*2^1 - 3^2) / 3^3 = -11/27,
  c = (3,2):   (2^3 - 2^2 - 3^1) / 3^2 = 1/9,
  c = (3):     (2^3 - 2^0) / 3 = 7/3,
  and none are integers so a(3) = 0.
a(9)=2:
  c = (9,5):   (2^9 - 2^5 - 3) / 3 = 53,
  c = (9,5,2): (2^9 - 2^5 - 3*2^2 - 9) / 27 = 17,
  and no other valid c give integer x.
From _Jon E. Schoenfield_, Mar 15 2022: (Start)
The a(12)=6 integers x are { 15, 45, 141, 151, 453, 1365 }, of which only one (151) satisfies x == 1 (mod 6);
the a(13)=7 integers x are { 9, 29, 93, 277, 301, 853, 909 }, of which only one (29) satisfies x == 5 (mod 6);
thus, at n=14, the set of a(14)=8 integers is the union of the three sets
  { 4*15+1 = 61, 4*45+1 = 181, 4*141+1 = 565, 4*151+1 = 605, 4*453+1 = 1813, 4*1365+1 = 5461 },
  { (4*151-1)/3 = 201 }, and
  { (2*29-1)/3 = 19 }. (End)
		

Crossrefs

Programs

  • Magma
    a:=[0,1,0,1]; Y:=[]; X:=[5]; for n in [5..51] do Z:=Y; Y:=X; X:=[]; for x in Z do X[#X+1]:=4*x+1; end for; for x in Z do if x mod 6 eq 1 then X[#X+1]:=(4*x-1) div 3; end if; end for; for x in Y do if x mod 6 eq 5 then X[#X+1]:=(2*x-1) div 3; end if; end for; X:=Sort(X); a[n]:=#X; end for; a; // Jon E. Schoenfield, Mar 15 2022

Extensions

Edited by David Applegate, Oct 16 2008
a(51) from Jon E. Schoenfield, Mar 15 2022

A324245 The modified Collatz map considered by Vaillant and Delarue.

Original entry on oeis.org

0, 2, 0, 5, 3, 8, 1, 11, 6, 14, 2, 17, 9, 20, 3, 23, 12, 26, 4, 29, 15, 32, 5, 35, 18, 38, 6, 41, 21, 44, 7, 47, 24, 50, 8, 53, 27, 56, 9, 59, 30, 62, 10, 65, 33, 68, 11, 71, 36, 74, 12, 77, 39, 80, 13, 83, 42, 86, 14, 89, 45, 92, 15, 95, 48, 98, 16, 101, 51, 104, 17, 107, 54, 110, 18, 113, 57, 116, 19, 119, 60
Offset: 0

Views

Author

Nicolas Vaillant, Philippe Delarue, Wolfdieter Lang, May 09 2019

Keywords

Comments

This is a modified Collatz-Terras map (A060322), called in the Vaillant and Delarue link f.
The Collatz conjecture: iterations of the map f = a: N_0 -> N_0 with n -> a(n) lead always to 0.
The minimal number k with a^{[k]}(n) = 0 is given by A324037(n).
The tree CfTree, related to this map, giving the branches which lead to 0 for each vertex label of level n >= 0 is given in A324246.

Crossrefs

Programs

  • Mathematica
    a[n_]:=If[OddQ@n,(3n+1)/2,If[Mod[n,4]==0,3n/4,(n-2)/4]];Array[a,51,0] (* Giorgos Kalogeropoulos, Dec 08 2021 *)
  • PARI
    A324245(n) = if(n%2, (1+3*n)/2, if(!(n%4), 3*(n/4), (n-2)/4)); \\ (After Mathematica-code) - Antti Karttunen, Dec 09 2021

Formula

a(n) = (3*n+1)/2 if n is odd, 3*n/4 if n == 0 (mod 4), and (n-2)/4 if n == 2 (mod 4).
a(n) = A349414(n) + n. - Ruud H.G. van Tol, Dec 08 2021
G.f.: x*(2 + 5*x^2 + 3*x^3 + 4*x^4 + x^5 + x^6)/(1 - x^4)^2. - Stefano Spezia, Dec 08 2021

Extensions

More terms from Antti Karttunen, Dec 09 2021
Showing 1-3 of 3 results.