A204892 Least k such that n divides s(k)-s(j) for some j in [1,k), where s(k)=prime(k).
2, 3, 3, 4, 4, 5, 7, 5, 5, 6, 6, 7, 10, 7, 7, 8, 8, 9, 13, 9, 9, 10, 16, 10, 16, 10, 10, 11, 11, 12, 19, 12, 20, 12, 12, 13, 22, 13, 13, 14, 14, 15, 24, 15, 15, 16, 25, 16, 26, 16, 16, 17, 29, 17, 30, 17, 17, 18, 18, 19, 31, 19, 32, 19, 19, 20, 33, 20, 20, 21
Offset: 1
Keywords
A204979
Least k such that n divides 2^(k-1)-2^(j-1) for some j satisfying 1<=j
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, 6, 7, 11, 10, 13, 9, 37, 20, 13, 8, 21, 8, 15, 13, 13, 13, 24, 7, 22, 22
Offset: 1
Keywords
Comments
See A204892 for a discussion and guide to related sequences.
Examples
1 divides 2^2-2^1, so a(1)=2 2 divides 2^3-2^2, so a(2)=3 3 divides 2^3-2^1, so a(3)=3 4 divides 2^4-2^3, so a(4)=4
Programs
-
Mathematica
s[n_] := s[n] = 2^(n - 1); z1 = 800; z2 = 50; Table[s[n], {n, 1, 30}] (* A000079 *) u[m_] := u[m] = Flatten[Table[s[k] - s[j], {k, 2, z1}, {j, 1, k - 1}]][[m]] Table[u[m], {m, 1, z1}] (* A130328 *) v[n_, h_] := v[n, h] = If[IntegerQ[u[h]/n], h, 0] w[n_] := w[n] = Table[v[n, h], {h, 1, z1}] d[n_] := d[n] = First[Delete[w[n], Position[w[n], 0]]] Table[d[n], {n, 1, z2}] (* A204939 *) k[n_] := k[n] = Floor[(3 + Sqrt[8 d[n] - 1])/2] m[n_] := m[n] = Floor[(-1 + Sqrt[8 n - 7])/2] j[n_] := j[n] = d[n] - m[d[n]] (m[d[n]] + 1)/2 Table[k[n], {n, 1, z2}] (* A204979 *) Table[j[n], {n, 1, z2}] (* A001511 ? *) Table[s[k[n]], {n, 1, z2}] (* A204981 *) Table[s[j[n]], {n, 1, z2}] (* A006519 ? *) Table[s[k[n]] - s[j[n]], {n, 1, z2}] (* A204983 *) Table[(s[k[n]] - s[j[n]])/n, {n, 1, z2}] (* A204984 *)
A204983 a(n) = 2^(k-1)-2^(j-1), where (2^(k-1),2^(j-1)) is the least pair of distinct positive powers of 2 for which n divides 2^(k-1)-2^(j-1).
1, 2, 3, 4, 15, 6, 7, 8, 63, 30, 1023, 12, 4095, 14, 15, 16, 255, 126, 262143, 60, 63, 2046, 2047, 24, 1048575, 8190, 262143, 28, 268435455, 30, 31, 32, 1023, 510, 4095, 252, 68719476735, 524286, 4095, 120, 1048575, 126, 16383, 4092, 4095
Offset: 1
Keywords
Comments
For a guide to related sequences, see A204892.
(Conjecture) Equivalently, the solution set of 2^p * (2^q - 1) = x * y, OR 2^q - 1 = 2^p * x * y, for at most one of the naturals x and y being given; unknown p and q in the integers; then a(n) = 2^p * (2^q - 1) where p and q are directly related to n (see formula). - Andrew T. Porter, Dec 20 2022
Programs
-
Mathematica
(See the program at A204979.)
-
PARI
a(n) = for (k=1, oo, for (j=1, k-1, my(d=2^(k-1)-2^(j-1)); if (!(d % n), return(d)););); \\ Michel Marcus, Sep 16 2023
Comments
Examples
Links
Crossrefs
Programs
Mathematica
PARI