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.

A078826 Number of distinct primes contained as binary substrings in binary representation of n.

Original entry on oeis.org

0, 0, 1, 1, 1, 2, 2, 2, 1, 1, 2, 4, 2, 4, 3, 2, 1, 2, 1, 3, 2, 2, 4, 6, 2, 2, 4, 5, 3, 6, 3, 3, 1, 1, 2, 3, 1, 3, 3, 4, 2, 3, 2, 5, 4, 5, 6, 7, 2, 3, 2, 3, 4, 5, 5, 7, 3, 3, 6, 8, 3, 7, 4, 3, 1, 1, 1, 3, 2, 3, 3, 5, 1, 2, 3, 5, 3, 5, 4, 5, 2, 3, 3, 6, 2, 2, 5, 7, 4, 5, 5, 5, 6, 8, 7, 8, 2, 3, 3, 3, 2, 5, 3, 5, 4
Offset: 0

Views

Author

Reinhard Zumkeller, Dec 08 2002

Keywords

Comments

A143792(n) <= a(n) for n > 0. - Reinhard Zumkeller, Sep 08 2008
For n > 1: number of primes in n-th row of A165416, lengths in n-th row of A225243. - Reinhard Zumkeller, Jul 17 2015, Aug 14 2013

Examples

			n=7 -> '111' contains 2 different binary substrings which are primes: '11' (11b or b11) and '111' itself, therefore a(7)=2.
		

Crossrefs

Programs

  • Haskell
    a078826 n | n <= 1 = 0
              | otherwise = length $ a225243_row n
    -- Reinhard Zumkeller, Aug 14 2013
  • Mathematica
    a[n_] := (bits = IntegerDigits[n, 2]; lg = Length[bits]; Reap[Do[If[PrimeQ[p = FromDigits[bits[[i ;; j]], 2]], Sow[p]], {i, 1, lg-1}, {j, i+1, lg}]][[2, 1]] // Union // Length); a[0] = a[1] = 0; Table[a[n], {n, 0, 104}] (* Jean-François Alcover, May 23 2013 *)

A165416 Irregular array read by rows: The n-th row contains those distinct positive integers that each, when written in binary, occurs as a substring in binary n.

Original entry on oeis.org

1, 1, 2, 1, 3, 1, 2, 4, 1, 2, 5, 1, 2, 3, 6, 1, 3, 7, 1, 2, 4, 8, 1, 2, 4, 9, 1, 2, 5, 10, 1, 2, 3, 5, 11, 1, 2, 3, 4, 6, 12, 1, 2, 3, 5, 6, 13, 1, 2, 3, 6, 7, 14, 1, 3, 7, 15, 1, 2, 4, 8, 16, 1, 2, 4, 8, 17, 1, 2, 4, 9, 18, 1, 2, 3, 4, 9, 19, 1, 2, 4, 5, 10, 20, 1, 2, 5, 10, 21, 1, 2, 3, 5, 6, 11, 22, 1
Offset: 1

Views

Author

Leroy Quet, Sep 17 2009

Keywords

Comments

This is sequence A119709 with the 0's removed.
The n-th row of this sequence contains A122953(n) terms.

Examples

			6 in binary is 110. The distinct positive integers that occur as substrings in n when they and n are written in binary are: 1 (1 in binary), 2 (10 in binary), 3 (11 in binary), and 6 (110 in binary). So row 6 is (1,2,3,6).
		

Crossrefs

Cf. A030308.
Cf. A165153 (row products), A225243 (subsequence).

Programs

  • Haskell
    a165416 n k = a165416_tabf !! (n-1) !! (k-1)
    a165416_row n = a165416_tabf !! (n-1)
    a165416_tabf = map (dropWhile (== 0)) $ tail a119709_tabf
    -- Reinhard Zumkeller, Aug 14 2013

Extensions

Extended by Ray Chandler, Mar 13 2010

A078833 Greatest prime contained as binary substring in binary representation of n>1, a(1)=1.

Original entry on oeis.org

1, 2, 3, 2, 5, 3, 7, 2, 2, 5, 11, 3, 13, 7, 7, 2, 17, 2, 19, 5, 5, 11, 23, 3, 3, 13, 13, 7, 29, 7, 31, 2, 2, 17, 17, 2, 37, 19, 19, 5, 41, 5, 43, 11, 13, 23, 47, 3, 17, 3, 19, 13, 53, 13, 23, 7, 7, 29, 59, 7, 61, 31, 31, 2, 2, 2, 67, 17, 17, 17, 71, 2, 73, 37, 37, 19, 19, 19, 79, 5, 17
Offset: 1

Views

Author

Reinhard Zumkeller, Dec 08 2002

Keywords

Comments

a(n) = A039634(n) for n<=44, but a(45) = 13 <> 11 = A039634(45);
for n>1: a(n) = n iff n is prime.
a(n) = A225243(n, A078826(n)). - Reinhard Zumkeller, Aug 14 2013

Examples

			n=12 -> '1100' contains 2 binary substrings which are primes: '11' (11bb) and '10' (b11b); 3='11' is the greater one, therefore a(12)=3.
		

Crossrefs

Programs

A078832 Smallest prime contained as binary substring in binary representation of n>1, a(1)=1.

Original entry on oeis.org

1, 2, 3, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
Offset: 1

Views

Author

Reinhard Zumkeller, Dec 08 2002

Keywords

Comments

a(n)<=3 and for n>1: a(n)>=2 and a(n)=3 iff n=2^k-1, k>1.
a(n) = A225243(n,1). - Reinhard Zumkeller, Aug 14 2013

Crossrefs

Programs

Formula

For n > 1: a(n) = A036987(n) + 2. Reinhard Zumkeller, Aug 14 2013

A143792 a(n) = the number of distinct prime divisors, p, of n that, when p is represented in binary, each p occurs at least once in the binary representation of n.

Original entry on oeis.org

0, 1, 1, 1, 1, 2, 1, 1, 0, 2, 1, 2, 1, 2, 1, 1, 1, 1, 1, 2, 0, 2, 1, 2, 0, 2, 1, 2, 1, 2, 1, 1, 0, 2, 0, 1, 1, 2, 1, 2, 1, 1, 1, 2, 2, 2, 1, 2, 0, 1, 1, 2, 1, 2, 2, 2, 1, 2, 1, 2, 1, 2, 2, 1, 0, 1, 1, 2, 0, 1, 1, 1, 1, 2, 2, 2, 0, 2, 1, 2, 0, 2, 1, 1, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 2
Offset: 1

Views

Author

Leroy Quet, Sep 01 2008

Keywords

Comments

a(2^k * p) = 2, where k = any positive integer and p = any odd prime.
a(p) = 1, where p = any prime.
a(2^k) = 1, where k = any positive integer.
a(n) <= A078826(n). - Reinhard Zumkeller, Sep 08 2008
Size of intersection of n-th rows of tables A225243 and A027748. - Reinhard Zumkeller, Aug 14 2013

Examples

			60 in binary is 111100. The distinct primes dividing 60 are 2 (which is 10 in binary), 3 (11 in binary) and 5 (101) in binary. The string 10 does occur within 111100 like so: 111(10)0. The string 11 also occurs (multiple times) within 111100, in one way like so: (11)1100. But the string 101 does not occur in 111100. Since 2 and 3 occur within 60 (when each of these numbers is written in binary), but 5 does not, then a(60) = 2.
		

Crossrefs

Cf. A143791.

Programs

  • Haskell
    import Data.List (intersect)
    a143792 n = length $ a225243_row n `intersect` a027748_row (fromIntegral n)
    -- Reinhard Zumkeller, Aug 14 2013
  • Mathematica
    f[n_] := Block[{nb = ToString@ FromDigits@ IntegerDigits[n, 2], psb = ToString@ FromDigits@ IntegerDigits[ #, 2] & /@ First@ Transpose@ FactorInteger@ n, c = 0, k = 1}, lmt = 1 + Length@ psb; While[k < lmt, If[ StringCount[nb, psb[[k]]] > 0, c++ ]; k++ ]; c]; f[1] = 0; Array[f, 105] (* Robert G. Wilson v, Sep 22 2008 *)

Extensions

More terms from Robert G. Wilson v, Sep 22 2008

A078829 Numbers having exactly one prime contained as binary substring in binary representation of n.

Original entry on oeis.org

2, 3, 4, 8, 9, 16, 18, 32, 33, 36, 64, 65, 66, 72, 128, 129, 130, 132, 144, 256, 258, 260, 264, 265, 288, 289, 512, 513, 516, 520, 528, 530, 576, 578, 1024, 1025, 1026, 1032, 1040, 1056, 1057, 1060, 1152, 1156, 2048, 2049, 2050, 2052, 2064, 2080, 2112, 2114
Offset: 1

Views

Author

Reinhard Zumkeller, Dec 08 2002

Keywords

Comments

A078826(a(n)) = 1; A078830 is a subsequence;
for k>2 also floor(a(k)/2) belongs to the sequence.

Examples

			n=18 -> '10010' contains only 1 distinct binary substring which is prime: '10' (10bbb or bbb10), therefore 18 is a term.
		

Crossrefs

Programs

  • Haskell
    a078829 n = a078829_list !! (n-1)
    a078829_list = filter ((== 1) . a078826) [1..]
    -- Reinhard Zumkeller, Jul 17 2015
  • Mathematica
    primeCount[n_] := (bits = IntegerDigits[n, 2]; lg = Length[bits]; Reap[Do[If[PrimeQ[p = FromDigits[bits[[i ;; j]], 2]], Sow[p]], {i, 1, lg-1}, {j, i+1, lg}]][[2, 1]] // Union // Length); primeCount[1] = 0; Select[Range[3000], primeCount[#] == 1 &] (* Jean-François Alcover, May 23 2013 *)
Showing 1-6 of 6 results.