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.

A355633 a(n) is the sum of the divisors of n whose binary expansions appear as substrings in the binary expansion of n.

Original entry on oeis.org

1, 3, 4, 7, 6, 12, 8, 15, 10, 18, 12, 28, 14, 24, 19, 31, 18, 30, 20, 42, 22, 36, 24, 60, 26, 42, 31, 56, 30, 57, 32, 63, 34, 54, 36, 70, 38, 60, 43, 90, 42, 66, 44, 84, 54, 72, 48, 124, 50, 78, 55, 98, 54, 93, 72, 120, 61, 90, 60, 133, 62, 96, 74, 127, 66
Offset: 1

Views

Author

Rémy Sigrist, Jul 11 2022

Keywords

Examples

			For n = 84:
- the binary expansion of 84 is "1010100",
- we have the following divisors:
  d   bin(d)   in bin(84)?
  --  -------  -----------
   1        1  Yes
   2       10  Yes
   3       11  No
   4      100  Yes
   6      110  No
   7      111  No
  12     1100  No
  14     1110  No
  21    10101  Yes
  28    11100  No
  42   101010  Yes
  84  1010100  Yes
- so a(84) = 1 + 2 + 4 + 21 + 42 + 84 = 154.
		

Crossrefs

Cf. A000203, A027750, A093640, A355620 (decimal analog), A355634.

Programs

  • Mathematica
    a[n_] := DivisorSum[n, # &, StringContainsQ @@ IntegerString[{n, #}, 2] &]; Array[a, 100] (* Amiram Eldar, Jul 16 2022 *)
  • PARI
    a(n, base=2) = { my (d=digits(n, base), s=setbinop((i, j) -> fromdigits(d[i..j], base), [1..#d]), v=0); for (k=1, #s, if (s[k] && n%s[k]==0, v+=s[k])); return (v) }
    
  • Python
    from sympy import divisors
    def a(n):
        s = bin(n)[2:]
        return sum(d for d in divisors(n, generator=True) if bin(d)[2:] in s)
    print([a(n) for n in range(1, 66)]) # Michael S. Branicky, Jul 11 2022

Formula

a(n) <= A000203(n).
a(2^n) = 2^(n+1) - 1 for any n >= 0.

A355632 Irregular triangle T(n, k), n > 0, k = 1..A121041(n), read by rows; the n-th row contains in ascending order the divisors of n whose decimal expansions appear as substrings in the decimal expansion of n.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 10, 1, 11, 1, 2, 12, 1, 13, 1, 14, 1, 5, 15, 1, 16, 1, 17, 1, 18, 1, 19, 2, 20, 1, 21, 2, 22, 23, 2, 4, 24, 5, 25, 2, 26, 27, 2, 28, 29, 3, 30, 1, 31, 2, 32, 3, 33, 34, 5, 35, 3, 6, 36, 37, 38, 3, 39, 4, 40, 1, 41, 2, 42, 43, 4, 44
Offset: 1

Views

Author

Rémy Sigrist, Jul 11 2022

Keywords

Examples

			Triangle T(n, k) begins:
     1: [1]
     2: [2]
     3: [3]
     4: [4]
     5: [5]
     6: [6]
     7: [7]
     8: [8]
     9: [9]
    10: [1, 10]
    11: [1, 11]
    12: [1, 2, 12]
    13: [1, 13]
    14: [1, 14]
    15: [1, 5, 15]
    16: [1, 16]
		

Crossrefs

Cf. A027750, A121041 (row lengths), A121042, A355620 (row sums), A355634 (binary analog).

Programs

  • Mathematica
    Table[Select[Divisors[n], StringContainsQ[IntegerString[n], IntegerString[#]] &], {n, 50}] (* Paolo Xausa, Jul 23 2024 *)
  • PARI
    row(n, base=10) = { my (d=digits(n, base), s=setbinop((i,j) -> fromdigits(d[i..j], base), [1..#d]), v=0); select(v -> v && n%v==0, s) }
    
  • Python
    from sympy import divisors
    def row(n):
        s = str(n)
        return sorted(d for d in divisors(n, generator=True) if str(d) in s)
    def table(r): return [i for n in range(1, r+1) for i in row(n)]
    print(table(44)) # Michael S. Branicky, Jul 11 2022

Formula

T(n, 1) = A121042(n).
T(n, A121041(n)) = n.
Sum_{k = 1..A121041(n)} T(n, k) = A355620(n).
Showing 1-2 of 2 results.