login
Least k such that n divides 2^(k-1)-2^(j-1) for some j satisfying 1<=j<k.
6

%I #9 Mar 30 2012 18:58:08

%S 2,3,3,4,5,4,4,5,7,6,11,5,13,5,5,6,9,8,19,7,7,12,12,6,21,14,19,6,29,6,

%T 6,7,11,10,13,9,37,20,13,8,21,8,15,13,13,13,24,7,22,22

%N Least k such that n divides 2^(k-1)-2^(j-1) for some j satisfying 1<=j<k.

%C See A204892 for a discussion and guide to related sequences.

%e 1 divides 2^2-2^1, so a(1)=2

%e 2 divides 2^3-2^2, so a(2)=3

%e 3 divides 2^3-2^1, so a(3)=3

%e 4 divides 2^4-2^3, so a(4)=4

%t s[n_] := s[n] = 2^(n - 1); z1 = 800; z2 = 50;

%t Table[s[n], {n, 1, 30}] (* A000079 *)

%t u[m_] := u[m] = Flatten[Table[s[k] - s[j], {k, 2, z1}, {j, 1, k - 1}]][[m]]

%t Table[u[m], {m, 1, z1}] (* A130328 *)

%t v[n_, h_] := v[n, h] = If[IntegerQ[u[h]/n], h, 0]

%t w[n_] := w[n] = Table[v[n, h], {h, 1, z1}]

%t d[n_] := d[n] = First[Delete[w[n], Position[w[n], 0]]]

%t Table[d[n], {n, 1, z2}] (* A204939 *)

%t k[n_] := k[n] = Floor[(3 + Sqrt[8 d[n] - 1])/2]

%t m[n_] := m[n] = Floor[(-1 + Sqrt[8 n - 7])/2]

%t j[n_] := j[n] = d[n] - m[d[n]] (m[d[n]] + 1)/2

%t Table[k[n], {n, 1, z2}] (* A204979 *)

%t Table[j[n], {n, 1, z2}] (* A001511 ? *)

%t Table[s[k[n]], {n, 1, z2}] (* A204981 *)

%t Table[s[j[n]], {n, 1, z2}] (* A006519 ? *)

%t Table[s[k[n]] - s[j[n]], {n, 1, z2}] (* A204983 *)

%t Table[(s[k[n]] - s[j[n]])/n, {n, 1, z2}] (* A204984 *)

%Y Cf. A000079, A204892.

%K nonn

%O 1,1

%A _Clark Kimberling_, Jan 21 2012