login
A341707
a(n) is the binary representation of n converted to yranib.
3
0, 1, 2, 1, 4, 3, 2, 1, 8, 7, 6, 5, 4, 3, 2, 1, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, -38, -39, -40, -41, -42, -43, -44, -45, -46, -47, -48, -49, -50, -51, -52, -53, 46, 45, 44, 43, 42, 41
OFFSET
0,3
COMMENTS
If n = Sum_{i=0..k} b_i*2^i, b_i = 0 or 1, b_k = 1, then a(n) = y(k) - Sum_{i=0..k-1} b_i*y(i), where y(j) = A004094(j) = 2^j written backwards in base 10.
If the 2^14 terms from a(16384) to a(32767) were to be considered a packet [call it #1], then the terms from a(32768) to a(49151) [call it #2] are #1 + 38362. #3 = #2 - 48361 (note that 48361 is the reverse of 16384). #4 = #3 + 25194. These successive displacements
(38362, -48361, 25194, -48361,
-38362, -48361, 341659, -48361,
-38362, -48361, 71528, -48361,
-38362, -48361, 369771, -48361,
-38362, -48361, 71528, -48361,
-38362, -48361, -71491, -48361,
-38362, -48361, 71528, -48361,
-38362, -48361, 909934, -48361,
-38362, -48361, 71528, -48361,
-38362, -48361, -71491, -48361,
-38362, -48361, 71528, -48361,
-38362, -48361, 27509, -48361,
-38362, -48361, 71528, -48361,
-38362, -48361, -71491, -48361,
-38362, -48361, 71528, -48361,
-38362, -48361, 6786009, -48361,
-38362, -48361, 71528, -48361,
-38362, -48361, -71491, -48361,
-38362, -48361, 71528, -48361,
-38362, -48361, 27509, -48361,
-38362, -48361, 71528, -48361,
-38362, -48361, -71491, -48361,
-38362, -48361, 71528, -48361,
-38362, -48361, 27608, -48361,
-38362, -48361, 71528, -48361, ...) fully describe the future of the sequence. Can we predict the values of the displacements from first principles? - Hans Havermann, Feb 24 2021
REFERENCES
Eric Angelini, Posting to Math Fun Mailing List, Feb 18 2021
LINKS
EXAMPLE
If n = 48 = 110000_2, b_0 = ... = b_3 = 0, b_4 = b_5 = 1, so a(48) = A004094(5) - A004094(4) = 23 - 61 = -38, which is the first negative term (cf. A341708).
MATHEMATICA
{0}~Join~Array[Fold[Subtract, Reverse@ IntegerReverse[2^(-1 + Position[Reverse@ IntegerDigits[#, 2], 1][[All, 1]] )]] &, 69] (* Michael De Vlieger, Feb 25 2021 *)
PROG
(PARI)
/* Get decimal value of yranib representation of n written in binary (i.e., write n in binary, e.g., 9[10] = 1001[2], then read this in the yranib system, where the k-th position from the right has value s*R(2^k) where R=reverse(= decimal value read from right to left) and s = -1 except for the largest k. */
y2d(n)=if(n=binary(n), n[1]*=-1); -sum(k=0, #n-1, n[#n-k]*R(2^k))
R(n)=fromdigits(Vecrev(digits(n)))
apply(y2d, [0..99]) \\ M. F. Hasler, Feb 18 2021
(Python)
def reverse(n):
s = 0
while n > 0:
d, n = n%10, n//10
s = 10*s+d
return s
def A341707(n):
s, t = 0, 1
while n > 0:
b, n = n%2, n//2
if n > 0:
s, t = reverse(t*b)+s, 2*t
else:
s = reverse(t*b)-s
return s # A.H.M. Smeets, Feb 18 2021
CROSSREFS
Cf. A004094.
See A341708 for the negative terms.
See A341709 for a different version of a yranib sequence.
Sequence in context: A355807 A355808 A080079 * A347820 A318569 A336280
KEYWORD
sign,base,look
AUTHOR
N. J. A. Sloane, Feb 18 2021
EXTENSIONS
Further terms from M. F. Hasler, Feb 18 2021
STATUS
approved