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-6 of 6 results.

A348792 Numbers k such that the reverse concatenation of the first k binary numbers A098780(k) is prime.

Original entry on oeis.org

2, 3, 4, 7, 11, 13, 25, 97, 110, 1939
Offset: 1

Views

Author

N. J. A. Sloane, Dec 03 2021

Keywords

Examples

			a(4) = 7 is because the binary number 111 110 101 100 11 10 1 (with no spaces), which is 128413 in decimal, is prime.
		

Crossrefs

Programs

  • Maple
    q:= n-> isprime(Bits[Join](['Bits[Split](i)[]'$i=1..n])):
    select(q, [$1..200])[];  # Alois P. Heinz, Dec 03 2021
  • Mathematica
    f[n_] := FromDigits[Flatten @ IntegerDigits[Range[n, 1, -1], 2], 2]; Select[Range[120], PrimeQ[f[#]] &] (* Amiram Eldar, Dec 03 2021 *)
  • Python
    from sympy import isprime
    def afind(limit):
        s, k = "", 1
        for k in range(1, limit+1):
            s += bin(k)[2:][::-1]
            t = int(s[::-1], 2)
            if isprime(t):
                print(k, end=", ")
    afind(200) # Michael S. Branicky, Dec 03 2021

Extensions

a(8)-a(10) from Amiram Eldar, Dec 03 2021

A300570 a(n) is the concatenation n in base 2, n-1 in base 2, ..., 1 in base 2.

Original entry on oeis.org

1, 101, 11101, 10011101, 10110011101, 11010110011101, 11111010110011101, 100011111010110011101, 1001100011111010110011101, 10101001100011111010110011101, 101110101001100011111010110011101, 1100101110101001100011111010110011101
Offset: 1

Views

Author

Seiichi Manyama, Mar 08 2018

Keywords

Crossrefs

Cf. A098780 (decimal expansion of terms).

Programs

  • Maple
    a:= proc(n) option remember; `if`(n=1, 1,
          parse(cat(convert(n, binary), a(n-1))))
        end:
    seq(a(n), n=1..12);  # Alois P. Heinz, Feb 19 2023
  • Mathematica
    Table[FromDigits[Flatten[IntegerDigits[#,2]&/@Range[n,1,-1]]],{n,20}] (* Harvey P. Dale, Sep 07 2020 *)
  • Python
    from itertools import count, islice
    def agen(): # generator of terms
        s = ""
        for k in count(1):
            s = bin(k)[2:] + s
            yield int(s)
    print(list(islice(agen(), 15))) # Michael S. Branicky, Feb 19 2023
    
  • Python
    from functools import reduce
    def A300570(n): return int(bin(reduce(lambda i,j:(i<Chai Wah Wu, Feb 26 2023

A175909 Decimal representation of the binary number formed by the concatenation of digits which are the same in both the left and right binary concatenations of the integers 1 to n.

Original entry on oeis.org

1, 1, 7, 46, 29, 219, 495, 1502, 368357, 27603, 120539, 1797358, 462906349, 32361431, 33008607, 12857291758, 5972138981, 750631865, 99509722923, 13841055262, 31762354574285, 1019248986603, 8645573738319287
Offset: 1

Views

Author

Dylan Hamilton, Oct 14 2010

Keywords

Crossrefs

Programs

  • Mathematica
    Module[{l,r,d},l = {}; r = {}; Table[d = IntegerDigits[x, 2]; l = Flatten[{l, d}]; r = Flatten[{d, r}]; FromDigits[ Pick[l, EvenQ[l + r]], 2], {x, 1, DESIRED_NUMBER_OF_TERMS}]]

A175910 Take the left or right binary concatenation of the numbers 1 to n, whichever is greater, delete digits identical to corresponding digits in the other concatenation, condense the remaining digits, and convert to decimal.

Original entry on oeis.org

0, 2, 2, 2, 44, 42, 178, 812, 52, 11682, 44585, 52778, 3222, 727657, 15264354, 928184, 60925872, 15976986770, 4166367305, 785545793868, 11730991244, 11804109800746, 41522369301, 3574301245885612, 198659132140236
Offset: 1

Views

Author

Dylan Hamilton, Oct 14 2010

Keywords

Crossrefs

Programs

  • Mathematica
    Module[{l,r,d,ldump,larger,rdump},l = {}; r = {}; Table[d = IntegerDigits[x, 2]; l = Flatten[{l, d}]; r = Flatten[{d, r}]; If[x > 1, ldump = l; rdump = r; While[First[ldump] == First[rdump], ldump = Rest[ldump]; rdump = Rest[rdump]]; If[First[ldump] == 1, larger = ldump, larger = rdump]; FromDigits[Pick[larger, OddQ[ldump + rdump]], 2], 0], {x, 1, DESIRED_NUMBER_OF_TERMS}]]

A175913 Convert to decimal the number resulting from performing binary xnor on the corresponding digits in the left and right binary concatenations of the integers one to n.

Original entry on oeis.org

1, 4, 25, 190, 1159, 15692, 111381, 1416474, 24608235, 291074808, 5162763209, 125052555486, 2198977618351, 28389504497340, 487294161504141, 11589641752262546, 395151697837143155, 13197172619557324880
Offset: 1

Views

Author

Dylan Hamilton, Oct 14 2010

Keywords

Crossrefs

Programs

  • Mathematica
    frombinrep[x_] := FromDigits[Flatten[Table[Table[If[OddQ[ n], 1, 0], {d, 1, x[[n]]}], {n, 1, Length[x]}]], 2]
    repcount[x_] := Length/@Split[x]
    l = {}; r = {}; Table[d = IntegerDigits[x, 2]; l = Flatten[{l, d}]; r = Flatten[{d, r}]; frombinrep[ repcount[EvenQ[l + r]]], {x, 1, DESIRED NUMBER OF TERMS HERE}]

A360508 Numbers k such that A300570(k) considered simply as a decimal string is prime.

Original entry on oeis.org

2, 4, 13, 57, 64, 349
Offset: 1

Views

Author

N. J. A. Sloane, Feb 19 2023

Keywords

Examples

			A300570(4) = 10011101 = A000040(665267) is prime, so 4 is a term.
A300570(5) = 10110011101 = 6389*1582409 is composite, so 5 is not a term.
		

Crossrefs

Cf. A300570, A098780 (A300570 converted to base 10), A348792 (primes in A098780).

Programs

  • Mathematica
    Select[Range[350], PrimeQ[FromDigits[Flatten[IntegerDigits[Range[#, 1, -1], 2]]]] &] (* Amiram Eldar, Feb 19 2023 *)
  • Python
    from sympy import isprime
    from itertools import count, islice
    def agen(): # generator of terms
        s = ""
        for k in count(1):
            s = bin(k)[2:] + s
            if isprime(int(s)): yield k
    print(list(islice(agen(), 5))) # Michael S. Branicky, Feb 19 2023

Extensions

a(6) from Alois P. Heinz, Feb 19 2023
Showing 1-6 of 6 results.