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.

Showing 1-2 of 2 results.

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

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Feb 18 2021

Keywords

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

Examples

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

References

  • Eric Angelini, Posting to Math Fun Mailing List, Feb 18 2021

Crossrefs

Cf. A004094.
See A341708 for the negative terms.
See A341709 for a different version of a yranib sequence.

Programs

  • Mathematica
    {0}~Join~Array[Fold[Subtract, Reverse@ IntegerReverse[2^(-1 + Position[Reverse@ IntegerDigits[#, 2], 1][[All, 1]] )]] &, 69] (* Michael De Vlieger, Feb 25 2021 *)
  • 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

Extensions

Further terms from M. F. Hasler, Feb 18 2021

A341713 Indices of Ennesrem primes: k such that A004094(k)-1 is prime.

Original entry on oeis.org

2, 3, 13, 21, 347, 1217, 1267, 16459, 100909, 342243
Offset: 1

Views

Author

N. J. A. Sloane, Feb 20 2021

Keywords

Comments

Numbers k such that reverse(2^k) - 1 is prime.
Is this sequence infinite?

Examples

			13 is a term, since 2^13 = 8192 -> 2918 -> 2917, which is prime.
		

Crossrefs

Programs

  • PARI
    for(n=1,10000,my(pe=fromdigits(Vecrev(digits(2^n)))-1);if(ispseudoprime(pe),print1(n,", "))) \\ Hugo Pfoertner, Feb 20 2021
    
  • Python
    from sympy import isprime
    def ok(k): return isprime(int(str(2**k)[::-1]) - 1)
    for k in range(1, 2*10**3):
      if ok(k): print(k, end=", ") # Michael S. Branicky, Feb 20 2021

Extensions

a(8) from Hugo Pfoertner, Feb 20 2021
a(9) from Hugo Pfoertner, Mar 22 2021
a(10) from Steven Charlton, Apr 26 2021
Showing 1-2 of 2 results.