A020654 Lexicographically earliest infinite increasing sequence of nonnegative numbers containing no 5-term arithmetic progression.
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, 36, 37, 38, 40, 41, 42, 43, 50, 51, 52, 53, 55, 56, 57, 58, 60, 61, 62, 63, 65, 66, 67, 68, 75, 76, 77, 78, 80, 81, 82, 83, 85, 86, 87, 88, 90, 91, 92, 93, 125, 126, 127
Offset: 1
Links
- Nathaniel Johnston, Table of n, a(n) for n = 1..10000
- Robert Baillie and Thomas Schmelzer, Summing Kempner's Curious (Slowly-Convergent) Series, Mathematica Notebook kempnerSums.nb, Wolfram Library Archive, 2008.
- J. L. Gerver and L. T. Ramsey, Sets of integers with no long arithmetic progressions generated by the greedy algorithm, Math. Comp., 33 (1979), 1353-1359.
- Samuel S. Wagstaff, Jr., On k-free sequences of integers, Math. Comp., 26 (1972), 767-771.
- Index entries for 5-automatic sequences.
Crossrefs
Cf. A023717.
Summary of increasing sequences avoiding arithmetic progressions of specified lengths (the second of each pair is obtained by adding 1 to the first):
Programs
-
Julia
function a(n) m, r, b = n, 0, 1 while m > 0 m, q = divrem(m, 4) r += b * q b *= 5 end r end; [a(n) for n in 0:66] |> println # Peter Luschny, Jan 03 2021
-
Maple
seq(`if`(numboccur(4,convert(n,base,5))=0,n,NULL),n=0..127); # Nathaniel Johnston, Jun 27 2011
-
Mathematica
Select[ Range[ 0, 100 ], (Count[ IntegerDigits[ #, 5 ], 4 ]==0)& ] Select[Range[0, 120], DigitCount[#, 5, 4] == 0 &] (* Amiram Eldar, Apr 14 2025 *)
-
PARI
is(n)=while(n>4, if(n%5==4, return(0)); n\=5); 1 \\ Charles R Greathouse IV, Feb 12 2017
-
Python
from sympy.ntheory.factor_ import digits print([n for n in range(201) if digits(n, 5)[1:].count(4)==0]) # Indranil Ghosh, May 23 2017
-
Python
from gmpy2 import digits def A020654(n): return int(digits(n-1,4),5) # Chai Wah Wu, May 06 2025
Formula
Sum_{n>=2} 1/a(n) = 7.7794910022243020875287956248411192066951785182667316905881486574421016471305408306837031955619272391023... (calculated using Baillie and Schmelzer's kempnerSums.nb, see Links). - Amiram Eldar, Apr 14 2025
Extensions
Added "infinite" to definition. - N. J. A. Sloane, Sep 28 2019
Comments