cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A341707 a(n) is the binary representation of n converted to yranib.

This page as a plain text file.
%I A341707 #48 Nov 25 2023 08:34:49
%S A341707 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,
%T A341707 49,48,47,46,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,-38,-39,
%U A341707 -40,-41,-42,-43,-44,-45,-46,-47,-48,-49,-50,-51,-52,-53,46,45,44,43,42,41
%N A341707 a(n) is the binary representation of n converted to yranib.
%C A341707 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.
%C A341707 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
%C A341707      (38362, -48361,   25194, -48361,
%C A341707      -38362, -48361,  341659, -48361,
%C A341707      -38362, -48361,   71528, -48361,
%C A341707      -38362, -48361,  369771, -48361,
%C A341707      -38362, -48361,   71528, -48361,
%C A341707      -38362, -48361,  -71491, -48361,
%C A341707      -38362, -48361,   71528, -48361,
%C A341707      -38362, -48361,  909934, -48361,
%C A341707      -38362, -48361,   71528, -48361,
%C A341707      -38362, -48361,  -71491, -48361,
%C A341707      -38362, -48361,   71528, -48361,
%C A341707      -38362, -48361,   27509, -48361,
%C A341707      -38362, -48361,   71528, -48361,
%C A341707      -38362, -48361,  -71491, -48361,
%C A341707      -38362, -48361,   71528, -48361,
%C A341707      -38362, -48361, 6786009, -48361,
%C A341707      -38362, -48361,   71528, -48361,
%C A341707      -38362, -48361,  -71491, -48361,
%C A341707      -38362, -48361,   71528, -48361,
%C A341707      -38362, -48361,   27509, -48361,
%C A341707      -38362, -48361,   71528, -48361,
%C A341707      -38362, -48361,  -71491, -48361,
%C A341707      -38362, -48361,   71528, -48361,
%C A341707      -38362, -48361,   27608, -48361,
%C A341707      -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
%D A341707 Eric Angelini, Posting to Math Fun Mailing List, Feb 18 2021
%H A341707 Jinyuan Wang, <a href="/A341707/b341707.txt">Table of n, a(n) for n = 0..10000</a>
%e A341707 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).
%t A341707 {0}~Join~Array[Fold[Subtract, Reverse@ IntegerReverse[2^(-1 + Position[Reverse@ IntegerDigits[#, 2], 1][[All, 1]] )]] &, 69] (* _Michael De Vlieger_, Feb 25 2021 *)
%o A341707 (PARI)
%o A341707 /* 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. */
%o A341707 y2d(n)=if(n=binary(n),n[1]*=-1);-sum(k=0,#n-1,n[#n-k]*R(2^k))
%o A341707 R(n)=fromdigits(Vecrev(digits(n)))
%o A341707 apply(y2d, [0..99]) \\ _M. F. Hasler_, Feb 18 2021
%o A341707 (Python)
%o A341707 def reverse(n):
%o A341707     s = 0
%o A341707     while n > 0:
%o A341707         d, n = n%10, n//10
%o A341707         s = 10*s+d
%o A341707     return s
%o A341707 def A341707(n):
%o A341707     s, t = 0, 1
%o A341707     while n > 0:
%o A341707         b, n = n%2, n//2
%o A341707         if n > 0:
%o A341707             s, t = reverse(t*b)+s, 2*t
%o A341707         else:
%o A341707             s = reverse(t*b)-s
%o A341707     return s # _A.H.M. Smeets_, Feb 18 2021
%Y A341707 Cf. A004094.
%Y A341707 See A341708 for the negative terms.
%Y A341707 See A341709 for a different version of a yranib sequence.
%K A341707 sign,base,look
%O A341707 0,3
%A A341707 _N. J. A. Sloane_, Feb 18 2021
%E A341707 Further terms from _M. F. Hasler_, Feb 18 2021