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 A122798 #16 Sep 28 2023 19:13:39 %S A122798 1,1,5,9,13,13,17,21,25,29,33,37,37,41,45,49,53,57,61,65,69,73,73,77, %T A122798 81,85,89,93,97,101,105,109,113,117,121,121,125,129,133,137,141,145, %U A122798 149,153,157,161,165,169,173,177,181,181,185,189,193,197,201,205,209 %N A122798 A P_5-stuttered arithmetic progression with a(n+1) = a(n) if n is a pentagonal number, a(n+1) = a(n)+4 otherwise. %C A122798 P_5(i) = the i-th pentagonal number. %H A122798 Harvey P. Dale, <a href="/A122798/b122798.txt">Table of n, a(n) for n = 1..1000</a> %H A122798 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 A122798 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. %F A122798 a(n) = A045929(n) - n + 1. %t A122798 nxt[{n_,a_}]:={n+1,If[IntegerQ[(1+Sqrt[24n+25])/6],a,a+4]}; Join[{1}, Transpose[ NestList[nxt,{1,1},60]][[2]]] (* _Harvey P. Dale_, May 07 2015 *) %t A122798 nxt[{n_,a_}]:=With[{pn=PolygonalNumber[5,Range[0,30]]},{n+1,If[MemberQ[pn,n],a,a+4]}]; NestList[nxt,{1,1},100][[;;,2]] (* _Harvey P. Dale_, Sep 28 2023 *) %o A122798 (PARI) lista(m) = {aa = 1; for (i=1, m, print1(aa, ", "); if (! ispolygonal(i, 5), aa += 4););} \\ _Michel Marcus_, Apr 01 2013, May 02 2015 %Y A122798 Cf. A001614, A122793, A122794, A122795, A122796, A122797, A122799, A122800. %K A122798 nonn,easy %O A122798 1,3 %A A122798 Grady Bullington (bullingt(AT)uwosh.edu), Sep 14 2006 %E A122798 Definition corrected by _Michel Marcus_, Apr 01 2013