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.

A225243 Irregular triangle read by rows, where row n contains the distinct primes that are contained in the binary representation of n as substrings; first row = [1] by convention.

This page as a plain text file.
%I A225243 #58 Jan 27 2022 21:04:24
%S A225243 1,2,3,2,2,5,2,3,3,7,2,2,2,5,2,3,5,11,2,3,2,3,5,13,2,3,7,3,7,2,2,17,2,
%T A225243 2,3,19,2,5,2,5,2,3,5,11,2,3,5,7,11,23,2,3,2,3,2,3,5,13,2,3,5,11,13,2,
%U A225243 3,7,2,3,5,7,13,29,2,3,7,3,7,31,2,2,2,17
%N A225243 Irregular triangle read by rows, where row n contains the distinct primes that are contained in the binary representation of n as substrings; first row = [1] by convention.
%C A225243 Row n = primes in row n of tables A165416 or A119709.
%H A225243 Reinhard Zumkeller, <a href="/A225243/b225243.txt">Rows n = 1..1024 of table, flattened</a>
%H A225243 Michael De Vlieger, <a href="/A225243/a225243.png">Plot of pi(p) such that T(n,k) = p</a> for n = 1..4096.
%e A225243 .   n   T(n,*)              |  in binary
%e A225243 .  ---  --------------------|-------------------------------------------
%e A225243 .   1:  1                   |  00001:  .
%e A225243 .   2:  2                   |  00100:  ___10
%e A225243 .   3:  3                   |  00011:  ___11
%e A225243 .   4:  2                   |  00100:  __10_
%e A225243 .   5:  2  5                |  00101:  ___10 _11__
%e A225243 .   6:  2  3                |  00110:  ___10 __11_
%e A225243 .   7:  3  7                |  00111:  __11_ __111
%e A225243 .   8:  2                   |  01000:  _10__
%e A225243 .   9:  2                   |  01001:  _10__
%e A225243 .  10:  2  5                |  01010:  _10__ _101_
%e A225243 .  11:  2  3  5 11          |  01011:  _10__ ___11 _101_ 01011
%e A225243 .  12:  2  3                |  01100:  ___10 _11__
%e A225243 .  13:  2  3  5 13          |  01101:  __10_ _11__ __101 01101
%e A225243 .  14:  2  3  7             |  01110:  ___10 _11__ _111_
%e A225243 .  15:  3  7                |  01111:  _11__ _111_
%e A225243 .  16:  2                   |  10000:  10___
%e A225243 .  17:  2 17                |  10001:  10___ 10001
%e A225243 .  18:  2                   |  10010:  10___
%e A225243 .  19:  2  3 19             |  10011:  10___ ___11 10011
%e A225243 .  20:  2  5                |  10100:  10___ 101__
%e A225243 .  21:  2  5                |  10101:  10___ 101__
%e A225243 .  22:  2  3  5 11          |  10110:  10___ __11_ 101__ 10110
%e A225243 .  23:  2  3  5  7 11 23    |  10111:  10___ __11_ 101__ __111 1011_ 10111
%e A225243 .  24:  2  3                |  11000:  _10__ 11___
%e A225243 .  25:  2  3                |  11001:  _10__ 11___ .
%t A225243 Array[Union@ Select[FromDigits[#, 2] & /@ Rest@ Subsequences@ IntegerDigits[#, 2], PrimeQ] &, 34] /. {} -> {1} // Flatten (* _Michael De Vlieger_, Jan 26 2022 *)
%o A225243 (Haskell)
%o A225243 a225243 n k = a225243_tabf !! (n-1) !! (k-1)
%o A225243 a225243_row n = a225243_tabf !! (n-1)
%o A225243 a225243_tabf = [1] : map (filter ((== 1) . a010051')) (tail a165416_tabf)
%o A225243 (Python)
%o A225243 from sympy import isprime
%o A225243 from itertools import count, islice
%o A225243 def primess(n):
%o A225243     b = bin(n)[2:]
%o A225243     ss = (int(b[i:j], 2) for i in range(len(b)) for j in range(i+2, len(b)+1))
%o A225243     return sorted(set(k for k in ss if isprime(k)))
%o A225243 def agen():
%o A225243     yield 1
%o A225243     for n in count(2):
%o A225243         yield from primess(n)
%o A225243 print(list(islice(agen(), 82))) # _Michael S. Branicky_, Jan 26 2022
%Y A225243 Cf. A078826 (row lengths), A078832 (left edge), A078833 (right edge), A004676, A007088.
%K A225243 nonn,base,tabf
%O A225243 1,2
%A A225243 _Reinhard Zumkeller_, Aug 14 2013