OFFSET
1,3
COMMENTS
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
LINKS
Nathaniel Johnston, Table of n, a(n) for n = 1..10000
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.
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)& ]
PROG
(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
(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
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):
KEYWORD
nonn,easy
AUTHOR
EXTENSIONS
Added "infinite" to definition. - N. J. A. Sloane, Sep 28 2019
STATUS
approved