|
|
A078734
|
|
Start with 1,2, concatenate 2^k previous terms and change last term as follows: 1->2, 2->3, 3->1.
|
|
1
|
|
|
1, 2, 1, 3, 1, 2, 1, 1, 1, 2, 1, 3, 1, 2, 1, 2, 1, 2, 1, 3, 1, 2, 1, 1, 1, 2, 1, 3, 1, 2, 1, 3, 1, 2, 1, 3, 1, 2, 1, 1, 1, 2, 1, 3, 1, 2, 1, 2, 1, 2, 1, 3, 1, 2, 1, 1, 1, 2, 1, 3, 1, 2, 1, 1, 1, 2, 1, 3, 1, 2, 1, 1, 1, 2, 1, 3, 1, 2, 1, 2, 1, 2, 1, 3, 1, 2, 1, 1, 1, 2, 1, 3, 1, 2, 1, 3, 1, 2, 1, 3, 1, 2, 1, 1, 1
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
LINKS
|
|
|
FORMULA
|
(Sum_{k=1..n} a(k))/n -> 1.57.... [This limit is the asymptotic mean of this sequence, 11/7. - Amiram Eldar, Oct 28 2022]
Multiplicative with a(2^e) = (e mod 3) + 1, a(p^e) = 1 for odd prime p. - Andrew Howroyd, Jul 31 2018
(End)
Dirichlet g.f.: zeta(s)*(4^s+2^(s+1)+3)/(4^s+2^s+1). - Amiram Eldar, Dec 30 2022
|
|
EXAMPLE
|
Concatenating the first 2 terms 1,2 -> 1,2,1,2 and changing 2->3 gives the first 4 terms: 1,2,1,3.
Concatenating those first 4 terms ->1,2,1,3,1,2,1,3 and changing 3->1 gives the first 8 terms: 1,2,1,3,1,2,1,1.
|
|
MATHEMATICA
|
a[n_] := Mod[IntegerExponent[n, 2], 3] + 1; Array[a, 100] (* Amiram Eldar, Oct 28 2022 *)
|
|
PROG
|
(PARI) seq(n)={my(v=[1, 2]); while(#v < n, v=concat(v, v); v[#v] = v[#v] % 3 + 1); vector(n, i, v[i])} \\ Andrew Howroyd, Jul 31 2018
(Magma) [Valuation(n, 2) mod 3 + 1: n in [1..100]]; // Vincenzo Librandi, Aug 01 2018
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,mult
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|