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 A074068 #36 May 11 2025 01:14:47 %S A074068 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 A074068 29,28,27,26,25,38,37,36,35,34,33,32,45,44,43,42,41,40,39,52,51,50,49, %U A074068 48,47,46,59,58,57,56,55,54,53,66,65,64,63,62,61,60,73,72,71 %N A074068 Zigzag modulo 7. %H A074068 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/AlternatingPermutation.html">Alternating Permutations</a>. %H A074068 Reinhard Zumkeller, <a href="/A074066/a074066.ps">Illustration for A074066-A074068</a>. %H A074068 <a href="/index/Rec#order_08">Index entries for linear recurrences with constant coefficients</a>, signature (1,0,0,0,0,0,1,-1). %H A074068 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>. %F A074068 a(a(n)) = n (a self-inverse permutation). %F A074068 For n > 1: a(n) = n iff n == 0 modulo 7. %F A074068 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 A074068 a(n) = a(n-1) + a(n-7) - a(n-8) for n > 11. - _Chai Wah Wu_, May 25 2016 %F A074068 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 %F A074068 Sum_{n>=1} (-1)^(n+1)/a(n) = log(2) (A002162). - _Amiram Eldar_, May 11 2025 %t A074068 Range[3]~Join~Flatten[Reverse /@ Partition[Range[4, 73], 7]] (* after _Harvey P. Dale_ at A074066, or *) %t A074068 Range[3]~Join~Table[7 Floor[n/7] + 14 Floor[#/4] - # &@ Mod[n, 7], {n, 4, 69}] (* _Michael De Vlieger_, May 25 2016 *) %t A074068 LinearRecurrence[{1,0,0,0,0,0,1,-1},{1,2,3,10,9,8,7,6,5,4,17},80] (* _Harvey P. Dale_, Jan 19 2025 *) %o A074068 (Haskell) %o A074068 a074068 n = a074068_list !! (n-1) %o A074068 a074068_list = 1 : 2 : 3 : xs where %o A074068 xs = 10 : 9 : 8 : 7 : 6 : 5 : 4 : map (+ 7) xs %o A074068 -- _Reinhard Zumkeller_, Feb 21 2011 %Y A074068 Cf. A002162, A074066, A074067. %K A074068 nonn,easy,look %O A074068 1,2 %A A074068 _Reinhard Zumkeller_, Aug 17 2002