login
A387644
Complement of A045944.
1
1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72
OFFSET
1,2
LINKS
Chai Wah Wu, Algorithms for Complementary Sequences, Integers (2025) Vol. 25, Art. No. A95. See p. 24.
FORMULA
a(n) = n+m if n > m*(3*m+1) and a(n) = n+m-1 otherwise where m = floor(sqrt(n/3)).
MATHEMATICA
lim=72; limt=Ceiling[Sqrt[lim/3]]; Complement[Range[lim], Table[n*(3n+2), {n, 0, limt}] ] (* James C. McMahon, Sep 07 2025 *)
PROG
(Python)
from math import isqrt
def A387644(n): return n+(m:=isqrt(n//3))-(n<=m*(3*m+1))
CROSSREFS
Cf. A045944.
Sequence in context: A231237 A053241 A340288 * A132329 A388077 A230313
KEYWORD
nonn,easy
AUTHOR
Chai Wah Wu, Sep 04 2025
STATUS
approved