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.

A033491 a(n) is the smallest integer that takes n halving and tripling steps to reach 1 in the 3x+1 problem.

Original entry on oeis.org

1, 2, 4, 8, 16, 5, 10, 3, 6, 12, 24, 48, 17, 34, 11, 22, 7, 14, 28, 9, 18, 36, 72, 25, 49, 98, 33, 65, 130, 43, 86, 172, 57, 114, 39, 78, 153, 305, 105, 203, 406, 135, 270, 540, 185, 361, 123, 246, 481, 169, 329, 641, 219, 427, 159, 295, 569, 1138, 379, 758, 283, 505
Offset: 0

Views

Author

Keywords

Comments

a(n) is the smallest term in n-th row of A127824. - Reinhard Zumkeller, Nov 29 2012
Interestingly, there are many n such that a(n) = 2*a(n-1). - Dmitry Kamenetsky, Feb 11 2017
a(n) is the position of the first occurrence of n in A006577. - Sean A. Irvine, Jul 07 2020

Crossrefs

Cf. A126727 (missing numbers).

Programs

  • Haskell
    a033491 = head . a127824_row  -- Reinhard Zumkeller, Nov 29 2012
    
  • Mathematica
    f[ n_ ] := Module[ {i = 0, m = n}, While[ m != 1, m = If[ OddQ[ m ], 3m + 1, m/2 ]; i++ ]; i ]; a = Table[ 0, {75} ]; Do[ m = f[ n ]; If[ a[[ m + 1 ]] == 0, a[[ m + 1 ]] = n ], {n, 1, 1250} ]; a
    With[{c=Table[Length[NestWhileList[If[OddQ[#],3#+1,#/2]&,n,#!=1&]],{n,2000}]}, Flatten[Table[Position[c,i,1,1],{i,70}]]] (* Harvey P. Dale, Jan 06 2013 *)
  • PARI
    a(n)=if(n<0,0,k=1; while(abs(if(k<0,0,s=k; c=1; while((1-(s%2))*s/2+(s%2)*(3*s+1)>1,s=(1-(s%2))*s/2+(s%2)*(3*s+1); c++); c)-n-1)>0,k++); k)
    
  • Python
    import numpy
    nupto = 62
    A033491 = numpy.zeros(nupto, dtype=object)
    k, counter = 1, 0
    while counter < nupto:
        kk, n = k, 0
        while n <= nupto and kk != 1:
            if kk % 2 == 0:
                kk //= 2
            else:
                kk = (kk*3+1)//2
                n += 1
            n += 1
        if n < nupto and not A033491[n]:
            A033491[n] = k
            counter += 1
        k += 1
    print(list(A033491)) # Karl-Heinz Hofmann, Feb 11 2023

Extensions

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

A171490 Numbers for which the smallest number of steps to reach 1 in "3x+1" (or Collatz) problem is a prime.

Original entry on oeis.org

1, 5, 7, 12, 14, 16, 29, 51, 56, 58, 60, 64, 65, 67, 74, 75, 78, 83, 87, 90, 100, 102, 104, 106, 109, 115, 118, 119, 122, 128, 130, 132, 134, 141, 142, 147, 161, 166, 173, 176, 187, 188, 200, 212, 219, 221, 231, 234, 239, 241, 251, 259, 264, 293, 313, 314, 316
Offset: 1

Views

Author

Ulrich Krug (leuchtfeuer37(AT)gmx.de), Dec 10 2009

Keywords

Comments

Positions of primes in A033491. [R. J. Mathar, Nov 01 2010]

Examples

			1st Collatz sequence with a(1)=1 step starts with 2=prime(1): 2-1;
1st Collatz sequence with a(3)=7 steps starts with 3=prime(2): 3-10-5-16-8-4-2-1;
prime(6)=13 has Collatz sequence with 9 steps: 13-40-20-10-5-16-8-4-2-1, so has the smaller composite 12 < 13: 12-6-3-10-5-16-8-4-2-1 => 9 not a term of sequence;
1st Collatz sequence with a(5)=14 steps starts with 11=prime(5): 11-34-17-52-26-13-40-20-10-5-16-8-4-2-1.
		

References

  • R. K. Guy, "Collatz's Sequence" in Unsolved Problems in Number Theory, 2nd ed. New York: Springer-Verlag, pp. 215-218, 1994
  • Clifford A. Pickover, Wonders of Numbers, Oxford University Press, pp. 116-118, 2001

Crossrefs

Extensions

Terms > 187 from R. J. Mathar, Nov 01 2010
Name edited by Michel Marcus, Jul 07 2018

A171619 Primes in A171490.

Original entry on oeis.org

5, 7, 29, 67, 83, 109, 173, 239, 241, 251, 293, 313, 337, 367, 571, 613, 769, 821, 877, 941, 947, 1031, 1069, 1103, 1511, 1693, 1759, 1901, 2011
Offset: 1

Views

Author

Ulrich Krug (leuchtfeuer37(AT)gmx.de), Dec 13 2009

Keywords

Comments

Terms of sequence are primes in growing order where smallest number of steps m to reach 1 in "3x+1" (or Collatz) problem is a prime too.

Examples

			(1) 1st Collatz sequence with 5=prime(3) steps starts with 5=prime(3): 5-16-8-4-2-1, gives a(1)=5.
(2) 1st Collatz sequence with 7=prime(4) steps starts with 3=prime(2): 3-10-5-16-8-4-2-1, gives a(2)=7.
(3) 1st Collatz sequence with 29=prime(10) steps starts with 43=prime(14): 43-130-65-196-98-49-148-74-37-112-56-28-14-7-22-11-34-17-52-26-13-40-20-10-5-16-8-4-2-1, gives a(3)=29.
(4) List of prime steps m for above a(n): 5, 3, 43, 167, 233, 41, 937, 14831, 9887, 7963, 73063, 45127, 78791, 225023, 6956969, 10998599, 126357223, 859130059, 2845683047, 322623647, 95592191, 8363817307, 28677246203, 38590505339, 35521451596571, 478672174364191, 1168778549494463, 6376392739978081, 103147916159472367.
		

References

  • R. K. Guy, "Collatz's Sequence" in Unsolved Problems in Number Theory, 2nd ed. New York: Springer-Verlag, pp. 215-218, 1994.
  • Clifford A. Pickover, Wonders of Numbers, Oxford University Press, pp. 116-118, 2001.
  • Guenther J. Wirsching, The Dynamical System Generated by the 3n+1 Function, Springer-Verlag, Berlin, 1998.

Crossrefs

Extensions

Missing term a(7)=173 inserted by Georg Fischer, Oct 26 2022
a(23)-a(29) (using Eric Roosendaal's data) by Tyler Busby, Feb 11 2023
Showing 1-3 of 3 results.