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.

Previous Showing 21-29 of 29 results.

A265236 Number of solutions to the equation A x B = C, where A, B and C are nonnegative numbers appearing as (contiguous) substrings of the binary representation of n.

Original entry on oeis.org

1, 1, 8, 3, 13, 12, 18, 5, 19, 17, 18, 20, 31, 26, 28, 7, 26, 23, 23, 26, 31, 22, 32, 28, 47, 40, 38, 34, 49, 40, 38, 9, 34, 30, 29, 31, 31, 31, 38, 34, 47, 39, 28, 34, 53, 40, 46, 38, 66, 55, 54, 48, 59, 46, 46, 48, 75, 62, 58, 52, 67, 58, 48, 11, 43, 38
Offset: 0

Views

Author

Reinhard Zumkeller, Dec 06 2015

Keywords

Comments

A, B and C are allowed to be zero, in contrast to A265008;
a(A000225(n)) = A265008(A000225(n));
a(A062289(n)) != A265008(A062289(n)).

Examples

			.  n | A007088 | A119709     |  a |
. ---+---------+-------------+----+-------------------------------------
.  2 |      10 | [0,1,2]     |  8 = #{(0,0,0), (0,1,0), (0,2,0), (1,0,0),
.    |         |             |        (2,0,0), (1,1,1), (1,2,2), (2,1,2)}
.  3 |      11 | [1,3]       |  3 = #{(1,1,1), (1,3,3), (3,1,3)}
.  4 |     100 | [0,1,2,4]   | 13 = #{(0,0,0), (0,1,0), (0,2,0), (0,4,0),
.    |         |             |         (1,0,0), (2,0,0), (4,0,0), (1,1,1),
.    |         |             |         (1,2,2), (2,1,2), (1,4,4), (2,2,4),
.    |         |             |         (4,1,4)}
.  5 |     101 | [0,1,2,5]   | 12 = #{(0,0,0), (0,1,0), (0,2,0), (0,5,0),
.    |         |             |         (1,0,0), (2,0,0), (5,0,0), (1,1,1),
.    |         |             |         (1,2,2), (2,1,2), (1,5,5), (5,1,5)}
.  6 |     110 | [0,1,2,3,6] | 18 = #{(0,0,0), (0,1,0), (0,2,0), (0,3,0),
.    |         |             |         (0,6,0), (1,0,0), (2,0,0), (3,0,0),
.    |         |             |         (6,0,0), (1,1,1), (1,2,2), (2,1,2),
.    |         |             |         (1,3,3), (3,1,3), (1,6,6), (2,3,6),
.    |         |             |         (3,2,6), (6,1,6)}
.  7 |     111 | [1,3,7]     |≈ 5 = #{(1,1,1), (1,3,3), (3,1,3), (1,7,7),
.    |         |             |         (7,1,7)} .
		

Crossrefs

Programs

  • Haskell
    a265236 n = length [() | let cs = a119709_row n, a <- cs, b <- cs, c <- cs,
                             a * b == c || c == 0 && a * b == 0]

Formula

For n > 0: a(n) = A265008(n) + A043545(n) * (2*A078822(n) - 1).

Extensions

Suggested by N. J. A. Sloane.

A272851 Number of distinct nonzero Fibonacci numbers among the contiguous substrings of the binary digits of n.

Original entry on oeis.org

1, 2, 2, 2, 3, 3, 2, 3, 2, 3, 4, 3, 5, 3, 2, 3, 3, 2, 3, 3, 4, 4, 4, 4, 3, 5, 5, 3, 5, 3, 2, 3, 3, 4, 4, 2, 3, 3, 3, 4, 3, 4, 5, 4, 5, 4, 4, 4, 4, 3, 3, 5, 6, 5, 6, 4, 3, 5, 5, 3, 5, 3, 2, 3, 3, 3, 4, 4, 5, 4, 4, 3, 2, 3, 4, 3, 5, 3, 3, 4
Offset: 1

Views

Author

Marko Riedel, May 07 2016

Keywords

Examples

			a(53) = 6 because 53=(110101)_2 which contains (1)_2 = 1, (10)_2 = 2, (11)_2 = 3, (101)_2 = 5, (1101)_2 = 13 and (10101)_2 = 21. The one digit only contributes once.
		

Crossrefs

Programs

  • Mathematica
    s = Fibonacci@ Range@ 30; Table[Length@ Select[Union@ Flatten@ Function[k, Map[FromDigits[#, 2] & /@ Partition[k, #, 1] &, Range@ Length@ k]]@IntegerDigits[#, 2] &@ n, MemberQ[s, #] &], {n, 120}] (* Michael De Vlieger, May 08 2016 *)
  • PARI
    isfib(n) = my(k=n^2); k+=(k+1)<<2; issquare(k) || (n>0 && issquare(k-8)) ;
    a(n) = {vb = binary(n); vf = []; for (i=1, #vb, for (j=1, #vb - i + 1, pvb = vector(j, k, vb[i+k-1]); f = subst(Pol(pvb), x, 2); if (f && isfib(f), vf = Set(concat(vf, f))););); #vf;} \\ Michel Marcus, May 08 2016

A301977 a(n) is the number of distinct positive numbers whose binary digits appear in order but not necessarily as consecutive digits in the binary representation of n.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Mar 30 2018

Keywords

Comments

This sequence has similarities with A078822; there we consider consecutive digits, here not.

Examples

			The first terms, alongside the binary representations of n and of the numbers k whose binary digits appear in order in the binary representation of k, are:
  n  a(n)  bin(n)    bin(k)
  -- ----  ------    ------
   1    1       1    1
   2    2      10    1, 10
   3    2      11    1, 11
   4    3     100    1, 10, 100
   5    4     101    1, 10, 11, 101
   6    4     110    1, 10, 11, 110
   7    3     111    1, 11, 111
   8    4    1000    1, 10, 100, 1000
   9    6    1001    1, 10, 11, 100, 101, 1001
  10    7    1010    1, 10, 11, 100, 101, 110, 1010
  11    6    1011    1, 10, 11, 101, 111, 1011
  12    6    1100    1, 10, 11, 100, 110, 1100
  13    7    1101    1, 10, 11, 101, 110, 111, 1101
  14    6    1110    1, 10, 11, 110, 111, 1110
  15    4    1111    1, 11, 111, 1111
  16    5   10000    1, 10, 100, 1000, 10000
  17    8   10001    1, 10, 11, 100, 101, 1000, 1001, 10001
  18   10   10010    1, 10, 11, 100, 101, 110, 1000, 1001, 1010, 10010
  19    9   10011    1, 10, 11, 100, 101, 111, 1001, 1011, 10011
  20   10   10100    1, 10, 11, 100, 101, 110, 1000, 1010, 1100, 10100
		

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember; `if`(n=0, {0},
          map(x-> [x, 2*x+r][], b(iquo(n, 2, 'r'))))
        end:
    a:= n-> nops(b(n))-1:
    seq(a(n), n=1..72);  # Alois P. Heinz, Jan 26 2022
  • PARI
    a(n) = my (b=binary(n), s=Set(1)); for (i=2, #b, s = setunion(s, Set(apply(v -> 2*v+b[i], s)))); return (#s)

Formula

a(2^n) = n + 1 for any n >= 0.
a(2^n - 1) = n for any n > 0.
a(2^n + k) = a(2^(n+1)-1 - k) for any n >= 0 and k=0..2^n-1.
a(n) >= A070939(n) for any n > 0.
a(n) = Sum_{k=1..n} (Stirling2(n+1,k) mod 2) (conjecture). - Ilya Gutkovskiy, Jul 04 2019

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

A078834 Greatest prime factor of n also contained as binary substring in binary representation of n; a(n)=1, if no such factor exists.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Dec 08 2002

Keywords

Comments

a(n) <= min{A078833(n), A006530(n)};
for n>1: a(n) = n iff n is prime.
a(A100484(n)) = A000040(n); a(A100368(n)) = A006530(A100368(n)). [Reinhard Zumkeller, Sep 19 2011]

Examples

			n=15=3*5 has two factors; only '11'=3 is contained in '1111'=15, therefore a(15)=3.
		

Crossrefs

Programs

  • Haskell
    import Numeric (showIntAtBase)
    import Data.List (find, isInfixOf)
    import Data.Maybe (fromMaybe)
    a078834 n = fromMaybe 1 $ find (\p -> showIntAtBase 2 ("01" !!) p ""
                              `isInfixOf` showIntAtBase 2 ("01" !!) n "") $
                     reverse $ a027748_row n
    -- Reinhard Zumkeller, Sep 19 2011
  • Mathematica
    a[n_] := Module[{bn, pp, sel}, bn = IntegerDigits[n, 2]; pp = FactorInteger[n][[All, 1]]; sel = Select[pp, MatchQ[bn, {_, Sequence @@ IntegerDigits[#, 2], _}] &]; If[sel == {}, 1, Max[sel]]]; Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Aug 13 2013 *)

A165153 a(n) = the product of all distinct positive (nonzero) integers that, when written in binary, occur as substrings in the binary representation of n.

Original entry on oeis.org

1, 2, 3, 8, 10, 36, 21, 64, 72, 100, 330, 1728, 2340, 3528, 315, 1024, 1088, 1296, 4104, 8000, 2100, 43560, 53130, 331776, 388800, 608400, 694980, 4741632, 6650280, 1587600, 9765, 32768, 33792, 36992, 114240, 46656, 239760, 935712, 1120392
Offset: 1

Views

Author

Leroy Quet, Sep 05 2009

Keywords

Crossrefs

Programs

Formula

a(n) = product(A165416(n,k): k=1..A078822(n)-1). - Reinhard Zumkeller, Aug 14 2013

Extensions

More terms from Sean A. Irvine, Nov 12 2009

A272886 Number of distinct Fibonacci numbers among the contiguous substrings of the binary digits of n.

Original entry on oeis.org

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

Views

Author

Marko Riedel, May 08 2016

Keywords

Examples

			a(53) = 7 because 53=(110101)_2 which contains (0)_2 = 0, (1)_2 = 1, (10)_2 = 2, (11)_2 = 3, (101)_2 = 5, (1101)_2 = 13 and (10101)_2 = 21. The one digit only contributes once as do two and zero.
		

Crossrefs

A078824 Number of distinct binary numbers contained as substrings in binary, circular formed representation of n and not longer than n.

Original entry on oeis.org

1, 1, 3, 2, 4, 6, 6, 3, 5, 8, 5, 10, 8, 10, 10, 4, 6, 10, 9, 13, 9, 12, 12, 15, 10, 13, 12, 15, 13, 15, 15, 5, 7, 12, 11, 16, 7, 16, 16, 19, 11, 16, 7, 19, 16, 12, 19, 21, 12, 16, 16, 19, 16, 19, 12, 21, 16, 19, 19, 21, 19, 21, 21, 6, 8, 14, 13, 19, 12, 19, 19, 23, 12, 17, 16, 24
Offset: 0

Views

Author

Reinhard Zumkeller, Dec 08 2002

Keywords

Comments

For k>0: a(2^k-1)=k, a(2^k)=k+2;
for k>1: a(2^k+1)=a(3*2^(k-1))=k+2;
for k>0: a(2^k-1)=A078822(2^k-1), a(2^k)=A078822(2^k).

Crossrefs

A078828 Product of all primes contained as binary substrings in binary representation of n.

Original entry on oeis.org

1, 1, 2, 3, 2, 10, 6, 63, 2, 2, 20, 330, 6, 390, 126, 1323, 2, 34, 4, 114, 20, 100, 660, 159390, 6, 6, 780, 12870, 126, 237510, 2646, 861273, 2, 2, 68, 102, 4, 740, 228, 2394, 20, 820, 200, 141900, 660, 42900, 318780, 157317930, 6, 102, 12, 342, 780, 206700
Offset: 0

Views

Author

Reinhard Zumkeller, Dec 08 2002

Keywords

Examples

			n=7: product of the A078827(7)=3 primes as binary substrings in binary representation of 7 -> '111': a(7) = '11'*'11'*'111' = 3*3*7 = 63.
		

Crossrefs

Previous Showing 21-29 of 29 results.