login
A204905
Least k such that n divides k^2-j^2 for some j satisfying 1<=j<k.
3
2, 3, 2, 3, 3, 4, 4, 3, 5, 6, 6, 4, 7, 8, 4, 5, 9, 9, 10, 6, 5, 12, 12, 5, 10, 14, 6, 8, 15, 8, 16, 6, 7, 18, 6, 9, 19, 20, 8, 7, 21, 10, 22, 12, 7, 24, 24, 7, 14, 15, 10, 14, 27, 12, 8, 9, 11, 30, 30, 8
OFFSET
1,1
COMMENTS
See A204892 for a discussion and guide to related sequences.
EXAMPLE
1 divides 2^2-1^2, so a(1)=2
2 divides 3^2-1^2, so a(2)=3
3 divides 2^2-a^2, so a(3)=2
4 divides 3^2-a^2, so a(4)=3
MATHEMATICA
s[n_] := s[n] = n^2; z1 = 600; z2 = 60;
Table[s[n], {n, 1, 30}] (* A000290 *)
u[m_] := u[m] = Flatten[Table[s[k] - s[j], {k, 2, z1}, {j, 1, k - 1}]][[m]]
Table[u[m], {m, 1, z1}] (* A120070 *)
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}] (* A204994 *)
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}] (* A204905 *)
Table[j[n], {n, 1, z2}] (* A204995 *)
Table[s[k[n]], {n, 1, z2}] (* A204996 *)
Table[s[j[n]], {n, 1, z2}] (* A204997 *)
Table[s[k[n]] - s[j[n]], {n, 1, z2}] (* A204998 *)
Table[(s[k[n]] - s[j[n]])/n, {n, 1, z2}] (* A204999 *)
CROSSREFS
Sequence in context: A030397 A257213 A205780 * A082597 A112212 A102314
KEYWORD
nonn
AUTHOR
Clark Kimberling, Jan 21 2012
STATUS
approved