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!)
A334942 a(1) = 1, a(n) = a(n-1) / gcd(a(n-1),n) if this gcd is > 1, else a(n) = 2*a(n-1) + 4. 0
1, 6, 2, 1, 6, 1, 6, 3, 1, 6, 16, 4, 12, 6, 2, 1, 6, 1, 6, 3, 1, 6, 16, 2, 8, 4, 12, 3, 10, 1, 6, 3, 1, 6, 16, 4, 12, 6, 2, 1, 6, 1, 6, 3, 1, 6, 16, 1, 6, 3, 1, 6, 16, 8, 20, 5, 14, 7, 18, 3, 10, 5, 14, 7, 18, 3, 10, 5, 14, 1, 6, 1, 6, 3, 1, 6, 16, 8, 20, 1, 6 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
A variant of A133058.
LINKS
EXAMPLE
a(2) = 2*a(1) + 4 = 6, a(3) = a(2)/3 = 2, a(4) = a(3)/2 = 1, a(5) = 2*a(4) + 4 = 6, ...
MATHEMATICA
a[1] = 1; a[n_] := a[n] = If[(g = GCD[a[n-1], n]) > 1, a[n-1]/g, 2*a[n-1] + 4]; 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] = 2*va[n-1] + 4); ); va; } \\ Michel Marcus, May 17 2020
CROSSREFS
Cf. A133058.
Sequence in context: A224518 A363684 A265986 * A217909 A334943 A002247
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 July 5 19:07 EDT 2024. Contains 374028 sequences. (Running on oeis4.)