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 51-60 of 121 results. Next

A111329 Number of partitions of T where T = (3n + 1) if n is even and T=(3n + 1)/2 if n is odd.

Original entry on oeis.org

2, 15, 7, 101, 22, 490, 56, 1958, 135, 6842, 297, 21637, 627, 63261, 1255, 173525, 2436, 451276, 4565, 1121505, 8349, 2679689, 14883, 6185689, 26015, 13848650, 44583, 30167357, 75175, 64112359, 124754, 133230930, 204226, 271248950, 329931
Offset: 1

Views

Author

Parthasarathy Nambi, Nov 04 2005

Keywords

Examples

			If n=1 then T = 2 and a(1) = 2.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := If[EvenQ[n], PartitionsP[3n + 1], PartitionsP[(3n + 1)/2]]; Table[ f[n], {n, 35}] (* Robert G. Wilson v, Nov 07 2005 *)

Formula

a(n) = A000041(A165355(n-1)). [Reinhard Zumkeller, Nov 19 2009]

A187831 Smallest number m > n such that n occurs in Collatz trajectory starting with m; a(0) = 1 by convention.

Original entry on oeis.org

1, 2, 3, 6, 5, 6, 12, 9, 9, 18, 11, 14, 24, 14, 18, 30, 17, 18, 36, 25, 22, 42, 25, 27, 48, 33, 28, 54, 36, 33, 60, 41, 42, 66, 36, 41, 72, 43, 39, 78, 41, 54, 84, 57, 50, 90, 47, 54, 96, 57, 66, 102, 56, 54, 108, 73, 57, 114, 59, 78, 120, 62, 82, 126, 75
Offset: 0

Views

Author

Reinhard Zumkeller, Jan 04 2013

Keywords

Comments

A070165(a(n),k) = n for some k with 1 <= k <= A006577(a(n)).

Examples

			n = 10: row 11 of A070165 = [11,34,17,52,26,13,40,20,10,5,16,8,4,2,1],
therefore A070165(11,9) = 10 and a(10) = 11;
n = 11: rows 12 and 13 of A070165 don't contain 11, but 14 does:
row 12: [12,6,3,10,5,16,8,4,2,1],
row 13: [13,40,20,10,5,16,8,4,2,1],
row 14: [14,7,22,11,34,17,52,26,13,40,20,10,5,16,8,4,2,1],
therefore A070165(14,4) = 11: a(11) = 14.
		

Crossrefs

Programs

  • Haskell
    import Data.List (find)
    import Data.Maybe (fromJust)
    a187831 0 = 1
    a187831 n = head $ fromJust $
            find (n `elem`) $ drop (fromIntegral n) a070165_tabf
  • Mathematica
    mcollQ[n_,k_]:=MemberQ[NestWhileList[If[EvenQ[#],#/2,3#+1]&,n,#>1&],k]==True; Prepend[Table[i=n+1; While[!mcollQ[i,n],i++]; i,{n,64}],1] (* Jayanta Basu, May 27 2013 *)
    Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; Join[{1}, Table[k = n + 1; While[! MemberQ[Collatz[k], n], k++]; k, {n, 100}]] (* T. D. Noe, May 28 2013 *)

A207675 Numbers such that not all divisors occur in their Collatz trajectories.

Original entry on oeis.org

9, 15, 18, 21, 27, 30, 33, 35, 36, 39, 42, 45, 51, 54, 55, 57, 60, 63, 66, 69, 70, 72, 75, 77, 78, 81, 84, 85, 87, 90, 91, 93, 95, 96, 99, 102, 105, 108, 110, 111, 114, 115, 117, 119, 120, 121, 123, 125, 126, 129, 132, 133, 135, 138, 140, 141, 143, 144, 145
Offset: 1

Views

Author

Reinhard Zumkeller, Feb 20 2012

Keywords

Examples

			3 is a divisor of 9, not occurring in A033479 - therefore 9 is a term.
		

Crossrefs

Cf. A027750, A070165, A006370, A207674 (complement).

Programs

  • Haskell
    import Data.List (intersect)
    a207675 n = a207675_list !! (n-1)
    a207675_list = filter
       (\x -> a027750_row x `intersect` a070165_row x /= a027750_row x) [1..]
  • Mathematica
    coll[n_]:=NestWhileList[If[EvenQ[#],#/2,3#+1]&,n,#>1&]; Select[Range[145],Complement[Divisors[#],coll[#]]!={}&] (* Jayanta Basu, May 27 2013 *)

A220139 The highest value of the Collatz iteration (3x+1) starting at a(n-1) + 1, with a(1) = 1.

Original entry on oeis.org

1, 2, 16, 52, 160, 9232, 27700, 83104, 599056, 1797172, 5391520, 38862808, 131161984, 393485956, 1180457872, 3541373620, 10624120864, 87327950740, 261983852224, 785951556676, 2357854670032, 7553654536192, 22660963608580, 67982890825744, 203948672477236
Offset: 1

Views

Author

T. D. Noe, Jan 02 2013

Keywords

Comments

The length of the trajectory of a(n) is A220140(n).

Examples

			The Collatz trajectory of 2 + 1 is (3, 10, 5, 16, 8, 4, 2, 1). Hence, a(3) = 16. The trajectory of 16 + 1 is (17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1). Hence, a(4) = 52.
		

Crossrefs

Cf. A070165 (trajectory of n).

Programs

  • Mathematica
    Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; c = {1}; t = {}; Do[AppendTo[t, Max[c]]; c = Collatz[t[[-1]] + 1], {30}]; t

A225843 Integral parts of sums of the reciprocals of the Collatz (3x+1) sequence starting with n.

Original entry on oeis.org

1, 1, 2, 1, 2, 2, 2, 1, 3, 2, 2, 2, 2, 2, 2, 1, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 1, 3, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3
Offset: 1

Views

Author

Reinhard Zumkeller, May 16 2013

Keywords

Comments

a(n) = floor(sum(1/A070165(n,k): k = 1..A006577(n)));
conjecture: a(n) <= 3;
a(n) = 1 iff n = 2^k: a(A000079(n)) = 1, a(A057716(n)) > 1.

Programs

  • Haskell
    a225843 = floor . sum . map (recip . fromIntegral) . a070165_row

Formula

a(n) = floor(A225761(n)/A225784(n)).

A238192 In the Collatz (3x+1) iteration of n, the last odd number before 1, or 0 if there is no such number.

Original entry on oeis.org

0, 0, 5, 0, 5, 5, 5, 0, 5, 5, 5, 5, 5, 5, 5, 0, 5, 5, 5, 5, 21, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 21, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 85, 5, 5, 5, 5, 5, 5, 5, 5, 21, 85, 5
Offset: 1

Views

Author

T. D. Noe, Feb 21 2014

Keywords

Comments

Another version of A237660. The only terms appearing here are 0, 5, 21, 85, ..., which is A002450 without 1.

Crossrefs

Cf. A002450 ((4^n-1)/3), A070165 (Collatz trajectories).

Programs

  • Mathematica
    Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; Table[c = Collatz[n]; co = Select[c, OddQ]; If[Length[co] == 1, 0, co[[-2]]], {n, 100}]

A254068 Irregular triangle T read by rows in which the entry in row n and column k is given by T(n,k) = 4*A253676(n,k) - 3, k = 1..A253720(n), assuming the 3x+1 (or Collatz) conjecture.

Original entry on oeis.org

1, 5, 1, 9, 17, 13, 5, 1, 13, 5, 1, 17, 13, 5, 1, 21, 1, 25, 29, 17, 13, 5, 1, 29, 17, 13, 5, 1, 33, 25, 29, 17, 13, 5, 1, 37, 17, 13, 5, 1, 41, 161, 121, 137, 233, 593, 445, 377, 425, 2429, 3077, 577, 433, 325, 61, 53, 5, 1, 45, 17, 13, 5, 1
Offset: 1

Views

Author

L. Edson Jeffery, May 03 2015

Keywords

Comments

Definitions: Let v(y) denote the 2-adic valuation of y. Let N_1 denote the set of odd natural numbers. Let F : N_1 -> N_1 be the map defined by F(x) = (3*x + 1)/2^v(3*x + 1) (cf. A075677). Let F^(k)(x) denote k-fold iteration of F and defined by the recurrence F^(k)(x) = F(F^(k-1)(x)), k>0, with initial condition F^(0)(x) = x.
This triangle can be constructed by restricting the initial values to the numbers 4*n - 3, iterating F until 1 is reached (assuming the 3x+1 conjecture) and removing all iterates not congruent to 1 modulo 4. Equivalently, for each n, this is accomplished by iterating (until 1 is reached, assuming the 3x+1 conjecture) the function S defined in A257480 to get the triangle A253676, and finally taking T(n,k) = 4*A253676(n,k) - 3.
Conjecture: For each natural number n, there exists a k >= 0, such that F^k(4*n - 3) = 1.
Theorem 1: Conjecture 1 is equivalent to the 3x+1 (or Collatz) conjecture.
Proof: See A257480.

Examples

			T begins:
   1
   5   1
   9  17  13   5   1
  13   5   1
  17  13   5   1
  21   1
  25  29  17  13   5   1
  29  17  13   5   1
  33  25  29  17  13   5   1
  37  17  13   5   1
  41 161 121 137 233 593 445 377 425 2429 3077 577 433 325 61 53 5 1
  45  17  13   5   1
  49  37  17  13   5   1
  53   5   1
  57  65  49  37  17  13   5   1
		

Crossrefs

Programs

  • Mathematica
    v[x_] := IntegerExponent[x, 2]; f[x_] := (3*x + 1)/2^v[3*x + 1]; s[n_] := NestWhileList[(3 + (3/2)^v[1 + f[4*# - 3]]*(1 + f[4*# - 3]))/6 &, n, # > 1 &]; t = Table[4*s[n] - 3, {n, 1, 15}]; Flatten[t] (* Replace Flatten with Grid to display the triangle *)

A258822 Number of times that k iterations of n under the '3x+1' map yield k for some k.

Original entry on oeis.org

0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 2, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0
Offset: 1

Views

Author

Derek Orr, Jun 11 2015

Keywords

Comments

This sequence uses the definition in A006370: if n is odd, n -> 3*n+1, if n is even, n -> n/2.
The number 3 appears first at a(63105). Do all nonnegative numbers appear? See A258824.

Examples

			For n = 6, the '3x+1' map is as follows: 6 -> 3 -> 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1. Here the number of iterations is 8. However, after the k-th iteration, the result does not equal k. Thus a(6) = 0.
For n = 7, the '3x+1' map is as follows: 7 -> 22 -> 11 -> 34 -> 17 -> 52 -> 26 -> 13 -> 40 -> 20 -> 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1. Only after 10 iterations do we arrive at 10. Since this is the only time this happens, a(7) = 1.
		

Crossrefs

Programs

  • Mathematica
    A258822[n_]:=Count[MapIndexed[{#1}==#2-1&,NestWhileList[If[OddQ[#],3#+1,#/2]&,n,#>1&]],True];Array[A258822,100] (* Paolo Xausa, Nov 06 2023 *)
  • PARI
    Tvect(n)=v=[n]; while(n!=1, if(n%2, k=(3*n+1); v=concat(v, k); n=k); if(!(n%2), k=n/2; v=concat(v, k); n=k)); v
    for(n=1, 200, d=Tvect(n); c=0; for(i=1, #d, if(d[i]==i-1, c++)); print1(c, ", "))

A334040 Number of odd numbers larger than n in the Collatz trajectory of n.

Original entry on oeis.org

0, 0, 1, 0, 0, 0, 3, 0, 3, 0, 2, 0, 0, 1, 3, 0, 0, 0, 1, 0, 0, 0, 2, 0, 1, 0, 38, 0, 0, 2, 36, 0, 0, 0, 1, 0, 0, 0, 4, 0, 35, 0, 2, 0, 0, 1, 34, 0, 0, 0, 1, 0, 0, 33, 35, 0, 1, 0, 3, 0, 0, 32, 33, 0, 0, 0, 1, 0, 0, 0, 31, 0, 33, 0, 2, 0, 0, 2, 4, 0, 0, 31, 32
Offset: 1

Views

Author

Hamid Kulosman, May 11 2020

Keywords

Examples

			For n=7 the Collatz process is: 7,22,(11),34,(17),52,26,(13),40,20,10,5,16,8,4,2,1. The numbers in the parentheses are odd numbers in the Collatz process for n=7 that are bigger than 7. There are three of them, hence a(7)=3.
		

Crossrefs

Programs

A341231 Irregular triangle read by rows giving trajectory from n to reach 1 under the map A245471.

Original entry on oeis.org

1, 2, 1, 3, 4, 2, 1, 4, 2, 1, 5, 14, 7, 8, 4, 2, 1, 6, 3, 4, 2, 1, 7, 8, 4, 2, 1, 8, 4, 2, 1, 9, 26, 13, 22, 11, 28, 14, 7, 8, 4, 2, 1, 10, 5, 14, 7, 8, 4, 2, 1, 11, 28, 14, 7, 8, 4, 2, 1, 12, 6, 3, 4, 2, 1, 13, 22, 11, 28, 14, 7, 8, 4, 2, 1, 14, 7, 8, 4, 2, 1
Offset: 1

Views

Author

Rémy Sigrist, Feb 07 2021

Keywords

Comments

A340873 gives row lengths.
A341235 gives greatest terms.

Examples

			Table begins:
    1;
    2, 1;
    3, 4, 2, 1;
    4, 2, 1;
    5, 14, 7, 8, 4, 2, 1;
    6, 3, 4, 2, 1;
    7, 8, 4, 2, 1;
    8, 4, 2, 1;
    9, 26, 13, 22, 11, 28, 14, 7, 8, 4, 2, 1;
    10, 5, 14, 7, 8, 4, 2, 1;
    11, 28, 14, 7, 8, 4, 2, 1;
    12, 6, 3, 4, 2, 1;
    13, 22, 11, 28, 14, 7, 8, 4, 2, 1;
    14, 7, 8, 4, 2, 1;
    15, 16, 8, 4, 2, 1;
    16, 8, 4, 2, 1;
    ...
		

Crossrefs

Programs

  • PARI
    row(n) = { my (r=[n]); while (n>1, r=concat(r, n=if (n%2, bitxor(n, 2*n+1), n/2))); r }

Formula

T(n, 1) = n.
T(n, A340873(n)) = 1.
Previous Showing 51-60 of 121 results. Next