A154703 Concatenation of the first n primes written in base 2.
10, 1011, 1011101, 1011101111, 10111011111011, 101110111110111101, 10111011111011110110001, 1011101111101111011000110011, 101110111110111101100011001110111, 10111011111011110110001100111011111101, 1011101111101111011000110011101111110111111
Offset: 1
Examples
a(2) = 1011 = 10 Concat 11 = (2 base 2) Concat (3 base 2).
Links
- Seiichi Manyama, Table of n, a(n) for n = 1..122
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
Extensions
Corrected terms a(6) and beyond from Seiichi Manyama, Jul 17 2023
Comments