OFFSET
0,1
EXAMPLE
. ----+------------------------+---------------+--------------
. 0 | 3 | 3*2^0 | 0 | -1
. 1 | 1 | 2^0 | 1 | 1
. 2 | 16 | 2^4 | 2 | 1
. 3 | 192 | 3*2^6 | -3 | -1
. 4 | 768 | 3*2^8 | -4 | -1
. 5 | 3072 | 3*2^10 | -5 | -1
. 6 | 12288 | 3*2^12 | -6 | -1
. 7 | 49152 | 3*2^14 | -7 | -1
. 8 | 196608 | 3*2^16 | -8 | -1
. 9 | 786432 | 3*2^18 | -9 | -1
. 10 | 3145728 | 3*2^20 | -10 | -1
. 11 | 12582912 | 3*2^22 | -11 | -1
. 12 | 50331648 | 3*2^24 | -12 | -1
. 13 | 201326592 | 3*2^26 | -13 | -1
. 14 | 805306368 | 3*2^28 | -14 | -1
. 15 | 3221225472 | 3*2^30 | -15 | -1
. 16 | 12884901888 | 3*2^32 | -16 | -1
. 17 | 51539607552 | 3*2^34 | -17 | -1 .
PROG
(Haskell)
import Data.List (elemIndex); import Data.Maybe (fromJust)
a259031 = (+ 1) . fromJust . (`elemIndex` (map abs a259029_list))
(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
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
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Jun 17 2015
EXTENSIONS
a(12)-a(17) from Amiram Eldar, Sep 02 2023
STATUS
approved