cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A292729 a(n) is the maximum number of steps that can occur during the following procedure: start with n piles each containing one stone; any number of stones can be transferred between piles of equal size.

This page as a plain text file.
%I A292729 #25 Nov 05 2024 18:56:52
%S A292729 0,1,1,3,4,4,8,10,11,12,16,20,22,24,27,31,35,38,43,45,47,52,57,62,67,
%T A292729 71,74,79,83,90,95,101,106,111,114,118,126,132,138,146,152,156,161,
%U A292729 167,172,180,189,194,204,208,216,221,228,234,242,249,258,264,274,282
%N A292729 a(n) is the maximum number of steps that can occur during the following procedure: start with n piles each containing one stone; any number of stones can be transferred between piles of equal size.
%C A292729 Note that more than one stone can be moved during a single move.
%C A292729 A121924 is the analogous sequence if only one stone can be transferred between piles of equal size.
%C A292729 A011371 is the analogous sequence if all stones must be transferred between piles of equal size (i.e., the number of stones in each pile must be a power of two).
%C A292729 Both A121924 and A011371 are lower bounds for this sequence.
%e A292729 For n = 7, an 8-move sequence is:
%e A292729 (1 1 1 1 1 1 1) -> (2 1 1 1 1 1) -> (2 2 1 1 1) -> (3 1 1 1 1) -> (3 2 1 1) -> (3 2 2) -> (3 3 1) -> (5, 1, 1) -> (5 2).
%o A292729 (Python)
%o A292729 def A292729(n):
%o A292729     s_in = set([(1, )*n])
%o A292729     count=-1
%o A292729     while len(s_in) > 0:
%o A292729         s_out = set()
%o A292729         for s in s_in:
%o A292729             last = -1 ; idx = 0
%o A292729             while (idx+1) < len(s):
%o A292729                 h = s[idx]
%o A292729                 if h!=last and s[idx+1]==h:
%o A292729                     for q in range(1, h+1):
%o A292729                         lst = list(s[:idx]) + list(s[idx+2:])
%o A292729                         lst += [2*h] if h==q else [ h-q, h+q]
%o A292729                         t = tuple(sorted(lst))
%o A292729                         if not t in s_out:
%o A292729                             s_out.add(t)
%o A292729                 last = s[idx] ; idx += 1
%o A292729         count += 1
%o A292729         s_in = s_out
%o A292729     return count
%o A292729 # _Bert Dobbelaere_, Jul 14 2019
%Y A292729 Cf. A011371, A121924, A292726, A292728.
%K A292729 nonn
%O A292729 1,4
%A A292729 _Peter Kagey_, Sep 22 2017
%E A292729 a(35)-a(60) from _Bert Dobbelaere_, Jul 14 2019