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.

Previous Showing 21-30 of 32 results. Next

A254055 Square array: A(row,col) = A003602(A254051(row,col)), read by antidiagonals A(1,1), A(1,2), A(2,1), A(1,3), A(2,2), A(3,1), ...

Original entry on oeis.org

1, 2, 1, 1, 1, 3, 2, 6, 12, 4, 4, 9, 1, 9, 21, 5, 3, 13, 48, 102, 31, 3, 7, 30, 75, 36, 10, 183, 2, 15, 39, 6, 112, 426, 912, 274, 7, 18, 22, 58, 264, 669, 160, 684, 1641, 8, 10, 7, 129, 345, 198, 1003, 3828, 8202, 2461, 1, 6, 57, 156, 193, 517, 2370, 6015, 2871, 3076, 14763, 5, 24, 66, 85, 117, 1155, 3099, 889, 9022, 34446, 73812, 22144
Offset: 1

Views

Author

Antti Karttunen, Jan 27 2015

Keywords

Comments

Starting with an odd number x = A135765(row,col), the result after one combined Collatz step (3x+1)/2 is found in A254051(row+1,col), and after iterated [i.e., we divide all powers of 2 out] Collatz step: x_new <- A139391(x) = A000265(3x+1) the resulting odd number x_new is located A135764(1,A(row+1,col)).
What the resulting odd number will be, is given by A254101(row+1,col).

Examples

			The top left corner of the array:
    1,   2,    1,    2,    4,    5,     3,     2,    7,    8,     1, ...
    1,   1,    6,    9,    3,    7,    15,    18,   10,    6,    24, ...
    3,  12,    1,   13,   30,   39,    22,     7,   57,   66,    18, ...
    4,   9,   48,   75,    6,   58,   129,   156,   85,   25,   210, ...
   21, 102,   36,  112,  264,  345,   193,   117,  507,  588,    79, ...
   31,  10,  426,  669,  198,  517,  1155,  1398,  760,  441,  1884, ...
  183, 912,  160, 1003, 2370, 3099,  1732,    66, 4557, 5286,  1413, ...
  274, 684, 3828, 6015,  889, 4648, 10389, 12576, 6835,  496, 16950, ...
etc.
		

Crossrefs

A254101 Square array A(row,col) = A000265(A254051(row,col)).

Original entry on oeis.org

1, 3, 1, 1, 1, 5, 3, 11, 23, 7, 7, 17, 1, 17, 41, 9, 5, 25, 95, 203, 61, 5, 13, 59, 149, 71, 19, 365, 3, 29, 77, 11, 223, 851, 1823, 547, 13, 35, 43, 115, 527, 1337, 319, 1367, 3281, 15, 19, 13, 257, 689, 395, 2005, 7655, 16403, 4921, 1, 11, 113, 311, 385, 1033, 4739, 12029, 5741, 6151, 29525
Offset: 1

Views

Author

Antti Karttunen, Jan 28 2015

Keywords

Comments

Starting with an odd number x = A135765(row,col), the result after one combined Collatz step (3x+1)/2 is found in A254051(row+1,col), and after iterated [i.e., we divide all powers of 2 out] Collatz step: x_new <- A139391(x) = A000265(3x+1) the resulting odd number x_new is located at the first row of array A135764 as x_new = A135764(1,A254055(row+1,col)) and it is given here as A(row+1,col) = A000265(A254051(row+1,col)).
That number's column index in array A135765 is then given by A254102(row+1,col).

Examples

			The top left corner of the array:
    1,    3,    1,     3,    7,    9,     5,     3,    13,    15,     1, ...
    1,    1,   11,    17,    5,   13,    29,    35,    19,    11,    47, ...
    5,   23,    1,    25,   59,   77,    43,    13,   113,   131,    35, ...
    7,   17,   95,   149,   11,  115,   257,   311,   169,    49,   419, ...
   41,  203,   71,   223,  527,  689,   385,   233,  1013,  1175,   157, ...
   61,   19,  851,  1337,  395, 1033,  2309,  2795,  1519,   881,  3767, ...
  365, 1823,  319,  2005, 4739, 6197,  3463,   131,  9113, 10571,  2825, ...
  547, 1367, 7655, 12029, 1777, 9295, 20777, 25151, 13669,   991, 33899, ...
etc.
		

Crossrefs

Programs

Formula

A(row,col) = A000265(A254051(row,col)).
A(row,col) = (2*A254055(row,col))-1.
A(row,col) = A003961(A254055(row, A249745(col))).
A(row+1,col) = A139391(A135765(row,col)).
As compositions of one-dimensional sequences:
a(n) = A000265(A254051(n)).
a(n) = (2*A254055(n))-1.

A160967 Numbers of the form (4^k - 1)/3 or 2^k.

Original entry on oeis.org

0, 1, 2, 4, 5, 8, 16, 21, 32, 64, 85, 128, 256, 341, 512, 1024, 1365, 2048, 4096, 5461, 8192, 16384, 21845, 32768, 65536, 87381, 131072, 262144, 349525, 524288, 1048576, 1398101, 2097152, 4194304, 5592405, 8388608, 16777216, 22369621, 33554432
Offset: 0

Views

Author

Reinhard Zumkeller, May 31 2009

Keywords

Comments

A139391(a(n)) = 1 for n > 0.
Except for the first seven terms, the 3x + 1 trajectory for every number in this sequence includes 32. - Alonso del Arte, Jan 01 2015
For n>0, the Collatz-function starting with a(n) will terminate at 1. This is because all numbers of the form 2^k will terminate at 1, and ((4^k - 1)/3)*3 + 1 = 4^k = 2^2k. - Bob Selcoe, Apr 03 2015

Crossrefs

Union of A002450 and A000079.

Programs

  • Haskell
    a160967 n = a160967_list !! n
    a160967_list = m a000079_list a002450_list where
       m xs'@(x:xs) ys'@(y:ys) | x < y     = x : m xs ys'
                               | x == y    = x : m xs ys
                               | otherwise = y : m xs' ys
    -- Reinhard Zumkeller, Oct 03 2012
    
  • Magma
    I:=[0,1,2,4,5,8,16]; [n le 7 select I[n] else 5*Self(n-3)-4*Self(n-6): n in [1..40]]; // Vincenzo Librandi, Apr 03 2015
  • Maple
    0, seq(op([(4^j-1)/3, 4^j/2,4^j]),j=1..20); # Robert Israel, Jan 01 2015
  • Mathematica
    Union[2^Range[0, 25], (4^Range[0, 13] - 1)/3] (* Alonso del Arte, Jan 01 2015 *)
    Join[{0}, LinearRecurrence[{0, 0, 5, 0, 0, -4}, {1, 2, 4, 5, 8, 16}, 50]] (* Vincenzo Librandi, Apr 03 2015 *)

Formula

G.f.: x*(1 + 2*x + 4*x^2 - 2*x^4 - 4*x^5)/(1-5*x^3+4*x^6).
a(n+6) = 5*a(n+3) - 4*a(n) for n >= 1. - Robert Israel, Jan 01 2015

A352895 The maximum binary weight of those elements of the Collatz orbit of n that follow after the term n itself, when iterated down to 1, or -1 if 1 is never reached.

Original entry on oeis.org

1, 1, 2, 1, 1, 2, 3, 1, 3, 2, 3, 2, 2, 3, 4, 1, 3, 3, 4, 2, 1, 3, 4, 2, 4, 3, 8, 3, 3, 4, 8, 1, 4, 3, 4, 3, 3, 4, 5, 2, 8, 3, 3, 3, 3, 4, 8, 2, 3, 4, 4, 3, 2, 8, 8, 3, 4, 4, 4, 4, 4, 8, 8, 1, 3, 4, 4, 3, 3, 4, 8, 3, 8, 3, 4, 4, 4, 5, 6, 2, 5, 8, 8, 3, 1, 4, 4, 3, 4, 4, 8, 4, 4, 8, 8, 2, 8, 3, 4, 4, 4, 4, 8, 3, 6
Offset: 1

Views

Author

Antti Karttunen, Apr 08 2022

Keywords

Examples

			Iterates of A006370 (down to 1) when starting from n = 29 are 29 -> 88 -> 44 -> 22 -> 11 -> 34 -> 17 -> 52 -> 26 -> 13 -> 40 -> 20 -> 10 -> 5 -> 16 -> 4 -> 2 -> 1. Because A000120(2*n) = A000120(n), we can consider only the odd terms in the trajectory (iterates of A139391), and these are 29 -> 11 -> 17 -> 13 -> 5 -> 1. Their hamming weights are 4, 3, 2, 3, 2, 1. However, in this sequence (in contrast to A333860), we discard the binary weight of the starting value (which here is A000120(29)=4), and take the maximum of the rest, therefore a(29) = 3.
		

Crossrefs

Programs

  • PARI
    A139391(n) = my(x = if(n%2, 3*n+1, n/2)); x/2^valuation(x, 2); \\ From A139391
    A352895(n) = { my(mw=1); while(n>1, n = A139391(n); mw = max(hammingweight(n),mw)); (mw); };

Formula

a(n) = A333860(A006370(n)) = A333860(A014682(n)) = A333860(A139391(n)).

A254048 a(n) = A126760(A007494(n)).

Original entry on oeis.org

0, 1, 1, 2, 1, 1, 1, 4, 1, 3, 2, 6, 1, 2, 3, 8, 1, 5, 1, 10, 2, 1, 4, 12, 1, 7, 5, 14, 3, 4, 2, 16, 1, 9, 6, 18, 1, 3, 7, 20, 2, 11, 3, 22, 4, 6, 8, 24, 1, 13, 9, 26, 5, 2, 1, 28, 3, 15, 10, 30, 2, 8, 11, 32, 1, 17, 4, 34, 6, 5, 12, 36, 1, 19, 13, 38, 7, 10, 5, 40, 2, 21, 14, 42, 3, 1, 15, 44, 4, 23, 2, 46, 8, 12, 16, 48, 1, 25, 17, 50, 9, 7, 6, 52, 5, 27, 18, 54, 1, 14, 19, 56, 3, 29, 7, 58, 10, 4, 20, 60, 2
Offset: 0

Views

Author

Antti Karttunen, Jan 28 2015

Keywords

Crossrefs

Programs

Formula

a(n) = A126760(A007494(n)).
Other identities:
a(4n) = A126760(n).
a(4n+1) = A126760(3n+1).
a(4n+2) = A126760(2n+1) = A253887(n+1).
a(4n+3) = 2n+2.
For all n >= 1, a(n) = A126760(A139391(n)). [Conjecture. The proof should be easy. Holds at least up to n = 2^25 = 33554432.]

A350091 a(n) = a(floor(n/4)) for n == 2 (mod 4), otherwise n.

Original entry on oeis.org

0, 1, 0, 3, 4, 5, 1, 7, 8, 9, 0, 11, 12, 13, 3, 15, 16, 17, 4, 19, 20, 21, 5, 23, 24, 25, 1, 27, 28, 29, 7, 31, 32, 33, 8, 35, 36, 37, 9, 39, 40, 41, 0, 43, 44, 45, 11, 47, 48, 49, 12, 51, 52, 53, 13, 55, 56, 57, 3, 59, 60, 61, 15, 63, 64, 65, 16, 67, 68, 69, 17, 71, 72, 73
Offset: 0

Views

Author

Ruud H.G. van Tol, Dec 14 2021

Keywords

Comments

a(n) deletes any trailing '10' bit pairs from n. So in base 4, it removes all trailing '2' digits.

Examples

			Numbers between '' are in base 2: '0'->'0', so a(0)=0. '110'->'1', so a(6)=1. '1010'->'10' -> '0', so a(10)=0. a(floor((2^1000001)/3))=0.
		

Crossrefs

Cf. A006519, A139391, A001511, A065883 (chop trailing 00 bit pairs), A347840.

Programs

  • Mathematica
    a[n_] := a[n] = If[Mod[n, 4] == 2, a[(n - 2)/4], n]; Array[a, 100, 0] (* Amiram Eldar, Dec 14 2021 *)
  • PARI
    a(n) = if(2!=(n%4), n, my(m=3*n+2); m=m/4^valuation(m,4);(m+1)/3-1)

Formula

A139391(2*a(n)+1) = A139391(2*n+1).
Sum_{k=1..n} a(k) ~ 2 * n^2 / 5. - Amiram Eldar, Aug 30 2024
a(n) = (A347840(n+1) - 1)/2. - Alan Michael Gómez Calderón, Dec 08 2024

A213181 Number of chains of even numbers of length 2 or more in the Collatz (3x+1) trajectory of n.

Original entry on oeis.org

0, 0, 1, 1, 1, 1, 3, 1, 4, 1, 3, 2, 2, 3, 2, 1, 3, 4, 4, 2, 1, 3, 2, 2, 5, 2, 17, 4, 4, 2, 16, 1, 6, 3, 2, 5, 4, 4, 6, 2, 17, 1, 6, 4, 4, 2, 16, 2, 5, 5, 5, 3, 2, 17, 17, 4, 7, 4, 6, 3, 3, 16, 15, 1, 6, 6, 5, 4, 3, 2, 16, 5, 18, 4, 2, 5, 5, 6, 6, 2, 4, 17, 17
Offset: 1

Views

Author

Jayanta Basu, Feb 28 2013

Keywords

Comments

A pair of even numbers that appear side by side in Collatz trajectory of n is considered a chain of length 2 and likewise for chains of greater length.

Examples

			For n=3, Collatz trajectory of 3 is 3,10,5,16,8,4,2,1, hence the only chain is 16,8,4,2 and so a(3)=1.
For n=12: 12,6,3,10,5,16,8,4,2,1 and as such there are two chains 12,6 and 16,8,4,2 so a(12)=2.
		

Crossrefs

Programs

  • Mathematica
    Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; Table[c = Collatz[n]; cnt = 0; evenCnt = 0; Do[If[OddQ[i], evenCnt = 0, evenCnt++; If[evenCnt == 2, cnt++]], {i, c}]; cnt, {n, 100}] (* T. D. Noe, Feb 28 2013 *)

Formula

a(n) = a(A363270(A014682(n))) + 1 for n >= 3. - Alan Michael Gómez Calderón, Apr 09 2025
a(n) = a(A139391(n)) + A133872(n) for n >= 2. - Alan Michael Gómez Calderón, Apr 23 2025

A220182 Number of changes of parity in the Collatz trajectory of n.

Original entry on oeis.org

0, 1, 4, 1, 2, 5, 10, 1, 12, 3, 8, 5, 4, 11, 10, 1, 6, 13, 12, 3, 2, 9, 8, 5, 14, 5, 82, 11, 10, 11, 78, 1, 16, 7, 6, 13, 12, 13, 22, 3, 80, 3, 18, 9, 8, 9, 76, 5, 14, 15, 14, 5, 4, 83, 82, 11, 20, 11, 20, 11, 10, 79, 78, 1, 16, 17, 16, 7, 6, 7, 74, 13, 84, 13
Offset: 1

Views

Author

Jayanta Basu, Feb 20 2013

Keywords

Comments

For n < 10^10, if n <> 27, f(n) is finite, f(n) < 3n + 1. If n = 27 = 3^3, f(n) = 82 = 81 + 1 = 3^4 + 1 = 3n + 1. I conjecture that for any n <> 27, f(n) is finite, f(n) < 3n + 1. - Sergey Pavlov, Jun 02 2019. Note that this conjecture is stronger than the Collatz conjecture. - Andrey Zabolotskiy, Jun 13 2019

Examples

			For n=5, Collatz trajectory for 5 is: 5,16,8,4,2,1; hence the number of transitions between odd and even parity is a(5)=2.
Similarly for n=11, Collatz trajectory gives 11,34,17,52,26,13,40,20,10,5,16,8,4,2,1; implies that a(11)=8.
		

References

  • R. K. Guy, Unsolved Problems in Number Theory, E16

Crossrefs

Programs

  • Mathematica
    Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; parity[n_] := If[OddQ[n], 1, 0]; Table[p = parity /@ Collatz[n]; If[OddQ[n], 2*Total[p] - 2, 2*Total[p] - 1], {n, 100}] (* T. D. Noe, Feb 24 2013 *)
  • PARI
    next_iter(n) = if(n%2==0, return(n/2), return(3*n+1))
    parity(n) = n%2
    a(n) = my(x=n, par=parity(x), i=0); while(x > 1, x=next_iter(x); if(parity(x)!=par, i++; par=parity(x))); i \\ Felix Fröhlich, Jun 02 2019

Formula

a(n) = a(A139391(n)) + (n mod 2) + 1 for n >= 2. - Alan Michael Gómez Calderón, Apr 01 2025

A072196 Multiples of 3 which on one operation of the Collatz function T (N -> 3N+1/2^r) yield the number 5.

Original entry on oeis.org

3, 213, 13653, 873813, 55924053, 3579139413, 229064922453, 14660155037013, 938249922368853, 60047995031606613, 3843071682022823253, 245956587649460688213, 15741221609565484045653, 1007438183012190978921813, 64476043712780222650996053, 4126466797617934249663747413, 264093875047547791978479834453
Offset: 1

Views

Author

N. Rathankar (rathankar(AT)yahoo.com), Jul 03 2002

Keywords

Examples

			(3*3+1)/2=5, (3*213+1)/2^7=5, etc. Thus multiples of 3 act as generators on the numbers in the Collatz domain.
		

Crossrefs

Programs

Formula

a(n) = (10*64^(n-1)-1)/3. - Henry Bottomley, Dec 02 2002 [Formula adapted to a change of offset by Georg Fischer, Apr 10 2024]

Extensions

More terms from Henry Bottomley, Dec 02 2002

A213209 Number of isolated even numbers in Collatz (3x+1) trajectory of n.

Original entry on oeis.org

0, 1, 1, 0, 0, 2, 2, 0, 2, 1, 1, 1, 0, 3, 3, 0, 0, 3, 2, 0, 0, 2, 2, 1, 2, 1, 24, 2, 1, 4, 23, 0, 2, 1, 1, 2, 2, 3, 5, 0, 23, 1, 3, 1, 0, 3, 22, 1, 2, 3, 2, 0, 0, 25, 24, 2, 3, 2, 4, 3, 2, 24, 24, 0, 2, 3, 3, 0, 0, 2, 21, 2, 24, 3, 1, 2, 1, 6, 5, 0, 2, 24, 23, 0
Offset: 1

Views

Author

Jayanta Basu, Mar 02 2013

Keywords

Comments

An isolated even is not a member of any even chain in Collatz trajectory of n; see also A213181.

Examples

			a(7)=2 since there are only 2 numbers 22 and 34 in the Collatz trajectory of 7 that are not part of any even chain.
		

Crossrefs

Programs

  • Mathematica
    Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; Table[c = Collatz[n]; cnt = 0; evenCnt = 0; Do[If[OddQ[i], If[evenCnt == 1, cnt++]; evenCnt = 0, evenCnt++], {i, c}]; cnt, {n, 100}] (* T. D. Noe, Mar 02 2013 *)

Formula

From Alan Michael Gómez Calderón, Apr 23 2025: (Start)
a(n) = a(A139391(n)) + A133872(n+2) for n >= 2;
a(n) = A286380(n) - A213181(n). (End)
Previous Showing 21-30 of 32 results. Next