OFFSET
1,2
COMMENTS
LINKS
Eric Weisstein's World of Mathematics, Beatty Sequence.
EXAMPLE
a(n) = floor(n*x) where
x = 1 + 1/2^1 + 1/2^3 + 1/2^5 + 1/2^6 + 1/2^8 + 1/2^10 + 1/2^11 + 1/2^13 + 1/2^15 + 1/2^16 + 1/2^18 + 1/2^20 + 1/2^21 + ... + 1/2^a(n) + ...
A related sequence is
[0, 1, 1, 2, 2, 3, 4, 4, 5, 5, 6, 7, 7, 8, 8, 9, 10, ..., floor(n/x), ...]
from which the constant x may also be calculated by
x = 1 + 0/2 + 1/2^2 + 1/2^3 + 2/2^4 + 2/2^5 + 3/2^6 + 4/2^7 + 4/2^8 + 5/2^9 + 5/2^10 + 6/2^11 + 7/2^12 + 7/2^13 + ... + floor(n/x)/2^n + ...
The complementary Beatty sequence begins
[2, 4, 7, 9, 12, 14, 17, 19, 22, 24, 27, 29, ..., floor(n*x/(x-1)), ...]
where x = 2 - (1/2^2 + 1/2^4 + 1/2^7 + 1/2^9 + 1/2^12 + 1/2^14 + 1/2^17 + 1/2^19 + 1/2^22 + 1/2^24 + 1/2^27 + ... + 1/2^floor(n*x/(x-1)) + ...).
PROG
(PARI) {a(n) = my(x = 7554425181395669/4503599627370495);
x = suminf(n=0, 1./2^floor(n*x) ) ; floor(n*x)}
for(n=1, 100, print1(a(n), ", "))
CROSSREFS
KEYWORD
nonn
AUTHOR
Paul D. Hanna, Dec 31 2025
STATUS
approved
