login
A100812
{a(n)} is monotone increasing, with a(1)=1, a(2)=3 and, for n>2, a(n) is the smallest integer such that a(n) mod a(j) is never a(i) for any pair i,j with 1<=i<j<n.
1
1, 3, 5, 9, 15, 17, 27, 29, 45, 47, 87, 89, 135, 227, 267, 269, 540, 674, 947, 1217, 1442, 1485, 2522, 2564, 2792, 2832, 2834, 2972, 3102, 3240, 3242, 3645, 3737, 4142, 4182, 4320, 4992, 5400, 5807, 6077, 7017, 7967, 8370, 8772, 8774, 9677, 9717, 9990, 9992
OFFSET
1,2
LINKS
David A. Corneth, Table of n, a(n) for n = 1..1833 (first 200 terms from Francisco J. Muñoz, terms <= 2*10^7)
David A. Corneth, PARI program
EXAMPLE
a(8)<>28, since 28=1 mod 27. But the residues of 29 modulo 3,5,9,15,17 and 27 are 2,4,2,14,12 and 2, none of which are earlier terms of the sequence, so a(8)=29.
PROG
(R)
monotone_increasing <- function(N) {
a <- c(1, 3)
while (length(a) < N) {
candidate <- a[length(a)] + 1
repeat {
valid <- TRUE
for (i in 1:(length(a) - 1)) {
for (j in (i+1):length(a)) {
if (candidate %% a[j] == a[i]) {
valid <- FALSE
break
}
}
if (!valid) break
}
if (valid) {
a <- c(a, candidate)
break
} else {
candidate <- candidate + 1
}
}
}
return(a)
}
# Example:
sequence <- monotone_increasing(100)
print(sequence) # Francisco J. Muñoz, Jul 27 2025
(PARI) \\ See Corneth link
CROSSREFS
Sequence in context: A339345 A111249 A190804 * A274432 A380544 A190939
KEYWORD
nonn
AUTHOR
John W. Layman, Jan 05 2005
STATUS
approved