This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A078734 #40 Dec 30 2022 03:54:54 %S A078734 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, %T A078734 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, %U A078734 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 %N A078734 Start with 1,2, concatenate 2^k previous terms and change last term as follows: 1->2, 2->3, 3->1. %H A078734 Antti Karttunen, <a href="/A078734/b078734.txt">Table of n, a(n) for n = 1..20000</a> (first 1024 terms from Andrew Howroyd) %F A078734 (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] %F A078734 Multiplicative with a(2^e) = (e mod 3) + 1, a(p^e) = 1 for odd prime p. - _Andrew Howroyd_, Jul 31 2018 %F A078734 From _Antti Karttunen_, Dec 07 2021: (Start) %F A078734 a(n) = 1 + A096271(n-1) = 1 + A010872(A007814(n)). [as above] %F A078734 a(n) = A001511(A050985(n)). %F A078734 (End) %F A078734 Dirichlet g.f.: zeta(s)*(4^s+2^(s+1)+3)/(4^s+2^s+1). - _Amiram Eldar_, Dec 30 2022 %e A078734 Concatenating the first 2 terms 1,2 -> 1,2,1,2 and changing 2->3 gives the first 4 terms: 1,2,1,3. %e A078734 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. %t A078734 a[n_] := Mod[IntegerExponent[n, 2], 3] + 1; Array[a, 100] (* _Amiram Eldar_, Oct 28 2022 *) %o A078734 (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 %o A078734 (PARI) a(n) = valuation(n, 2) % 3 + 1; \\ _Andrew Howroyd_, Jul 31 2018 %o A078734 (Magma) [Valuation(n, 2) mod 3 + 1: n in [1..100]]; // _Vincenzo Librandi_, Aug 01 2018 %Y A078734 Cf. A056832, A035263. %K A078734 nonn,mult %O A078734 1,2 %A A078734 _Benoit Cloitre_, Dec 21 2002