close
login
A385683
Complement of A030511.
1
1, 3, 4, 5, 7, 8, 9, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 25, 26, 27, 28, 29, 30, 31, 33, 34, 35, 36, 37, 38, 39, 40, 41, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76
OFFSET
1,2
COMMENTS
Positive numbers not of the form floor(2*k^2/3).
FORMULA
a(n) = n+m if n+m>floor(2*(m+1)^2/3) and a(n) = n+m-1 otherwise where m = floor(sqrt(3*(n-1)/2)).
MATHEMATICA
m[n_]:=Floor[Sqrt[3(n-1)/2]]; a[n_]:=If[n+m[n]>Floor[2(m[n]+1)^2/3], n+m[n], n+m[n]-1]; Array[a, 67] (* James C. McMahon, Aug 06 2025 *)
PROG
(Python)
from math import isqrt
def A385683(n): return n+(m:=isqrt(3*(n-1)>>1))-(n+m<=((m+1)**2<<1)//3)
CROSSREFS
Cf. A030511.
Sequence in context: A116590 A024355 A194413 * A183574 A184425 A276212
KEYWORD
nonn,easy
AUTHOR
Chai Wah Wu, Aug 04 2025
STATUS
approved