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-5 of 5 results.

A010684 Period 2: repeat (1,3); offset 0.

Original entry on oeis.org

1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1
Offset: 0

Views

Author

Keywords

Comments

Hankel transform is [1,-8,0,0,0,0,0,0,0,0,...]. - Philippe Deléham, Mar 29 2007
Binomial transform gives [1,4,8,16,32,64,...] (A151821(n+1)). - Philippe Deléham, Sep 17 2009
Continued fraction expansion of (3+sqrt(21))/6. - Klaus Brockhaus, May 04 2010
Positive sum of the coordinates from the image of the point (1,-2) after n 90-degree rotations about the origin. - Wesley Ivan Hurt, Jul 06 2013
This sequence can be generated by an infinite number of formulas having the form a^(b*n) mod c where a is congruent to 3 mod 4 and b is any odd number. If a is congruent to 3 mod 4 then c can be 4; if a is also congruent to 3 mod 8 then c can be 8. For example: a(n)= 15^(3*n) mod 4, a(n) = 19^(5*n) mod 4, a(n) = 19^(5*n) mod 8. - Gary Detlefs, May 19 2014
This sequence is also the unsigned periodic Schick sequence for p = 5. See the Schick reference, p. 158, for p = 5.- Wolfdieter Lang, Apr 03 2020
Digits following the decimal point when 1/3 is converted to base 5. - Jamie Robert Creasey, Oct 15 2021
Decimal expansion of 13/99. - Stefano Spezia, Feb 09 2025

Examples

			0.131313131313131313131313131313131313131313131...
		

References

  • Carl Schick, Trigonometrie und unterhaltsame Zahlentheorie, Bokos Druck, Zürich, 2003 (ISBN 3-9522917-0-6). Tables 3.1 to 3.10, for odd p = 3..113 (with gaps), pp. 158-166.

Crossrefs

Cf. A112030, A112033, A176014 (decimal expansion of (3+sqrt(21))/6).

Programs

Formula

From Paul Barry, Apr 29 2003: (Start)
a(n) = 2-(-1)^n.
G.f.: (1+3x)/((1-x)(1+x)).
E.g.f.: 2*exp(x) - exp(-x). (End)
a(n) = 2*A153643(n) - A153643(n+1). - Paul Curtz, Dec 30 2008
a(n) = 3^(n mod 2). - Jaume Oliver Lafont, Mar 27 2009
a(n) = 7^n mod 4. - Vincenzo Librandi, Feb 07 2011
a(n) = 1 + 2*(n mod 2). - Wesley Ivan Hurt, Jul 06 2013
a(n) = A000034(n) + A000035(n). - James Spahlinger, Feb 14 2016

A005186 a(n) is the number of integers m which take n steps to reach 1 in '3x+1' problem.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 2, 4, 4, 6, 6, 8, 10, 14, 18, 24, 29, 36, 44, 58, 72, 91, 113, 143, 179, 227, 287, 366, 460, 578, 732, 926, 1174, 1489, 1879, 2365, 2988, 3780, 4788, 6049, 7628, 9635, 12190, 15409, 19452, 24561, 31025, 39229, 49580, 62680, 79255, 100144
Offset: 0

Views

Author

Keywords

Comments

Appears to settle into approximately exponential growth after about 25 terms or so with a ratio between adjacent terms of roughly 1.264. - Howard A. Landman, May 24 2003
David W. Wilson (Jun 10 2003) gives a heuristic argument that the constant should be the largest eigenvalue of the matrix [ 1 0 0 1 0 0 / 0 0 0 0 1/3 0 / 0 1 0 0 1 0 / 0 0 0 0 1/3 0 / 0 0 1 0 0 1 / 0 0 0 0 1/3 0 ], which is (3 + sqrt(21))/6 = 1.2637626... = A176014.
Merlini and Sala (1999) deduce the value (1 + sqrt(7/3))/2 (A176014) for the asymptotic ratio a(n+1)/a(n) for n -> oo and call this "Collatz's constant". This is the same value as the constant mentioned above, see the "Heuristic argument for the asymptotic value (3 + sqrt(21))/6 of the ratio a(n+1)/a(n)" note in the Links section. - Markus Sigg, Nov 27 2020

References

  • R. K. Guy, personal communication.
  • J. C. Lagarias, ed., The Ultimate Challenge: The 3x+1 Problem, Amer. Math. Soc., 2010; see p. 33.
  • Danilo Merlini and Nicoletta Sala, On the Fibonacci's Attractor and the Long Orbits in the 3n+1 Problem, International Journal of Chaos Theory and Applications, Vol. 4, No. 2-3 (1999), 75-84.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Mathematica
    (* This program is not suitable to compute more than 20 terms *) maxiSteps = 20; mMaxi = 2*10^6; Clear[a]; a[] = 0; steps[m] := steps[m] = Module[{n = m, ns = 0}, While[n != 1, If[Mod[n, 2] == 0, n = n/2, n = 3*n+1]; ns++]; ns]; Do[sn = steps[m]; If[sn <= maxiSteps, a[sn] = a[sn]+1; Print["m = ", m, " a(", sn, ") = ", a[sn]]], {m, 1, mMaxi}]; Table[a[n], {n, 0, maxiSteps}] (* Jean-François Alcover, Oct 18 2013 *)
    (* 60 terms in under a minute *) s = {1}; t = Join[{1}, Table[s = Union[2*s, (Select[s, Mod[#, 3] == 1 && OddQ[(# - 1)/3] && (# - 1)/3 > 1 &] - 1)/3]; Length[s], {n, 60}]] (* T. D. Noe, Oct 18 2013 *)
  • PARI
    first(n)=my(v=vector(n+1), u=[1], old=u, w); v[1]=1; for(i=1, n, w=List(); for(j=1, #u, listput(w, 2*u[j]); if(u[j]%6==4, listput(w, u[j]\3))); old=setunion(old, u); u=setminus(Set(w), old); v[i+1]=#u); v \\ Charles R Greathouse IV, Jun 26 2017
    
  • PARI
    first(n)={my(v=Vec([1, 1, 1, 1, 1], n+1), u=[16]); for(i=5, n, u=concat(2*u, [x\3 | x<-u, x%6==4 ]); v[i+1]=#u); v} \\ Joe Slater, Sep 01 2024
    
  • Perl
    #!/usr/bin/perl @old = ( 1 ); while (1) { print scalar(@old), " "; @new = ( ); foreach $n (@old) { $used{$n} = 1; if (($n % 6) == 4) { $m = ($n-1)/3; push(@new,$m) unless ($used{$m}); } $m = $n + $n; push(@new,$m) unless ($used{$m}); } @old = @new; }
    
  • Python
    def search(x,d,lst):
        while d>0:
            lst[d]+=1
            if x%6==4 and x>4:
                search(x//3,d-1,lst)
            x*=2
            d-=1
        lst[d]+=1
    def A005186_list(n_max):
        lst=[0]*(n_max+1)
        search(1,n_max,lst)
        return lst[::-1]
    # Bert Dobbelaere, Sep 09 2018

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Apr 27 2001

A090458 Decimal expansion of (3 + sqrt(21))/2.

Original entry on oeis.org

3, 7, 9, 1, 2, 8, 7, 8, 4, 7, 4, 7, 7, 9, 2, 0, 0, 0, 3, 2, 9, 4, 0, 2, 3, 5, 9, 6, 8, 6, 4, 0, 0, 4, 2, 4, 4, 4, 9, 2, 2, 2, 8, 2, 8, 8, 3, 8, 3, 9, 8, 5, 9, 5, 1, 3, 0, 3, 6, 2, 1, 0, 6, 1, 9, 5, 3, 4, 3, 4, 2, 1, 2, 7, 7, 3, 8, 8, 5, 4, 4, 3, 3, 0, 2, 1, 8, 0, 7, 7, 9, 7, 4, 6, 7, 2, 2, 5, 1, 6, 3
Offset: 1

Views

Author

Felix Tubiana, Feb 05 2004

Keywords

Comments

Decimal expansion of the solution to n/x = x-n for n-3. n/x = x-n with n=1 gives the Golden Ratio = 1.6180339887...
n/x = x-n ==> x^2 - n*x - n = 0 ==> x = (n + sqrt(n^2 + 4*n)) / 2 (Positive Root) n = 3: x = (3 + sqrt(21))/2 = 3.79128784747792...
x=3.7912878474... is the shape of a rectangle whose geometric partition (as at A188635) consists of 3 squares, then 1 square, then 3 squares, etc., matching the continued fraction of x, which is [3,1,3,1,3,1,3,1,3,1,...]. (See the Mathematica program below.) - Clark Kimberling, May 05 2011
x appears to be the limit for n to infinity of the ratio of the number of even numbers that take n steps to reach 1 to the number of odd numbers that take n steps to reach 1 in the Collatz iteration. As A005186(n-1) is the number of even numbers that take n steps to reach 1, this means x = lim A005186(n-1)/A176866(n). - Markus Sigg, Oct 20 2020
From Wolfdieter Lang, Sep 02 2022: (Start)
This integer in the quadratic number field Q(sqrt(21)) equals the (real) cube root of 27 + 6*sqrt(21) = 54.4954541... . See Euler, Elements of Algebra, Article 748 or Algebra (in German) p. 306, Kapitel 12, 187.
Subtracting 3 from the present number gives the (real) cube root of
-27 + 6*sqrt(21) = 0.4954541... . (End)

Examples

			3.79128784747792...
		

References

  • Leonhard Euler, Vollständige Anleitung zur Algebra, (1770), Reclam, Leipzig, 1883, p.306, Kapitel 12, 187.

Crossrefs

Of the same type as this: A090388 (n=2), A090488 (n=4), A090550 (n=5), A092294 (n=6), A092290 (n=7), A090654 (n=8), A090655 (n=9), A090656 (n=10).
Equals 3*A176014 (constant).
Cf. A356034.

Programs

Formula

Equals (27 + 6*sqrt(21))^(1/3). - Wolfdieter Lang, Sep 01 2022

Extensions

Additional comments from Rick L. Shepherd, Jul 02 2004

A176866 The number of odd numbers that require n Collatz (3x+1) iterations to reach 1.

Original entry on oeis.org

1, 0, 0, 0, 0, 1, 0, 2, 0, 2, 0, 2, 2, 4, 4, 6, 5, 7, 8, 14, 14, 19, 22, 30, 36, 48, 60, 79, 94, 118, 154, 194, 248, 315, 390, 486, 623, 792, 1008, 1261, 1579, 2007, 2555, 3219, 4043, 5109, 6464, 8204, 10351, 13100, 16575, 20889, 26398, 33388, 42155, 53370, 67414
Offset: 0

Views

Author

T. D. Noe, Apr 27 2010

Keywords

Comments

Both the 3x+1 steps and the halving steps are counted. The asymptotic growth rate appears to be the same as A005186, about 1.26 (A176014).
a(n) is, for n >= 4, the number of 4 (mod 6) nodes (vertices) of row n-1 of the Collatz tree A127824. The node 4 has in A127824 outdegree 1 in order to avoid a repetition of the whole tree. - Wolfdieter Lang, Mar 26 2014
The heuristic arguments given in the LINKS of A005186 suggest that this sequence has the same asymptotic growth rate (3+sqrt(21))/6. - Markus Sigg, Sep 07 2024

Examples

			23, 141, 151, 853, 909, and 5461 are the only odd numbers that require exactly 15 iterations to reach 1. Hence a(15)=6.
At row 15 with a(16) = 5 nodes 4 (mod 6) the left-right symmetry for the number of 4 (mod 6) nodes in the Collatz tree A127824 is broken for the first time: in the left half of the tree there are the three nodes 22, 136 and 832 but on the right half only the two nodes 904 and 5440. - _Wolfdieter Lang_, Mar 26 2014
		

Crossrefs

Cf. A005186 (number of numbers having stopping time n).
Cf. A127824 (numbers having stopping time n).

A182229 a(n) = a(n-1) + floor(a(n-2)/3) with a(0)=2, a(1)=3.

Original entry on oeis.org

2, 3, 3, 4, 5, 6, 7, 9, 11, 14, 17, 21, 26, 33, 41, 52, 65, 82, 103, 130, 164, 207, 261, 330, 417, 527, 666, 841, 1063, 1343, 1697, 2144, 2709, 3423, 4326, 5467, 6909, 8731, 11034, 13944, 17622, 22270, 28144, 35567, 44948, 56803, 71785, 90719, 114647, 144886, 183101
Offset: 0

Views

Author

Alex Ratushnyak, Apr 19 2012

Keywords

Comments

a(n)/a(n-1) tends to (3+sqrt(21))/6 = 1.263762615825973334... [Bruno Berselli, Apr 23 2012]

Crossrefs

Programs

  • Haskell
    a182229 n = a182229_list !! n
    a182229_list = 2 : 3 : zipWith (+)
                           (map (flip div 3) a182229_list) (tail a182229_list)
    -- Reinhard Zumkeller, Apr 30 2015
  • Magma
    [n le 2 select n+1 else Self(n-1)+Floor(Self(n-2)/3): n in [1..51]]; // Bruno Berselli, Apr 21 2012
    
  • Mathematica
    RecurrenceTable[{a[0] == 2, a[1] == 3, a[n] == a[n - 1] + Floor[a[n - 2]/3]}, a, {n, 50}] (* Bruno Berselli, Apr 21 2012 *)
  • Python
    prpr = 2
    prev = 3
    for i in range(2,51):
        current = prev + prpr//3
        print(current, end=',')
        prpr = prev
        prev = current
    
Showing 1-5 of 5 results.