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 A080578 #41 Jul 29 2025 16:15:04 %S A080578 1,4,7,8,11,14,15,16,19,22,23,26,29,30,31,32,35,38,39,42,45,46,47,50, %T A080578 53,54,57,60,61,62,63,64,67,70,71,74,77,78,79,82,85,86,89,92,93,94,95, %U A080578 98,101,102,105,108,109,110,113,116,117,120,123,124,125,126 %N A080578 a(1)=1; for n > 1, a(n) = a(n-1) + 1 if n is already in the sequence, a(n) = a(n-1) + 3 otherwise. %C A080578 More generally for fixed r, there is a nice connection between the sequence a(1)=1, a(n) = a(n-1) + 1 if n is in the sequence, a(n) = a(n-1) + r + 1 otherwise and the so-called metafibonacci sequences. Indeed, (a(n)-n)/r is a generalized metafibonacci sequence of order r as defined in Ruskey's recent paper (reference given at A046699). - _Benoit Cloitre_, Feb 04 2007 %C A080578 In the Fokkink-Joshi paper, this sequence is the Cloitre (0,1,1,3)-hiccup sequence. - _Michael De Vlieger_, Jul 29 2025 %H A080578 Reinhard Zumkeller, <a href="/A080578/b080578.txt">Table of n, a(n) for n = 1..10000</a> %H A080578 Benoit Cloitre, N. J. A. Sloane and M. J. Vandermast, <a href="http://www.cs.uwaterloo.ca/journals/JIS/VOL6/Cloitre/cloitre2.html">Numerical analogues of Aronson's sequence</a>, J. Integer Seqs., Vol. 6 (2003), #03.2.2. %H A080578 Benoit Cloitre, N. J. A. Sloane and M. J. Vandermast, <a href="https://arxiv.org/abs/math/0305308">Numerical analogues of Aronson's sequence</a>, arXiv:math/0305308 [math.NT], 2003. %H A080578 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 pp. 3, 5, 11. %F A080578 a(n) = 2n + O(1); a(2^n) = 2^(n+1). - _Benoit Cloitre_, Oct 12 2003 %F A080578 a(1) = 1, for n >= 2 a(n) = a(n + 1 - 2^floor(log(n)/log(2))) + 2*2^floor(log(n)/log(2)) - 1; (a(n) - n)/2 = A046699(n) for n >= 2. - _Benoit Cloitre_, Feb 04 2007 %F A080578 a(n) = A055938(n-1) + 2 (conjectured). - _Ralf Stephan_, Dec 27 2013 %t A080578 l={1}; a=1; For[n=2, n<=100, If[MemberQ[l, n], a=a+1, a=a+3]; AppendTo[l, a]; n++]; l (* _Indranil Ghosh_, Apr 07 2017 *) %o A080578 (PARI) a(n)=if(n<2,1,a(n+1-2^floor(log(n)/log(2)))+2*2^floor(log(n)/log(2))-1) \\ _Benoit Cloitre_, Feb 04 2007 %o A080578 (Haskell) %o A080578 a080578 n = a080578_list !! (n-1) %o A080578 a080578_list = 1 : f 2 [1] where %o A080578 f x zs@(z:_) = y : f (x + 1) (y : zs) where %o A080578 y = if x `elem` zs then z + 1 else z + 3 %o A080578 -- _Reinhard Zumkeller_, Sep 26 2014 %o A080578 (Python) %o A080578 l=[1] %o A080578 a=1 %o A080578 for n in range(2, 101): %o A080578 a += 3 if n not in l else 1 %o A080578 l.append(a) %o A080578 print(l) # _Indranil Ghosh_, Apr 07 2017 %Y A080578 Cf. A080455, A080456, A080457, A080458, A080036, A080037, A080468. %K A080578 nonn %O A080578 1,2 %A A080578 _N. J. A. Sloane_ and _Benoit Cloitre_, Mar 23 2003