login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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 (list; graph; refs; listen; history; text; internal format)
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].
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

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 28 11:59 EDT 2024. Contains 371254 sequences. (Running on oeis4.)