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!)
A078734 Start with 1,2, concatenate 2^k previous terms and change last term as follows: 1->2, 2->3, 3->1. 1

%I #40 Dec 30 2022 03:54:54

%S 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 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 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 Start with 1,2, concatenate 2^k previous terms and change last term as follows: 1->2, 2->3, 3->1.

%H Antti Karttunen, <a href="/A078734/b078734.txt">Table of n, a(n) for n = 1..20000</a> (first 1024 terms from Andrew Howroyd)

%F (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 Multiplicative with a(2^e) = (e mod 3) + 1, a(p^e) = 1 for odd prime p. - _Andrew Howroyd_, Jul 31 2018

%F From _Antti Karttunen_, Dec 07 2021: (Start)

%F a(n) = 1 + A096271(n-1) = 1 + A010872(A007814(n)). [as above]

%F a(n) = A001511(A050985(n)).

%F (End)

%F Dirichlet g.f.: zeta(s)*(4^s+2^(s+1)+3)/(4^s+2^s+1). - _Amiram Eldar_, Dec 30 2022

%e 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 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 a[n_] := Mod[IntegerExponent[n, 2], 3] + 1; Array[a, 100] (* _Amiram Eldar_, Oct 28 2022 *)

%o (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 (PARI) a(n) = valuation(n, 2) % 3 + 1; \\ _Andrew Howroyd_, Jul 31 2018

%o (Magma) [Valuation(n, 2) mod 3 + 1: n in [1..100]]; // _Vincenzo Librandi_, Aug 01 2018

%Y Cf. A056832, A035263.

%K nonn,mult

%O 1,2

%A _Benoit Cloitre_, Dec 21 2002

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 April 23 16:40 EDT 2024. Contains 371916 sequences. (Running on oeis4.)