cp's OEIS Frontend

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.

A020654 Lexicographically earliest infinite increasing sequence of nonnegative numbers containing no 5-term arithmetic progression.

This page as a plain text file.
%I A020654 #53 May 06 2025 21:52:39
%S A020654 0,1,2,3,5,6,7,8,10,11,12,13,15,16,17,18,25,26,27,28,30,31,32,33,35,
%T A020654 36,37,38,40,41,42,43,50,51,52,53,55,56,57,58,60,61,62,63,65,66,67,68,
%U A020654 75,76,77,78,80,81,82,83,85,86,87,88,90,91,92,93,125,126,127
%N A020654 Lexicographically earliest infinite increasing sequence of nonnegative numbers containing no 5-term arithmetic progression.
%C A020654 This is also the set of numbers with no "4" in their base-5 representation. In fact, for any prime p, the sequence consisting of numbers with no (p-1) in their base-p expansion is the same as the earliest sequence containing no p-term arithmetic progression. - _Nathaniel Johnston_, Jun 26-27 2011
%H A020654 Nathaniel Johnston, <a href="/A020654/b020654.txt">Table of n, a(n) for n = 1..10000</a>
%H A020654 Robert Baillie and Thomas Schmelzer, <a href="https://library.wolfram.com/infocenter/MathSource/7166/">Summing Kempner's Curious (Slowly-Convergent) Series</a>, Mathematica Notebook kempnerSums.nb, Wolfram Library Archive, 2008.
%H A020654 J. L. Gerver and L. T. Ramsey, <a href="http://dx.doi.org/10.1090/S0025-5718-1979-0537982-0">Sets of integers with no long arithmetic progressions generated by the greedy algorithm</a>, Math. Comp., 33 (1979), 1353-1359.
%H A020654 Samuel S. Wagstaff, Jr., <a href="http://dx.doi.org/10.1090/S0025-5718-1972-0325500-5">On k-free sequences of integers</a>, Math. Comp., 26 (1972), 767-771.
%H A020654 <a href="/index/Ar#5-automatic">Index entries for 5-automatic sequences</a>.
%F A020654 Sum_{n>=2} 1/a(n) = 7.7794910022243020875287956248411192066951785182667316905881486574421016471305408306837031955619272391023... (calculated using Baillie and Schmelzer's kempnerSums.nb, see Links). - _Amiram Eldar_, Apr 14 2025
%p A020654 seq(`if`(numboccur(4,convert(n,base,5))=0,n,NULL),n=0..127); # _Nathaniel Johnston_, Jun 27 2011
%t A020654 Select[ Range[ 0, 100 ], (Count[ IntegerDigits[ #, 5 ], 4 ]==0)& ]
%t A020654 Select[Range[0, 120], DigitCount[#, 5, 4] == 0 &] (* _Amiram Eldar_, Apr 14 2025 *)
%o A020654 (PARI) is(n)=while(n>4, if(n%5==4, return(0)); n\=5); 1 \\ _Charles R Greathouse IV_, Feb 12 2017
%o A020654 (Python)
%o A020654 from sympy.ntheory.factor_ import digits
%o A020654 print([n for n in range(201) if digits(n, 5)[1:].count(4)==0]) # _Indranil Ghosh_, May 23 2017
%o A020654 (Python)
%o A020654 from gmpy2 import digits
%o A020654 def A020654(n): return int(digits(n-1,4),5) # _Chai Wah Wu_, May 06 2025
%o A020654 (Julia)
%o A020654 function a(n)
%o A020654     m, r, b = n, 0, 1
%o A020654     while m > 0
%o A020654         m, q = divrem(m, 4)
%o A020654         r += b * q
%o A020654         b *= 5
%o A020654     end
%o A020654 r end; [a(n) for n in 0:66] |> println # _Peter Luschny_, Jan 03 2021
%Y A020654 Cf. A023717.
%Y A020654 Summary of increasing sequences avoiding arithmetic progressions of specified lengths (the second of each pair is obtained by adding 1 to the first):
%Y A020654 3-term AP: A005836 (>=0), A003278 (>0);
%Y A020654 4-term AP: A005839 (>=0), A005837 (>0);
%Y A020654 5-term AP: A020654 (>=0), A020655 (>0);
%Y A020654 6-term AP: A020656 (>=0), A005838 (>0);
%Y A020654 7-term AP: A020657 (>=0), A020658 (>0);
%Y A020654 8-term AP: A020659 (>=0), A020660 (>0);
%Y A020654 9-term AP: A020661 (>=0), A020662 (>0);
%Y A020654 10-term AP: A020663 (>=0), A020664 (>0).
%K A020654 nonn,easy
%O A020654 1,3
%A A020654 _David W. Wilson_
%E A020654 Added "infinite" to definition. - _N. J. A. Sloane_, Sep 28 2019