login
a(n) = A317332(n) - 8*n.
6

%I #17 Oct 02 2024 16:47:18

%S 1,1,-2,1,1,-2,-2,1,1,1,-2,-2,1,-2,-2,1,1,1,-2,1,1,-2,-2,-2,1,1,-2,-2,

%T 1,-2,-2,1,1,1,-2,1,1,-2,-2,1,1,1,-2,-2,1,-2,-2,-2,1,1,-2,1,1,-2,-2,

%U -2,1,1,-2,-2,1,-2,-2

%N a(n) = A317332(n) - 8*n.

%H A.H.M. Smeets, <a href="/A317335/b317335.txt">Table of n, a(n) for n = 1..20000</a>

%F a(4*n-3) = 1, a(4*n-1) = -2, a(2*n) = a(n) for n > 0.

%F abs(a(n)+1) = A014710(n-1).

%F abs(a(n)) = A014709(n-1).

%o (Python)

%o n, f, i, p, q = 1, 1, 0, 0, 1

%o while i < 1000000:

%o i, p, q = i+1, p*10, q*10

%o if i == f:

%o p, n = p+1, n+1

%o f = f*n

%o n, a, j = 0, 0, 0

%o while p%q > 0:

%o a, f, p, q = a+1, p//q, q, p%q

%o if f == 8:

%o n = n+1

%o print(n, a-1-8*n)

%Y Cf. A317331, A317332, A317333, A317336.

%K sign

%O 1,3

%A _A.H.M. Smeets_, Jul 26 2018