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 A122797 #35 Jul 27 2022 02:19:02 %S A122797 1,1,2,2,3,4,4,5,6,7,7,8,9,10,11,11,12,13,14,15,16,16,17,18,19,20,21, %T A122797 22,22,23,24,25,26,27,28,29,29,30,31,32,33,34,35,36,37,37,38,39,40,41, %U A122797 42,43,44,45,46,46,47,48,49,50,51,52,53,54,55,56,56,57,58,59,60,61,62,63,64,65,66,67,67,68,69,70,71,72,73,74,75,76,77,78,79,79,80,81,82,83,84,85,86,87 %N A122797 A P_3-stuttered arithmetic progression with a(n+1) = a(n) if n is a triangular number, a(n+1) = a(n) + 1 otherwise. %C A122797 P_3(i) = the i-th triangular number. %C A122797 As a triangle [1; 1,2; 2,3,4; ...], row sums = A064808: (1, 3, 9, 22, 45, 81, ...). - _Gary W. Adamson_, Aug 10 2007 %C A122797 a(n) = n - A003056(n-1). - _Reinhard Zumkeller_, Feb 12 2012 %H A122797 Reinhard Zumkeller, <a href="/A122797/b122797.txt">Table of n, a(n) for n = 1..10000</a> %H A122797 Grady D. Bullington, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL10/Bullington/bullington7.html">The Connell Sum Sequence</a>, J. Integer Seq. 10 (2007), Article 07.2.6. (includes direct formula for a(n)) %H A122797 Douglas E. Iannucci and Donna Mills-Taylor, <a href="http://www.cs.uwaterloo.ca/journals/JIS/IANN/iann1.html">On Generalizing the Connell Sequence</a>, J. Integer Sequences, Vol. 2, 1999, #99.1.7. %H A122797 J. W. Meijer and M. Nepveu, <a href="http://www.ucbcba.edu.bo/Publicaciones/revistas/actanova/documentos/v4n1/v4.n1.Meijer.pdf">Euler's ship on the Pentagonal Sea</a>, Acta Nova, Volume 4, No.1, December 2008. pp. 176-187. [From _Johannes W. Meijer_, Jun 21 2010] %F A122797 a(n) = A001614(n) - n + 1. %t A122797 nxt[{n_,a_}]:={n+1,If[OddQ[Sqrt[8n+1]],a,a+1]}; NestList[nxt,{1,1},100][[All,2]] (* _Harvey P. Dale_, Oct 10 2018 *) %o A122797 (Haskell) %o A122797 a122797 n = a122797_list !! (n-1) %o A122797 a122797_list = 1 : zipWith (+) a122797_list (map ((1 -) . a010054) [1..]) %o A122797 -- _Reinhard Zumkeller_, Feb 12 2012 %o A122797 (PARI) isTriang(n) = {if (! issquare(8*n+1), return (0)); return (1);} %o A122797 lista(m) = {aa = 1; for (i=1, m, print1(aa, ", "); if (! isTriang(i), aa = aa + 1););} \\ _Michel Marcus_, Apr 01 2013 %o A122797 (Python) %o A122797 from math import isqrt %o A122797 def A122797(n): return n+1-(k:=isqrt(m:=n<<1))-int((m<<2)>(k<<2)*(k+1)+1) # _Chai Wah Wu_, Jul 26 2022 %Y A122797 Cf. A001614, A122793, A122794, A122795, A122796, A122798, A122799, A122800. %Y A122797 Cf. A064808. %K A122797 nonn,easy %O A122797 1,3 %A A122797 Grady Bullington (bullingt(AT)uwosh.edu), Sep 14 2006 %E A122797 Definition corrected by _Michel Marcus_, Apr 01 2013