

A334840


a(1) = 1, a(n) = a(n1)/gcd(a(n1),n) if this gcd is > 1, else a(n) = 4*a(n1).


0



1, 4, 16, 4, 16, 8, 32, 4, 16, 8, 32, 8, 32, 16, 64, 4, 16, 8, 32, 8, 32, 16, 64, 8, 32, 16, 64, 16, 64, 32, 128, 4, 16, 8, 32, 8, 32, 16, 64, 8, 32, 16, 64, 16, 64, 32, 128, 8, 32, 16, 64, 16, 64, 32, 128, 16, 64, 32, 128, 32, 128, 64, 256, 4, 16
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,2


COMMENTS

A variant of A133058. The graph of [n, log a(n)] looks like the graph for [n, digitsum(n, base=2)]. This corresponds to the fact, that a(n) = 2^k for all n >= 1. Graph of partial sum [n, Sum_{i=1..n} (a(i))] and also graph of [n, Sum_{i=1..n} (a(i)) / n] looks like Takagi curve.


LINKS

Table of n, a(n) for n=1..65.


EXAMPLE

a(2) = 4*a(1) = 4, a(3) = 4*a(2) = 16, a(4) = a(3)/4 = 4, a(5) = 4*a(4) = 16, ...


MATHEMATICA

a[1] = 1; a[n_] := a[n] = If[(g = GCD[a[n1], n]) > 1, a[n1]/g, 4*a[n1]]; Array[a, 100] (* Amiram Eldar, May 13 2020 *)


PROG

(MAGMA) a:=[1]; for n in [2..70] do if Gcd(a[n1], n) eq 1 then Append(~a, 4* a[n1]); else Append(~a, a[n1] div Gcd(a[n1], n)); end if; end for; a; // Marius A. Burtea, May 13 2020
(PARI) lista(nn) = {my(va = vector(nn)); va[1] = 1; for (n=2, nn, my(g = gcd(va[n1], n)); if (g > 1, va[n] = va[n1]/g, va[n] = 4*va[n1]); ); va; } \\ Michel Marcus, May 17 2020


CROSSREFS

Cf. A000120, A133058, A255140, A257806, A319018.
Sequence in context: A065659 A305833 A110650 * A232515 A010295 A059152
Adjacent sequences: A334837 A334838 A334839 * A334841 A334842 A334843


KEYWORD

nonn


AUTHOR

Ctibor O. Zizka, May 13 2020


STATUS

approved



