A324245 The modified Collatz map considered by Vaillant and Delarue.
0, 2, 0, 5, 3, 8, 1, 11, 6, 14, 2, 17, 9, 20, 3, 23, 12, 26, 4, 29, 15, 32, 5, 35, 18, 38, 6, 41, 21, 44, 7, 47, 24, 50, 8, 53, 27, 56, 9, 59, 30, 62, 10, 65, 33, 68, 11, 71, 36, 74, 12, 77, 39, 80, 13, 83, 42, 86, 14, 89, 45, 92, 15, 95, 48, 98, 16, 101, 51, 104, 17, 107, 54, 110, 18, 113, 57, 116, 19, 119, 60
Offset: 0
Links
- Antti Karttunen, Table of n, a(n) for n = 0..20000
- Nicolas Vaillant and Philippe Delarue, The hidden face of the 3x+1 problem. Part I: Intrinsic algorithm, April 26 2019.
- Index entries for linear recurrences with constant coefficients, signature (0,0,0,2,0,0,0,-1).
Programs
-
Mathematica
a[n_]:=If[OddQ@n,(3n+1)/2,If[Mod[n,4]==0,3n/4,(n-2)/4]];Array[a,51,0] (* Giorgos Kalogeropoulos, Dec 08 2021 *)
-
PARI
A324245(n) = if(n%2, (1+3*n)/2, if(!(n%4), 3*(n/4), (n-2)/4)); \\ (After Mathematica-code) - Antti Karttunen, Dec 09 2021
Formula
a(n) = (3*n+1)/2 if n is odd, 3*n/4 if n == 0 (mod 4), and (n-2)/4 if n == 2 (mod 4).
a(n) = A349414(n) + n. - Ruud H.G. van Tol, Dec 08 2021
G.f.: x*(2 + 5*x^2 + 3*x^3 + 4*x^4 + x^5 + x^6)/(1 - x^4)^2. - Stefano Spezia, Dec 08 2021
Extensions
More terms from Antti Karttunen, Dec 09 2021
Comments