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”).

A337253
a(2n) = b(a(n)^2), a(2n+1) = b(a(n) + a(n - 1)) where b(k) = abs(k)*(-1)^k; a(0) = 0, a(1) = 1.
0
0, 1, -1, -1, -1, 0, -1, 2, -1, 2, 0, -1, -1, -1, 4, -1, -1, -1, 4, -1, 0, 2, -1, -1, -1, 2, -1, 2, 16, -3, -1, -3, -1, 2, -1, 2, 16, -3, -1, -3, 0, -1, 4, 2, -1, -1, -1, 2, -1, 2, 4, -1, -1, -1, 4, -1, 256, 18, -9, -13, -1, 4, -9, 4, 0, -3, -1, -1, 16, -3, 4, 6, -1, -1, -1, 2, -1, 2, 4, -1
OFFSET
0,8
COMMENTS
If -1 appears in positions a((n-1)/2 - 1)), it will be preceded by a square that appears in a(2*n+1). So the numbers are of the type k^2-1 for even k, and -(k^2+1) for odd k, with k being a number that appears earlier in the sequence.
a(1)=1, a(7)=2, a(29)=-3, a(14)=4, a(145)=-5, a(71)=6, ...
Conjecture: {abs(a(n))} contains every natural number.
0,
1,
-1,******************* -1,******************************** -1,
0,****************** -1, 2,***************************** -1, 2,
0,-1,*********** -1, -1, 4, -1,********************* -1, -1, 4, -1,
0,2,-1,-1,**-1, 2, -1, 2, 16, -3, -1,-3*** -1, 2, -1, 2, 16, -3, -1, -3,
0, -1, 4, 2, -1, -1, -1, 2, -1, 2, 4, -1, -1, -1, 4, -1, 256, 18, -9, ...
The sequence makes a copy of itself of length 2^n+1 (a(n) >= 1).
FORMULA
For n > 0, a(2*n) = b(a(n)^2); a(2*n+1) = b(a(n) + a(n - 1)) where b(k) = abs(k)*(-1)^k.
a(7*2^n) = A001146(n-1).
EXAMPLE
a(1) = 1.
a(2) = a(1)^2 = 1^2 = 1, but 1 is odd, so -1.
a(3) = a(1) + a(0) = 1, but 1 is odd, so -1.
a(4) = a(2)^2 = 1, but 1 is odd, so -1.
a(5) = a(2) + a(1) = -1 + 1 = 0.
...
MATHEMATICA
f[n_] := If[EvenQ[n], Abs[n], -Abs[n]]; a[0] = 0; a[1] = 1; a[n_] := a[n] = f[If[EvenQ[n], a[n/2]^2, a[(n - 1)/2] + a[(n - 1)/2 - 1]]]; Array[a, 100, 0] (* Amiram Eldar, Aug 23 2020 *)
PROG
(PARI) seq(n)={my(v=vector(n+1)); v[2]=1; for(n=2, n, my(t=abs(if(n%2, v[1+n\2] + v[n\2], v[1+n/2]^2))); v[1+n]=if(t%2, -t, t)); v} \\ Andrew Howroyd, Aug 23 2020
CROSSREFS
The a(7*2^n) terms are A001146.
Sequence in context: A092149 A303975 A171099 * A127173 A362867 A035160
KEYWORD
sign
AUTHOR
Mario Cortés, Aug 21 2020
STATUS
approved