

A174541


Baron Munchhausen's Sequence.


1



0, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 2, 2, 2, 1, 1, 2, 2, 2, 2, 1, 1, 2, 2, 1, 2, 2, 1, 1, 2, 2, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 1, 1, 2, 2, 1, 2, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,5


COMMENTS

Let n coins weighing 1, 2, ..., n grams be given. Suppose Baron Munchhausen knows which coin weighs how much, but his audience does not. Then a(n) is the minimum number of weighings the Baron must conduct on a balance scale, so as to unequivocally demonstrate the weight of at least one of the coins.
After a(1) = 0, a(n) is either 1 or 2 for all n.
a(n) = 1 for n triangular, n triangularplusone, T_n a square, and T_n a squareplusone, where T_n is the nth triangular number; a(n) = 2 for all other n > 1.


LINKS



EXAMPLE

a(7) = 1 because the weighing 1 + 2 + 3 < 7 conclusively demonstrates the weight of the sevengram coin.


MATHEMATICA

triangularQ[n_] := IntegerQ[ Sqrt[8n+1]]; a[1] = 0; a[n_ /; triangularQ[n]  triangularQ[n1]  IntegerQ[ Sqrt[n*(n+1)/2]]  IntegerQ[ Sqrt[n*(n+1)/2  1]]] = 1; a[_] = 2; Table[a[n], {n, 1, 105}] (* JeanFrançois Alcover, Jul 30 2012, after comments *)


PROG

(Scheme) ;;; The following Scheme program generates terms of Baron
;;; Munchhausen's Sequence.
(define (acceptable? n)
..(or (triangle? n)
......(= n 2)
......(triangle? ( n 1))
......(square? (triangle n))
......(square? ( (triangle n) 1))))
(streammap
.(lambda (n)
...(if (= n 1)
.......0
.......(if (acceptable? n)
...........1
...........2)))
.(theintegers))


CROSSREFS



KEYWORD

nonn,nice


AUTHOR



STATUS

approved



