OFFSET
1
COMMENTS
Jeffreys defined this sequence in the context of sampling an events generator. Let a(n)=1 indicate that in the n-th sampling interval an event was detected; otherwise, set a(n)=0. This sequence's generator operates in such a way that a(1)=1 is followed by alternating blocks of 0's and blocks of 1's, each block having the same length as the whole sequence section which precedes it.
The pedagogical merit of the sequence consists of the fact that the would-be mean density of events, d(N) = (Sum_{n=1..N} a(n))/N = A275974(N)/N, does not converge to any limit when N grows to infinity. Rather, it oscillates (with exponentially growing cycle lengths) between liminf_{N->infinity} d(N) = 1/3 and limsup_{N->infinity} d(N) = 2/3.
When interpreted as binary digits of a real number, the sequence evaluates to 1-A275975. In fact, it can be written as 1 - Sum_{k>=0}((-1)^k/2^2^k), with each pair of consecutive terms {1/2^2^(2m-1) - 1/2^2^(2m)}, for m = 1,2,3,..., giving rise to one of the blocks of one's.
REFERENCES
H. Jeffreys, Scientific Inference, Cambridge University Press, 3rd ed., 1973 (first published in 1931), Chapter III, page 47.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..16385 (first 2100 terms from Stanislav Sykora)
FORMULA
From Robert Israel, Aug 16 2016: (Start)
G.f.: (1-x)*(1-x*Sum_{j>=0}(-1)^j*x^(2^j)).
a(n) - a(n+1) = A154269(n). (End)
a(1) = 1, a(2) = 0, for n > 2, a(n) = A030301(n-1) = A000035(A000523(n-1)). - Antti Karttunen, Sep 04 2016
MAPLE
S:= series((1-x)^(-1)*(1-x*add((-1)^j*x^(2^j), j=0..9)), x, 1001):
seq(coeff(S, x, j), j=1..1000); # Robert Israel, Aug 16 2016
# secod Maple program:
b:= n-> (p-> `if`(2^p=n, (-1)^p, 0))(ilog2(n)):
a:= proc(n) a(n):= `if`(n=1, 1, a(n-1)-b(n-1)) end:
seq(a(n), n=1..109); # Alois P. Heinz, Feb 18 2024
PROG
(PARI) \\ A vector-returning version adherent to the original definition:
JeffreysSequence(nmax) = { \\ Function returning a vector of length nmax
my(a=vector(nmax), n=0, p=1); a[n++]=1;
while(n<nmax,
for(k=2^(p-1)+1, 2^p, a[n++]=0; if(n==nmax, break));
if(n<nmax, for(k=2^p+1, 2^(p+1), a[n++]=1; if(n==nmax, break)));
p+=2; );
return(a); }
a = JeffreysSequence(2100) \\ An actual invocation
(PARI) \\ A function returning the n-th term:
a(n)={my(p=1, np=n-1); while(np, p++; np=np\2); return(bitand(p, 1)); }
(Scheme)
;; A version after the above PARI-program. Here (A000035 n) = (modulo n 2) or (mod n 2), depending on the version of Scheme used:
(define (A275973_with_loop n) (let loop ((p 1) (np (- n 1))) (if (zero? np) (A000035 p) (loop (+ 1 p) (/ (- np (A000035 np)) 2)))))
;; The above in turn reduces to this simple formula:
;; Antti Karttunen, Sep 04 2016
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Stanislav Sykora, Aug 15 2016
STATUS
approved