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
KEYWORD
nonn
AUTHOR
John W. Layman, Jan 05 2005
STATUS
approved
