login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Smallest m such that |A259029(m)| = n.
2

%I #11 Sep 02 2023 04:11:19

%S 3,1,16,192,768,3072,12288,49152,196608,786432,3145728,12582912,

%T 50331648,201326592,805306368,3221225472,12884901888,51539607552

%N Smallest m such that |A259029(m)| = n.

%C |A259029(a(n))| = n and |A259029(m)| != n for m < a(n).

%e . n | a(n) | A259029(a(n)) | A259024(a(n))

%e . ----+------------------------+---------------+--------------

%e . 0 | 3 | 3*2^0 | 0 | -1

%e . 1 | 1 | 2^0 | 1 | 1

%e . 2 | 16 | 2^4 | 2 | 1

%e . 3 | 192 | 3*2^6 | -3 | -1

%e . 4 | 768 | 3*2^8 | -4 | -1

%e . 5 | 3072 | 3*2^10 | -5 | -1

%e . 6 | 12288 | 3*2^12 | -6 | -1

%e . 7 | 49152 | 3*2^14 | -7 | -1

%e . 8 | 196608 | 3*2^16 | -8 | -1

%e . 9 | 786432 | 3*2^18 | -9 | -1

%e . 10 | 3145728 | 3*2^20 | -10 | -1

%e . 11 | 12582912 | 3*2^22 | -11 | -1

%e . 12 | 50331648 | 3*2^24 | -12 | -1

%e . 13 | 201326592 | 3*2^26 | -13 | -1

%e . 14 | 805306368 | 3*2^28 | -14 | -1

%e . 15 | 3221225472 | 3*2^30 | -15 | -1

%e . 16 | 12884901888 | 3*2^32 | -16 | -1

%e . 17 | 51539607552 | 3*2^34 | -17 | -1 .

%o (Haskell)

%o import Data.List (elemIndex); import Data.Maybe (fromJust)

%o a259031 = (+ 1) . fromJust . (`elemIndex` (map abs a259029_list))

%o (PARI) g(n) = {my(f = factor(n), p, e); prod(i = 1, #f~, p = f[i,1]; e = f[i,2]; if(p == 2, (1 + (-1)^e)/2, if(p==3, if(e==1, -1, 0), if(p%6 == 1, 1, (-1)^e))));} \\ A259029

%o lista(len) = {my(v=vector(len), s=0, t, k=1, c=0); while(c < len, s += g(k); t = abs(s)+1; if(t <= len && v[t] == 0, c++; v[t] = k); k++); v} \\ _Amiram Eldar_, Sep 02 2023

%Y Cf. A259029, A259024.

%K nonn

%O 0,1

%A _Reinhard Zumkeller_, Jun 17 2015

%E a(12)-a(17) from _Amiram Eldar_, Sep 02 2023