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 A080782 #65 Jul 29 2025 15:57:22 %S A080782 1,3,2,4,6,5,7,9,8,10,12,11,13,15,14,16,18,17,19,21,20,22,24,23,25,27, %T A080782 26,28,30,29,31,33,32,34,36,35,37,39,38,40,42,41,43,45,44,46,48,47,49, %U A080782 51,50,52,54,53,55,57,56,58,60,59,61,63,62,64,66,65,67,69,68 %N A080782 a(1)=1, a(n)=a(n-1)-1 if n is already in the sequence, a(n)=a(n-1)+2 otherwise. %C A080782 Permutation of the integers: exchange trisections starting with 2 and 3. %C A080782 a(a(n)) = n. - _Reinhard Zumkeller_, Oct 29 2004 %H A080782 Guenther Schrack, <a href="/A080782/b080782.txt">Table of n, a(n) for n = 1..10000</a> %H A080782 Robbert Fokkink and Gandhar Joshi, <a href="https://arxiv.org/abs/2507.16956">On Cloitre's hiccup sequences</a>, arXiv:2507.16956 [math.CO], 2025. See p. 2. %H A080782 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (1,0,1,-1). %H A080782 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>. %F A080782 a(n) = A064429(n-1) + 1. %F A080782 a(n) - n is periodic with period 3. %F A080782 G.f.: x*(1+2*x-x^2+x^3)/(1-x-x^3+x^4). - _Jaume Oliver Lafont_, Mar 24 2009 %F A080782 a(0)=1, a(1)=3, a(2)=2, a(3)=4, a(n)=a(n-1)+0*a(n-2)+a(n-3)-a(n-4). - _Harvey P. Dale_, Mar 29 2013 %F A080782 a(n) = n + (2/sqrt(3))*sin(2*(n+2)*Pi/3). - _Wesley Ivan Hurt_, Sep 26 2017 %F A080782 From _Guenther Schrack_, Oct 23 2019: (Start) %F A080782 a(n) = a(n-3) + 3 with a(1) = 1, a(2) = 3, a(3) = 2 for n > 3. %F A080782 a(n) = n - (w^(2*n)*(2 + w) + w^n*(1 - w))/3 where w = (-1 + sqrt(-3))/2. (End) %F A080782 Sum_{n>=1} (-1)^(n+1)/a(n) = 2*Pi/(3*sqrt(3)) - log(2)/3. - _Amiram Eldar_, Jan 31 2023 %F A080782 From _Charles L. Hohn_, Sep 03 2024: (Start) %F A080782 a(n) = n-1+n%3. %F A080782 a(n) = A375336(n-2, 1) for n >= 6. (End) %t A080782 Array[#+Mod[#+1,3]&,70,0] (* or *) LinearRecurrence[{1,0,1,-1},{1,3,2,4},70] (* _Harvey P. Dale_, Mar 29 2013 *) %t A080782 {#,#+1,#-1}[[Mod[#,3,1]]]&/@Range[99] (* _Federico Provvedi_, May 15 2021 *) %Y A080782 Cf. A064429, A079357, A079354, A080783, A064437. %Y A080782 Cf. A004442, A080412. %K A080782 nonn,easy %O A080782 1,2 %A A080782 _Benoit Cloitre_, Mar 07 2003