%I #22 May 22 2019 02:32:26
%S 1,2,3,10,9,8,7,6,5,4,17,16,15,14,13,12,11,24,23,22,21,20,19,18,31,30,
%T 29,28,27,26,25,38,37,36,35,34,33,32,45,44,43,42,41,40,39,52,51,50,49,
%U 48,47,46,59,58,57,56,55,54,53,66,65,64,63,62,61,60,73,72,71
%N Zigzag modulo 7.
%C a(a(n))=n (a self-inverse permutation);
%C for n>1: a(n) = n iff n == 0 modulo 7.
%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/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%H <a href="/index/Rec#order_08">Index entries for linear recurrences with constant coefficients</a>, signature (1,0,0,0,0,0,1,-1).
%F a(n) = 7*floor(n/7) + 14*floor((n mod 7)/4) - (n mod 7) for n>3; a(n)=n for n<=3.
%F a(n) = a(n-1) + a(n-7) - a(n-8) for n > 11. - _Chai Wah Wu_, May 25 2016
%F g.f.: x+2*x^2+3*x^3 + x^4*(10-x-x^2-x^3-x^4-x^5-x^6+3*x^7) / ( (x^6+x^5+x^4+x^3+x^2+x+1)*(x-1)^2 ). - _R. J. Mathar_, May 22 2019
%t Range[3]~Join~Flatten[Reverse /@ Partition[Range[4, 73], 7]] (* after _Harvey P. Dale_ at A074066, or *)
%t Range[3]~Join~Table[7 Floor[n/7] + 14 Floor[#/4] - # &@ Mod[n, 7], {n, 4, 69}] (* _Michael De Vlieger_, May 25 2016 *)
%o (Haskell)
%o a074068 n = a074068_list !! (n-1)
%o a074068_list = 1 : 2 : 3 : xs where
%o xs = 10 : 9 : 8 : 7 : 6 : 5 : 4 : map (+ 7) xs
%o -- _Reinhard Zumkeller_, Feb 21 2011
%Y Cf. A074066, A074067.
%K nonn,look
%O 1,2
%A _Reinhard Zumkeller_, Aug 17 2002
|