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.

A340709 Let k = n/2 + floor(n/4) if n is even, otherwise (3n+1)/2; then a(n) = A093545(k).

Original entry on oeis.org

0, 1, 2, 3, 5, 4, 7, 6, 10, 8, 12, 9, 15, 11, 17, 13, 20, 14, 22, 16, 25, 18, 27, 19, 30, 21, 32, 23, 35, 24, 37, 26, 40, 28, 42, 29, 45, 31, 47, 33, 50, 34, 52, 36, 55, 38, 57, 39, 60, 41, 62, 43, 65, 44, 67, 46, 70, 48, 72, 49, 75, 51, 77, 53, 80, 54, 82, 56, 85, 58, 87
Offset: 0

Views

Author

Thomas Scheuerle, Jan 16 2021

Keywords

Comments

This is a permutations of the nonnegative integers.
A093545 is the inverse of A340615.
Some of the cycles of this permutation are: (0),(1),(2),(3),(5 4),(7 6),(10 12 15 13 11 9 8),(17 14),(20 25 21 18 22 27 23 19 16),... .
A340615 and A342131 are permutations, constructed by a small modification of Collatz function (A014682). This sequence relates these permutations which each other: A340615(a(n)) = A342131(n).

Crossrefs

Programs

  • MATLAB
    function a = A340709(max_n)
        for n = 1:max_n*10
            k = (n-1)+floor(((n-1)+1)/5);
            m = n-1;
            if floor(k/2) == k/2
                A340615(n) = k/2;
            else
                A340615(n) = (k*3+1)/2;
            end
            if floor(m/2) == m/2
                b(n) = m/2+floor(m/4);
            else
                b(n) = (m*3+1)/2;
            end
        end
        for n = 1:(length(A340615)/10)
            a(n) = find(A340615==b(n))-1;
        end
    end

Formula

a(4*m) = 5*m.
a(2+4*m) = 2+5*m.
a(1+6*m) = 1+5*m.
a(3+6*m) = 3+5*m.
a(4+6*m) = 4+5*m.
a(n) = -2*a(n-1) - 3*a(n-2) - 4*a(n-3) - 4*a(n-4) - 4*a(n-5) - 3*a(n-6) - 2*a(n-7) - a(n-8) + 25n - 101 for n >= 8.
a(n) = A093545(A342131(n)).
G.f.: x*(1 + 2*x + 3*x^2 + 5*x^3 + 3*x^4 + 5*x^5 + 2*x^6 + 3*x^7 + x^8)/(1 - x^4 - x^6 + x^10). - Stefano Spezia, Mar 01 2021

A342369 If n is congruent to 2 (mod 3), then a(n) = (2*n - 1)/3; otherwise, a(n) = 2*n.

Original entry on oeis.org

0, 2, 1, 6, 8, 3, 12, 14, 5, 18, 20, 7, 24, 26, 9, 30, 32, 11, 36, 38, 13, 42, 44, 15, 48, 50, 17, 54, 56, 19, 60, 62, 21, 66, 68, 23, 72, 74, 25, 78, 80, 27, 84, 86, 29, 90, 92, 31, 96, 98, 33, 102, 104, 35, 108, 110, 37, 114, 116, 39, 120, 122, 41, 126, 128, 43, 132, 134, 45, 138, 140, 47, 144, 146
Offset: 0

Views

Author

Thomas Scheuerle, Mar 09 2021

Keywords

Comments

This sequence is a permutation of all numbers not congruent to 4 (mod 6) (A047256).
This sequence has no finite cycles other than (2,1) under recursion, because of all cycles of permutation A093545(n), only one cycle (2,1) is without any number congruent to 4 (mod 6). See section "formula" first entry here. After a finite number of recursions it will reach only numbers divisible by 3 under further recursion.
m = a(n) is the smallest solution to A014682(m) = n.
If we define f(n) = 2*n and j(n) as an arbitrary recursion into a(n) and/or f(n) ( two examples: j(n) = a(a(n)) or j(n) = a(f(a(n))) ), then for all m, k and n = A014682^k(m), exists a j(n) that allows m = j(n). "^k" means recursion here.
Proving the Collatz conjecture could be done by proving that for all positive integers m, a function j(n) (see first comment) could be designed such that m = j(1). All numbers greater than 4 can be reached by a^k(6*p - 2) with exactly one p and k. The Collatz conjecture cannot be true if 3*p - 1 = a^k(6*p - 2) exists.

Crossrefs

Programs

  • MATLAB
    function a = A342369( max_n )
        a(1) = 0;
        for n=1:max_n
            if mod(n,3) == 2
                a(n) = (2*n - 1)/3;
            else
                a(n) = 2*n;
            end
        end
    end
    
  • Mathematica
    Array[If[Mod[#, 3] == 2, (2 # - 1)/3, 2 #] &, 74, 0] (* Michael De Vlieger, Mar 14 2021 *)
  • PARI
    a(n) = if ((n%3)==2, (2*n - 1)/3, 2*n); \\ Michel Marcus, Mar 09 2021

Formula

a(n) = A093545(n) + floor((1 + A093545(n))/5).
a(3*n) = a(3*(n-1)) + 6.
a(3*n - 1) = a(3*(n-1) - 1) + 2.
a(3*n - 2) = a(3*(n-1) - 2) + 6.
a(n) = 14*n - 2*a(n-1) - 3*a(n-2) - 2*a(n-3) - a(n-4) - 29 for n >= 4.
A014682(a(n)) = n.
a(A014682(n)) = (n+2)/3 - 1 if n == 4 (mod 6).
a(A014682(n)) = n if n !== 4 (mod 6).
a^k(3*n) = (3*n)*2^k where a^2(3*n) is a(a(3*n)) = (3*n)*4.
G.f.: -(-x^5 - 4*x^4 - 6*x^3 - x^2 - 2*x)/(x^6 - 2*x^3 + 1).
a(n) = (A093544(n+1) - 1)/2. - Hugo Pfoertner, Mar 10 2021

A340615 a(n) = k/2 if k is even, otherwise (3k+1)/2, where k = n + floor((n+1)/5).

Original entry on oeis.org

0, 2, 1, 5, 8, 3, 11, 4, 14, 17, 6, 20, 7, 23, 26, 9, 29, 10, 32, 35, 12, 38, 13, 41, 44, 15, 47, 16, 50, 53, 18, 56, 19, 59, 62, 21, 65, 22, 68, 71, 24, 74, 25, 77, 80, 27, 83, 28, 86, 89, 30, 92, 31, 95, 98, 33, 101, 34, 104, 107, 36, 110, 37, 113, 116, 39, 119, 40, 122
Offset: 0

Views

Author

Thomas Scheuerle, Jan 13 2021

Keywords

Comments

A permutation of the nonnegative integers related to the Collatz function (A014682).
As this sequence is a permutation, it can be decomposed into cycles.
Known finite cycles so far: (0), (1 2), (3 5), (24 44 80 48 86 155 93 167 100 60 36 65 39 71 128 230 138 248 446 803 1445 867 520 312 187 112 67 40).
Except for the 0-cycle, it is a necessary (but not sufficient) condition for the smallest number in a cycle that it is in the intersection of A032766 and A047206 (as suggested by Sebastian Karlsson, Jan 15 2021).
If we generate new sequences by including a variable m into the definition of the original sequence, k = n+floor((n+1)/m*5), a(n) = k/2 if k is even, otherwise (3k+1)/2, then the sequences with m > 1 are not permutations and are in some sense intermediates between A014682 and the original sequence. This may aid in research related to Collatz conjecture as it may help to understand how cycles are modified or disappearing by increasing values of m.
Like any permutation this sequence can be written as a product of two involutions. Example:
a(n) = p(q(n)) with p = (0)(3 1)(5 2)(6 4)(11 7)(10 8)(26 9)(20 12)... and q = (0)(5 1)(3 2)(11 4)(8 6)(20 7)(47 9)(14 10)... does there exist a nice example with known sequences?
The difference between "Collatz function" A014682 and this sequence is that A014682 contains all numbers of the type 3*m + 2 twice (A016789). The modification "+floor((n+1)/5)" removes these duplicates from the sequence. The distances between the removed numbers and the predecessors that stay inside the sequence are of the form 4*m + 3 and found in A004767. Example: A014682(3) = 5 and A014682(10) = 5. 5 = A016789(1) and 10-3 = 7 = A004767(1).
A093545 is the inverse permutation: n = A093545(a(n)).

Crossrefs

Cf. A014682, A093545 (inverse).

Programs

  • MATLAB
    function a = A340615(max_n)
        for n = 1:max_n
            k = (n-1)+floor(((n-1)+1)/5);
            if floor(k/2) == k/2
                a(n) = k/2;
            else
                a(n) = (k*3+1)/2;
            end
        end
    end
  • Mathematica
    Array[If[EvenQ@ #, #/2, (3 # + 1)/2] &[# + Floor[(# + 1)/5]] &, 69, 0] (* Michael De Vlieger, Jan 13 2021 *)

Formula

a(n) = 2*a(n-5) - a(n-10).
Showing 1-3 of 3 results.