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.

A341515 The Collatz or 3x+1 map (A006370) conjugated by unary-binary-encoding (A156552).

Original entry on oeis.org

1, 5, 2, 15, 3, 11, 5, 45, 4, 125, 7, 33, 11, 245, 6, 135, 13, 77, 17, 375, 10, 605, 19, 99, 9, 845, 8, 735, 23, 17, 29, 405, 14, 1445, 15, 231, 31, 1805, 22, 1125, 37, 1331, 41, 1815, 12, 2645, 43, 297, 25, 275, 26, 2535, 47, 539, 21, 2205, 34, 4205, 53, 51, 59, 4805, 20, 1215, 33, 1859, 61, 4335, 38, 3125, 67, 693
Offset: 1

Views

Author

Antti Karttunen, Feb 14 2021

Keywords

Comments

Collatz-conjecture can be formulated via this sequence by postulating that all iterations of a(n), starting from any n > 1, will eventually reach the cycle [2, 5, 3].

Crossrefs

Cf. A005940, A006370, A064989, A156552, A329603, A341510, A347115 (Möbius transform),
Sequences related to iterations of this sequence: A352890, A352891, A352892, A352893, A352894, A352896, A352897, A352898, A352899.
Cf. A341516 (a variant).

Programs

  • PARI
    A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); (t); };
    A064989(n) = {my(f); f = factor(n); if((n>1 && f[1,1]==2), f[1,2] = 0); for (i=1, #f~, f[i,1] = precprime(f[i,1]-1)); factorback(f)};
    A156552(n) = { my(f = factor(n), p2 = 1, res = 0); for(i = 1, #f~, p = 1 << (primepi(f[i, 1]) - 1); res += (p * p2 * (2^(f[i, 2]) - 1)); p2 <<= f[i, 2]); res };
    A329603(n) = A005940(2+(3*A156552(n)));
    A341515(n) = if(n%2, A064989(n), A329603(n));

Formula

If n is odd, then a(n) = A064989(n), otherwise a(n) = A329603(n) = A341510(n,2*n).
a(n) = A005940(1+A006370(A156552(n))).

A352894 Number of iterations of map x -> A352892(x) needed to reach x < n when starting from x=n, or 0 if such number is never reached. Here A352892 is the next odd term in the Collatz or 3x+1 map (A139391) conjugated by unary-binary-encoding (A156552).

Original entry on oeis.org

0, 0, 1, 2, 1, 1, 1, 4, 1, 1, 1, 3, 1, 2, 1, 4, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 2, 1, 1, 1, 35, 1, 40, 1, 2, 1, 5, 1, 5, 1, 1, 1, 2, 1, 6, 1, 34, 1, 1, 1, 2, 1, 1, 1, 33, 1, 6, 1, 1, 1, 17, 1, 35, 1, 1, 1, 6, 1, 1, 1, 3, 1, 35, 1, 4, 1, 1, 1, 5, 1, 10, 1, 3, 1, 10, 1, 4, 1, 1, 1, 6, 1, 24, 1, 34, 1, 1, 1, 2, 1
Offset: 1

Views

Author

Antti Karttunen, Apr 08 2022

Keywords

Crossrefs

Programs

  • PARI
    A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); (t); };
    A064989(n) = {my(f); f = factor(n); if((n>1 && f[1,1]==2), f[1,2] = 0); for (i=1, #f~, f[i,1] = precprime(f[i,1]-1)); factorback(f)};
    A156552(n) = { my(f = factor(n), p, p2 = 1, res = 0); for(i = 1, #f~, p = 1 << (primepi(f[i, 1]) - 1); res += (p * p2 * (2^(f[i, 2]) - 1)); p2 <<= f[i, 2]); res };
    A329603(n) = A005940(2+(3*A156552(n)));
    A341515(n) = if(n%2, A064989(n), A329603(n));
    A348717(n) = { my(f=factor(n)); if(#f~>0, my(pi1=primepi(f[1, 1])); for(k=1, #f~, f[k, 1] = prime(primepi(f[k, 1])-pi1+1))); factorback(f); }; \\ From A348717
    A352892(n) = A348717(A341515(n));
    A352894(n) = if(n<=2, 0, my(k=0,x=n); while(x>=n, x = A352892(x); k++); (k));

Formula

a(2n+1) = 1 for n >= 1.
For n >= 1, a(n) <= A352891(n).
For n >= 1, a(n) <= A352893(n).

A352890 Number of iterations of map x -> A341515(x) needed to reach x <= 2 when starting from x=n, or -1 if such number is never reached. Here A341515 is the Collatz or 3x+1 map (A006370) conjugated by unary-binary-encoding (A156552).

Original entry on oeis.org

0, 0, 1, 7, 2, 5, 3, 16, 8, 19, 4, 14, 5, 12, 6, 17, 6, 9, 7, 20, 20, 26, 8, 15, 9, 27, 17, 13, 9, 7, 10, 106, 13, 121, 7, 111, 11, 122, 27, 34, 12, 21, 13, 27, 15, 35, 14, 104, 10, 23, 28, 28, 15, 18, 21, 102, 122, 36, 16, 29, 17, 156, 21, 107, 14, 14, 18, 122, 123, 109, 19, 112, 20, 113, 10, 123, 8, 28, 21, 35
Offset: 1

Views

Author

Antti Karttunen, Apr 08 2022

Keywords

Comments

The unbroken ray in the scatter plot corresponds to primes.

Crossrefs

Programs

  • PARI
    A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); (t); };
    A064989(n) = {my(f); f = factor(n); if((n>1 && f[1,1]==2), f[1,2] = 0); for (i=1, #f~, f[i,1] = precprime(f[i,1]-1)); factorback(f)};
    A156552(n) = { my(f = factor(n), p, p2 = 1, res = 0); for(i = 1, #f~, p = 1 << (primepi(f[i, 1]) - 1); res += (p * p2 * (2^(f[i, 2]) - 1)); p2 <<= f[i, 2]); res };
    A329603(n) = A005940(2+(3*A156552(n)));
    A341515(n) = if(n%2, A064989(n), A329603(n));
    A352890(n) = { my(k=0); while(n>2, n = A341515(n); k++); (k); };

Formula

If n <= 2, a(n) = 0, otherwise a(n) = 1 + a(A341515(n)).
For n > 1, a(n) = A006577(A156552(n)).
For n >= 1, a(A000040(n)) = n-1.
For n >= 1, a(n) >= A352891(n).
For n >= 1, a(n) >= A352893(n).
Showing 1-3 of 3 results.