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.

A154703 Concatenation of the first n primes written in base 2.

Original entry on oeis.org

10, 1011, 1011101, 1011101111, 10111011111011, 101110111110111101, 10111011111011110110001, 1011101111101111011000110011, 101110111110111101100011001110111, 10111011111011110110001100111011111101, 1011101111101111011000110011101111110111111
Offset: 1

Views

Author

Jonathan Vos Post, Jan 14 2009

Keywords

Comments

Number of bits in a(n) = Sum_{i=1..n} A035100(i). See A328659(n).

Examples

			a(2) = 1011 = 10 Concat 11 = (2 base 2) Concat (3 base 2).
		

Crossrefs

Programs

  • Maple
    A154703 := proc(n) option remember: local d: if(n=1)then return 10: fi: d:=convert(ithprime(n),base,2): return parse(cat(convert(procname(n-1),string), convert(op(convert(d,base,10,10^nops(d))),string))): end: seq(A154703(n),n=1..10); # Nathaniel Johnston, May 27 2011
    # second Maple program:
    a:= proc(n) option remember; `if`(n=0, 0,
          parse(cat(a(n-1), convert(ithprime(n), binary))))
        end:
    seq(a(n), n=1..12);  # Alois P. Heinz, Dec 16 2024
  • Mathematica
    With[{p = IntegerDigits[Prime[Range[15]], 2]}, Array[FromDigits[Flatten[p[[;;#]]]] &, Length[p]]] (* Paolo Xausa, Feb 26 2024 *)
  • PARI
    a(n) = fromdigits(concat(apply(binary, primes(n)))); \\ Michel Marcus, Jul 17 2023

Formula

a(n) = CONCATENATE[i=1..n] A004676(i) = CONCATENATE[i=1..n] A007088(A000040(i)).

Extensions

Corrected terms a(6) and beyond from Seiichi Manyama, Jul 17 2023

A345867 Total number of 0's in the binary expansions of the first n primes.

Original entry on oeis.org

1, 1, 2, 2, 3, 4, 7, 9, 10, 11, 11, 14, 17, 19, 20, 22, 23, 24, 28, 31, 35, 37, 40, 43, 47, 50, 52, 54, 56, 59, 59, 64, 69, 73, 77, 80, 83, 87, 90, 93, 96, 99, 100, 105, 109, 112, 115, 116, 119, 122, 125, 126, 129, 130, 137, 142, 147, 151, 156, 161, 165, 170
Offset: 1

Views

Author

Alois P. Heinz, Jun 26 2021

Keywords

Examples

			a(3) = 2: 2 = 10_2, 3 = 11_2, 5 = 101_2, so there are two 0's in the binary expansions of the first three primes.
		

Crossrefs

Partial sums of A035103.

Programs

  • Maple
    a:= proc(n) option remember; `if`(n=0, 0, a(n-1)
          +add(1-i, i=Bits[Split](ithprime(n))))
        end:
    seq(a(n), n=1..100);
  • Mathematica
    Accumulate[DigitCount[Prime[Range[100]], 2, 0]] (* Paolo Xausa, Feb 26 2024 *)
  • Python
    from sympy import prime, primerange
    from itertools import accumulate
    def f(n): return (bin(n)[2:]).count('0')
    def aupton(nn): return list(accumulate(map(f, primerange(2, prime(nn)+1))))
    print(aupton(62)) # Michael S. Branicky, Jun 26 2021

Formula

a(n) = Sum_{i=1..n} A035103(i).
a(n) = a(n-1) for n in { A059305 }.
a(n) = A328659(n) - A095375(n).
Showing 1-2 of 2 results.