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.

A277351 Value of (n+1,n) concatenated in binary representation.

Original entry on oeis.org

5, 14, 19, 44, 53, 62, 71, 152, 169, 186, 203, 220, 237, 254, 271, 560, 593, 626, 659, 692, 725, 758, 791, 824, 857, 890, 923, 956, 989, 1022, 1055, 2144, 2209, 2274, 2339, 2404, 2469, 2534, 2599, 2664, 2729, 2794, 2859, 2924, 2989, 3054, 3119, 3184, 3249, 3314
Offset: 1

Views

Author

Paolo P. Lava, Oct 10 2016

Keywords

Examples

			Binary representation of 12 and 13 are 1100 and 1101. Then, concat(1101,1100) = 11011100 converted in decimal representation is 220.
		

Crossrefs

Programs

  • Maple
    f:= n -> (n+1)*2^(1+ilog2(n))+n:
    map(f, [$1..100]); # Robert Israel, Oct 14 2016
  • Mathematica
    Table[FromDigits[Join @@ Map[IntegerDigits[#, 2] &, {n + 1, n}], 2], {n, 50}] (* Michael De Vlieger, Oct 14 2016 *)
  • PARI
    a(n) = subst(Pol(concat(binary(n+1), binary(n))), x, 2); \\ Michel Marcus, Oct 10 2016
    
  • PARI
    a(n) = (n+1)*2^(1+logint(n,2)) + n; \\ after Maple; Michel Marcus, Oct 15 2016
    
  • Python
    def a(n): return int(bin(n+1)[2:] + bin(n)[2:], 2)
    print([a(n) for n in range(1, 51)]) # Michael S. Branicky, May 14 2021

Formula

a(n) = (n+1) * 2^A070939(n) + n.
G.f.: (1-x)^(-2)*(5*x - 2*x^2 + Sum_{m>=1} ((2^(2*m)+2^m)*x^(2^m) - 2^(2*m)*x^(2^m+1))). - Robert Israel, Oct 14 2016

A287018 Primes that can be generated by the concatenation in base 2, in ascending order, of two consecutive integers read in base 10.

Original entry on oeis.org

11, 37, 137, 239, 661, 727, 859, 991, 2081, 2341, 2731, 2861, 3121, 3251, 3511, 9547, 10321, 10837, 11353, 13159, 13417, 13933, 14449, 15739, 34439, 40093, 43177, 43691, 45233, 46261, 60139, 61681, 63737, 135433, 138511, 139537, 144667, 146719, 151849, 154927
Offset: 1

Views

Author

Paolo P. Lava, May 18 2017

Keywords

Examples

			2 and 3 in base 2 are 10 and 11 and concat(10,11) = 1011 is 11 in base 10.
4 and 5 in base 2 are 100 and 101 and concat(100,101) = 100101 is 37 in base 10.
		

Crossrefs

Subsequence of primes of A087737.

Programs

  • Maple
    with(numtheory): P:= proc(q) local a,b,c,n; a:=convert(q+1,binary,decimal); b:=convert(q,binary,decimal); c:=convert(b*10^(ilog10(a)+1)+a,decimal,binary); if isprime(c) then c; fi; end: seq(P(i),i=1..1000);
  • Mathematica
    Select[Map[FromDigits[Apply[Join, IntegerDigits[#, 2]], 2] &, Partition[Range@ 320, 2, 1]], PrimeQ] (* Michael De Vlieger, May 18 2017 *)
  • PARI
    lista(nn) = {for (n=1, nn, if (isprime(p=fromdigits(Vec(concat(binary(n), binary(n+1))), 2)), print1(p, ", ")));} \\ Michel Marcus, May 20 2017
Showing 1-2 of 2 results.