login
Define the sequence {b_n(m)} by b_n(0)=0; b_n(m) = A000005(b_n(m-1)+n), for all m >= 1. Then a(n) is the smallest positive integer such that b_n(m) = b_n(m + a(n)) for all m > some positive integer.
2

%I #22 Feb 08 2024 07:29:47

%S 1,2,1,1,1,1,3,2,1,1,1,1,2,1,1,2,1,1,2,3,1,1,1,2,2,2,1,2,1,1,1,3,2,1,

%T 1,2,2,2,1,2,1,2,4,1,3,1,3,1,2,2,1,4,1,1,2,3,1,1,1,1,2,1,2,3,1,2,2,5,

%U 1,1,1,1,2,2,2,2,2,1,4,3,1,1,1,1,2,1,1

%N Define the sequence {b_n(m)} by b_n(0)=0; b_n(m) = A000005(b_n(m-1)+n), for all m >= 1. Then a(n) is the smallest positive integer such that b_n(m) = b_n(m + a(n)) for all m > some positive integer.

%H Jinyuan Wang, <a href="/A135063/b135063.txt">Table of n, a(n) for n = 1..1000</a>

%e {b_7(m)} is 0,2,3,4,2,3,4,..., with (2,3,4) repeating thereafter. So a(7) = 3, the length of the repeating subsequence (2,3,4).

%p b := proc(n,m) option remember; if m =0 then 0; else numtheory[tau]( procname(n,m-1)+n); end if; end proc:

%p A135063 := proc(n) bseq := [] ; for m from 0 do bs := b(n,m) ; if member(bs,bseq,'w') then return 1+nops(bseq)-w ; else bseq := [op(bseq),bs] ; end if; end do: end proc: seq(A135063(n),n=1..120) ; # _R. J. Mathar_, Aug 09 2010

%t b[n_, m_] := b[n, m] = If[m == 0, 0, DivisorSigma[0, b[n, m-1] + n]];

%t A135063[n_] := Module[{bseq = {}}, For[m = 0, True, m++, bs = b[n, m]; w = Position[bseq, bs]; If[w != {}, Return[1+Length[bseq]-w[[1, 1]]], AppendTo[bseq, bs]]]];

%t Table[A135063[n], {n, 1, 120}] (* _Jean-François Alcover_, Feb 08 2024, after _R. J. Mathar_ *)

%o (PARI) a(n) = my(b, k, v=List([0])); until(k<#v, k=1; listput(v, b=numdiv(b+n)); until(v[k]==b||k==#v, k++)); #v-k; \\ _Jinyuan Wang_, Aug 22 2021

%Y Cf. A000005, A135062.

%K nonn

%O 1,2

%A _Leroy Quet_, Nov 15 2007

%E Terms beyond a(12) from _R. J. Mathar_, Aug 09 2010