OFFSET
0,2
COMMENTS
Smallest odd number of the form 2q - 1 such that A246702(q) = n.
Additional terms include: a(426) = 1705, a(451) = 903, a(516) = 2067, a(536) = 2145, a(563) = 2255, a(566) = 2265, a(593) = 2373, a(761) = 3045, a(770) = 3081, a(786) = 2359, a(1333) = 2667, and a(3282) = 1093. - Kevin P. Thompson, Nov 26 2021
LINKS
Kevin P. Thompson, Table of n, a(n) for n = 0..350, with missing terms.
EXAMPLE
The first occurrence of 3 in the sequence A246702 occurs at n = 8. Therefore, a(3) = 2n - 1 = 2*8 - 1 = 15.
MATHEMATICA
NumK[m_]:=NumK[m]=(m2=m^2; nk=0; Do[If[Mod[2^i, m2]==1, nk++], {i, m2-1}]; nk)
nterms=10; Table[m=0; While[NumK[++m]!=n]; m, {n, 0, nterms-1}] (* Paolo Xausa, Nov 30 2021 *)
PROG
(PARI) isok(m, n) = {my(v = vector(m^2-1, k, Mod(2, m^2)^k == 1)); vecsum(v) == n; }
a(n) = {my(m=1); while (!isok(m, n), m++); m; } \\ Michel Marcus, Nov 27 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Juri-Stepan Gerasimov, Nov 15 2014
EXTENSIONS
Name corrected by Antti Karttunen, Nov 18 2014
Multiple corrections and new terms a(17)-a(52) from Kevin P. Thompson, Nov 26 2021
STATUS
approved