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.

A355620 a(n) is the sum of 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, 11, 12, 15, 14, 15, 21, 17, 18, 19, 20, 22, 22, 24, 23, 30, 30, 28, 27, 30, 29, 33, 32, 34, 36, 34, 40, 45, 37, 38, 42, 44, 42, 44, 43, 48, 50, 46, 47, 60, 49, 55, 52, 54, 53, 54, 60, 56, 57, 58, 59, 66, 62, 64, 66, 68, 70, 72, 67
Offset: 1

Views

Author

Rémy Sigrist, Jul 10 2022

Keywords

Examples

			For n = 110:
- the divisors of 110 are: 1, 2, 5, 10, 11, 22, 55, 110,
- 1, 10, 11 and 110 appear as substrings in 110,
- so a(110) = 1 + 10 + 11 + 110 = 132.
		

Crossrefs

Cf. A000203, A002275, A121041, A121042, A239058, A355633 (binary analog).

Programs

  • Mathematica
    Table[DivisorSum[n, # &, StringContainsQ[IntegerString[n], IntegerString[#]] &], {n, 100}] (* Paolo Xausa, Jul 23 2024 *)
  • PARI
    a(n, base=10) = { 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 = str(n)
        return sum(d for d in divisors(n, generator=True) if str(d) in s)
    print([a(n) for n in range(1, 68)]) # Michael S. Branicky, Jul 10 2022

Formula

a(n) >= n.
a(n) <= A000203(n) with equality iff n belongs to A239058.
a(10^n) = A002275(n+1) for any n >= 0.

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

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Jul 11 2022

Keywords

Examples

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

Crossrefs

Cf. A027750, A093640 (row lengths), A355632 (decimal analog), A355633 (row sums).

Programs

  • Mathematica
    Table[Select[Divisors[n], StringContainsQ[IntegerString[n, 2], IntegerString[#, 2]] &], {n, 50}] (* Paolo Xausa, Jul 23 2024 *)
  • PARI
    row(n, base=2) = { 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 = bin(n)[2:]
        return sorted(d for d in divisors(n, generator=True) if bin(d)[2:] in s)
    def table(r): return [i for n in range(1, r+1) for i in row(n)]
    print(table(25)) # Michael S. Branicky, Jul 11 2022

Formula

T(n, 1) = 1.
T(n, A093640(n)) = n.
Sum_{k = 1..A093640(n)} T(n, k) = A355633(n).
Showing 1-2 of 2 results.