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
Jinyuan Wang, Table of n, a(n) for n = 0..10000
EXAMPLE
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
KEYWORD
AUTHOR
N. J. A. Sloane, Feb 18 2021
EXTENSIONS
Further terms from M. F. Hasler, Feb 18 2021
STATUS
approved