login
Let m_n denote the number which is obtained from n-base representation of m if its digits are written in nondecreasing order; then a(n) is the smallest period of the sequence which is defined by the recurrence b(0)=0, b(1)=1, b(k)=(b(k-1) + b(k-2))_n, for k>=2, or a(n)=0, if there is no such period.
4

%I #26 Aug 28 2020 08:13:09

%S 1,3,16,6,20,24,16,36,120,300,20,288,28,192,200,552,180,192,180,1380,

%T 224,60,1728,912,3800,756,576,1776,4102,15480,3540,1344,10800,14328,

%U 800,2304,1520,1890,1232,11280,9040,31152,49544,3660,6360,3696,13248,21408

%N Let m_n denote the number which is obtained from n-base representation of m if its digits are written in nondecreasing order; then a(n) is the smallest period of the sequence which is defined by the recurrence b(0)=0, b(1)=1, b(k)=(b(k-1) + b(k-2))_n, for k>=2, or a(n)=0, if there is no such period.

%C We conjecture that the sequence b is always eventually periodic, and so a(n)>0.

%H Pontus von Brömssen, <a href="/A237671/b237671.txt">Table of n, a(n) for n = 2..250</a> (terms 2..100 from Giovanni Resta)

%e For n=5, b-sequence begins 0,1,1,2,3,1,4,1,1,2,... It has period {1,1,2,3,1,4} of length 6. So a(5)=6.

%e a(10) = 120, because the eventual period of A069638 is 120.

%o (Python)

%o import sympy,functools

%o def digits2int(x,b):

%o return functools.reduce(lambda n,d:b*n+d,x,0)

%o def A237671(n):

%o return next(sympy.cycle_length(lambda x:(x[1],digits2int(sorted(sympy.ntheory.factor_.digits(sum(x),n)[1:]),n)),(0,1)))[0] # _Pontus von Brömssen_, Aug 28 2020

%Y Cf. A069638, A237568, A004185, A306773.

%K nonn,base

%O 2,2

%A _Vladimir Shevelev_ and _Peter J. C. Moses_, Feb 11 2014