A350034 a(n) = n/gcd(n,6) if gcd(n,6)>1, 5n + 1 otherwise.
0, 6, 1, 1, 2, 26, 1, 36, 4, 3, 5, 56, 2, 66, 7, 5, 8, 86, 3, 96, 10, 7, 11, 116, 4, 126, 13, 9, 14, 146, 5, 156, 16, 11, 17, 176, 6, 186, 19, 13, 20, 206, 7, 216, 22, 15, 23, 236, 8, 246, 25, 17, 26, 266, 9, 276, 28, 19, 29, 296, 10, 306, 31, 21, 32, 326
Offset: 0
Links
- Winston de Greef, Table of n, a(n) for n = 0..9999
- Index entries for linear recurrences with constant coefficients, signature (0,0,0,0,0,2,0,0,0,0,0,-1).
Programs
-
Mathematica
f[n_]:=If[GCD[n,6]>1,n/GCD[n,6],5*n+1]; Table[f[n],{n,0,100}]
-
PARI
a(n) = my(g = gcd(n, 6)); if (g>1, n/g, 5*n+1); \\ Michel Marcus, Dec 09 2021
-
Python
from math import gcd def A350034(n): return n//g if (g:=gcd(n,6)) > 1 else 5*n+1 # Chai Wah Wu, Dec 29 2021
Formula
a(n) = 2*a(n-6) - a(n-12). - Wesley Ivan Hurt, Oct 20 2022
Sum_{k=1..n} a(k) ~ (23/24)*n^2. - Amiram Eldar, Oct 07 2023
Comments