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 A033158 #19 Jul 08 2025 19:42:33 %S A033158 1,5,6,8,12,13,17,24,27,32,34,38,39,45,50,57,74,79,81,86,96,100,107, %T A033158 125,129,132,137,144,170,189,198,204,221,222,227,228,239,248,260,270, %U A033158 277,285,288,303,309,311,314,320,338,386,393,398,423,435,456,467,471,492,494,500 %N A033158 Begins with (1, 5); avoids 3-term arithmetic progressions. %D A033158 Iacobescu, F. 'Smarandache Partition Type and Other Sequences.' Bull. Pure Appl. Sci. 16E, 237-240, 1997. %D A033158 H. Ibstedt, A Few Smarandache Sequences, Smarandache Notions Journal, Vol. 8, No. 1-2-3, 1997, 170-183. %H A033158 Alois P. Heinz, <a href="/A033158/b033158.txt">Table of n, a(n) for n = 1..2000</a> %H A033158 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/NonarithmeticProgressionSequence.html">Nonarithmetic Progression Sequence</a> %t A033158 ss[s1_, M_] := Module[{n, chvec, swi, p, s2, i, j, t1, mmm}, t1 = Length[s1]; mmm = 1000; s2 = Table[s1, {t1 + M}] // Flatten; chvec = Array[0 &, mmm]; For[i = 1, i <= t1, i++, chvec[[s2[[i]]]] = 1]; (* get n-th term *) For[n = t1 + 1, n <= t1 + M, n++, (* try i as next term *) For[i = s2[[n - 1]] + 1, i <= mmm, i++, swi = -1; (* test against j-th term *) For[j = 1, j <= n - 2, j++, p = s2[[n - j]]; If[2*p - i < 0, Break[]]; If[chvec[[2*p - i]] == 1, swi = 1; Break[]]]; If[swi == -1, s2[[n]] = i; chvec[[i]] = 1; Break[]]]; If[swi == 1, Print["Error, no solution at n = ", n]]]; Table[s2[[i]], {i, 1, t1 + M}]]; A033158 = ss[{0, 4}, 80] + 1 (* _Jean-François Alcover_, Oct 08 2013, after Maple program in A185256 *) %Y A033158 Equals A005487(n-1)+1. %K A033158 nonn %O A033158 1,2 %A A033158 _N. J. A. Sloane_