login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A334943
a(1) = 1, a(n) = a(n-1) / gcd(a(n-1),n) if this gcd is > 1, else a(n) = 3*a(n-1) + n + 1.
2
1, 6, 2, 1, 9, 3, 17, 60, 20, 2, 18, 3, 23, 84, 28, 7, 39, 13, 59, 198, 66, 3, 33, 11, 59, 204, 68, 17, 81, 27, 113, 372, 124, 62, 222, 37, 1, 42, 14, 7, 63, 3, 53, 204, 68, 34, 150, 25, 125, 5, 67, 254, 816, 136, 464, 58, 232, 4, 72, 6, 80, 40, 184, 23, 135
OFFSET
1,2
COMMENTS
A variant of A133058. The behavior of simple computational models of the form a(1), a(n) = a(n-1) / gcd(a(n-1),n) if this gcd is > 1, else a(n) = X*a(n-1) + Y*n + R, depending on parameters [X, Y, R], shows Wolfram complexity classes for cellular automata.
LINKS
EXAMPLE
a(2) = 3*a(1) + 2 + 1 = 6, a(3) = a(2)/3 = 2, a(4) = a(3)/2 = 1, a(5) = 3*a(4) + 5 + 1 = 9, ...
MAPLE
N:= 100: # for a(1)..a(N)
V:= Vector(N):
V[1]:= 1:
for n from 2 to N do
g:= igcd(V[n-1], n);
if g > 1 then V[n]:= V[n-1]/g else V[n]:= 3*V[n-1]+n+1 fi
od:
convert(V, list); # Robert Israel, Jun 22 2020
MATHEMATICA
a[1] = 1; a[n_] := a[n] = If[(g = GCD[a[n-1], n]) > 1, a[n-1]/g, 3*a[n-1] + n + 1]; Array[a, 100].
nxt[{n_, a_}]:=With[{c=GCD[a, n+1]}, {n+1, If[c>1, a/c, 3a+n+2]}]; NestList[nxt, {1, 1}, 70][[;; , 2]] (* Harvey P. Dale, May 14 2024 *)
PROG
(PARI) lista(nn) = {my(va = vector(nn)); va[1] = 1; for (n=2, nn, my(g = gcd(va[n-1], n)); if (g > 1, va[n] = va[n-1]/g, va[n] = 3*va[n-1]+n+1); ); va; } \\ Michel Marcus, May 17 2020
(Magma) a:=[1]; for n in [2..70] do if Gcd(a[n-1], n) eq 1 then Append(~a, 3* a[n-1]+n+1); else Append(~a, a[n-1] div Gcd(a[n-1], n)); end if; end for; a; // Marius A. Burtea, May 17 2020
CROSSREFS
Cf. A133058.
Sequence in context: A265986 A334942 A217909 * A002247 A124913 A181415
KEYWORD
nonn
AUTHOR
Ctibor O. Zizka, May 17 2020
STATUS
approved