login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A248641 Lexicographically earliest positive sequence which does not contain a 4-term equidistant subsequence (a(n+k*d); k=0,1,2,3) in arithmetic progression. 3
1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 2, 2, 2, 3, 1, 1, 1, 2, 1, 2, 2, 2, 3, 3, 3, 1, 1, 3, 1, 1, 1, 2, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 2, 3, 2, 3, 3, 5, 1, 1, 1, 3, 1, 1, 3, 1, 1, 1, 2, 2, 2, 3, 1, 2, 1, 1, 1, 2, 2, 2, 3, 4, 2, 3, 2, 2, 2, 3, 3, 1, 3, 3, 3, 5, 5, 4, 1, 1, 1, 3, 1, 2, 3, 1, 5, 3, 2, 6, 1, 3, 2, 2, 3, 2, 1, 1, 3, 3, 1, 1, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,4
COMMENTS
See A248625 for more information, links and examples.
It is a variation of A229037 where 3-term is replaced by 4-term (and with “lead index” 0 instead of 1)
LINKS
PROG
(PARI) a=[]; for(n=1, 190, a=concat(a, 1); while(hasAP(a, 4), a[#a]++)); a \\ See A248625 for hasAP().
(SageMath)
cpdef FourFree(int n):
cdef int i, r, k, s, L1, L2, L3
cdef list L, Lb
cdef set b
L=[1, 1, 1]
for k in range(3, n):
b=set()
for i in range(k):
if 3*((k-i)/3)==k-i:
r=(k-i)/3
L1, L2, L3=L[i], L[i+r], L[i+2*r]
s=3*(L2-L1)+L1
if s>0 and L3==2*(L2-L1)+L1:
b.add(s)
if 1 not in b:
L.append(1)
else:
Lb=list(b)
Lb.sort()
for t in Lb:
if t+1 not in b:
L.append(t+1)
break
return L
# Sébastien Palcoux, Aug 28 2019
CROSSREFS
Sequence in context: A073203 A073204 A322286 * A282934 A273619 A327522
KEYWORD
nonn,easy
AUTHOR
M. F. Hasler, Oct 10 2014
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 1 17:11 EDT 2024. Contains 372175 sequences. (Running on oeis4.)