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.

A255138 a(n) = (1 + 2^n*(3 + 2*(-1)^n))/3.

Original entry on oeis.org

2, 1, 7, 3, 27, 11, 107, 43, 427, 171, 1707, 683, 6827, 2731, 27307, 10923, 109227, 43691, 436907, 174763, 1747627, 699051, 6990507, 2796203, 27962027, 11184811, 111848107, 44739243, 447392427, 178956971
Offset: 0

Views

Author

L. Edson Jeffery, May 04 2015

Keywords

Comments

Let N_1 be the set of odd natural numbers and v(y) the 2-adic valuation of y. Define the map F : N_1 -> N_1 by F(x) = (3*x+1)/2^v(3*x+1) (see A075677). Let F^(k)(x) denote k-fold iteration of F, with recurrence F^(k)(x) = F(F^(k-1)(x)), k > 0, and initial condition F^(0)(x) = x. Then, for n>0, a(n) is the least m such that F^(n)(4*m-3) == 1 (mod 4). Cf. A257499.
Let k == 1 mod 4, and k(r) be the r-th iteration at which k appears in a Collatz sequence. When n >= 2 and k(r) == [2^(n+1) - a(n)] mod 2^(n+1), then n is the number of halving steps following k(r+1). For instance, since a(5) = 11, there are 5 halving steps following k(r+1) when k(r) == 53 mod 64, because 2^(5+1) = 64 and 64-11 = 53; e.g., k(r) = 117: 117 -> 352 -> 176 -> 88 -> 44 -> 22 -> 11. - Bob Selcoe, Feb 09 2017

Crossrefs

Programs

  • Magma
    [(1 + 2^n*(3 + 2*(-1)^n))/3: n in [0..50]]; // Wesley Ivan Hurt, Nov 05 2015
  • Maple
    A255138:=n->(1 + 2^n*(3 + 2*(-1)^n))/3: seq(A255138(n), n=0..50); # Wesley Ivan Hurt, Nov 05 2015
  • Mathematica
    a[n_] := (1 + 2^n*(3 + 2*(-1)^n))/3; Table[a[n], {n, 0, 29}]
    LinearRecurrence[{1,4,-4},{2,1,7},30] (* Harvey P. Dale, Aug 03 2024 *)
  • PARI
    vector(30, n, n--; (1 + 2^n*(3 + 2*(-1)^n))/3) \\ Altug Alkan, Nov 05 2015
    

Formula

a(2*n) = A136412(n); a(2*n+1) = A007583(n).
G.f.: (2-x-2*x^2)/((x-1)*(2*x-1)*(2*x+1)). - R. J. Mathar, Jul 25 2015
a(n) = a(n-1) + 4*a(n-2) - 4*a(n-3) for n > 2. - Wesley Ivan Hurt, Nov 05 2015
a(n) = 4*a(n-2) - 1. - Bob Selcoe, Feb 09 2017
a(n) = 2^(n+1) - A096773(n+1). - Ruud H.G. van Tol, Sep 04 2023