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!)
A074066 Zigzag modulo 3. 6

%I #34 Dec 24 2023 01:07:19

%S 1,4,3,2,7,6,5,10,9,8,13,12,11,16,15,14,19,18,17,22,21,20,25,24,23,28,

%T 27,26,31,30,29,34,33,32,37,36,35,40,39,38,43,42,41,46,45,44,49,48,47,

%U 52,51,50,55,54,53,58,57,56,61,60,59,64,63,62,67,66,65,70,69

%N Zigzag modulo 3.

%C Take natural numbers, exchange trisections starting with 2 and 4.

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/AlternatingPermutation.html">Alternating Permutations</a>.

%H Reinhard Zumkeller, <a href="/A074066/a074066.ps">Illustration for A074066-A074068</a>.

%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (1,0,1,-1).

%H <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>.

%F a(1)=1; for n>0: a(3*n-1) = 3*n+1, a(3*n) = 3*n, a(3*n+1) = 3*n-1.

%F a(a(n))=n (self-inverse permutation); for n>1: a(n) = n iff n == 0 modulo 3.

%F For n > 1: a(n) = 3*floor(n/3) + (n mod 3)^2 * (-1)^(n mod 3); a(1)=1.

%F a(n) = a(n-1) + a(n-3) - a(n-4) for n > 5. - _Chai Wah Wu_, May 25 2016

%F For n > 1, a(n) = n - (4/sqrt(3))*sin(2*n*Pi/3). - _Wesley Ivan Hurt_, Sep 29 2017

%F g.f.: x + x^2*(4-x-x^2+x^3) / ( (1+x+x^2)*(x-1)^2 ). - _R. J. Mathar_, May 22 2019

%F Sum_{n>=1} (-1)^(n+1)/a(n) = log(2) (A002162). - _Amiram Eldar_, Dec 24 2023

%t a[n_] := n + Mod[n, 3]*(3*Mod[n, 3] - 5); a[1] = 1; Table[a[n], {n, 1, 69}] (* _Jean-François Alcover_, Nov 04 2011 *)

%t Join[{1},Flatten[Reverse/@Partition[Range[2,73],3]]] (* _Harvey P. Dale_, Feb 17 2012 *)

%o (Haskell)

%o a074066 n = a074066_list !! (n-1)

%o a074066_list = 1 : xs where xs = 4 : 3 : 2 : map (+ 3) xs

%o -- _Reinhard Zumkeller_, Feb 21 2011

%Y Cf. A002162, A064429, A074067, A074068.

%K nonn,easy,nice

%O 1,2

%A _Reinhard Zumkeller_, Aug 17 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 March 29 05:48 EDT 2024. Contains 371265 sequences. (Running on oeis4.)