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-5 of 5 results.

A011531 Numbers that contain a digit 1 in their decimal representation.

Original entry on oeis.org

1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 31, 41, 51, 61, 71, 81, 91, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133
Offset: 1

Views

Author

Keywords

Comments

A121042(a(n)) = 1. - Reinhard Zumkeller, Jul 21 2006
See A043493 for numbers that contain a single digit '1'. A subsequence of numbers having a digit that divides all other digits, A263314. - M. F. Hasler, Jan 11 2016

Crossrefs

Programs

  • GAP
    Filtered([1..140],n->1 in ListOfDigits(n)); # Muniru A Asiru, Feb 23 2019
    
  • Haskell
    a011531 n = a011531_list !! (n-1)
    a011531_list = filter ((elem '1') . show) [0..]
    -- Reinhard Zumkeller, Feb 05 2012
    
  • Magma
    [n: n in [0..500] | 1 in Intseq(n) ]; // Vincenzo Librandi, Jan 11 2016
    
  • Maple
    M:= 3: # to get all terms of up to M digits
    B:= {1}: A:= {1}:
    for i from 2 to M do
       B:= map(t -> seq(10*t+j,j=0..9),B) union
          {seq(10*x+1,x=2*10^(i-2)..10^(i-1)-1)}:
       A:= A union B;
    od:
    sort(convert(A,list)); # Robert Israel, Jan 10 2016
    # second program:
    A011531 := proc(n)
        if n = 1 then
            1;
        else
            for a from procname(n-1)+1 do
                if nops(convert(convert(a,base,10),set) intersect {1}) > 0 then
                    return a;
                end if;
            end do:
        end if;
    end proc: # R. J. Mathar, Jul 31 2016
  • Mathematica
    Select[Range[600] - 1, DigitCount[#, 10, 1] > 0 &] (* Vincenzo Librandi, Jan 11 2016 *)
  • PARI
    is_A011531(n)=setsearch(Set(digits(n)),1) \\ M. F. Hasler, Jan 10 2016
    
  • Python
    def aupto(nn): return [m for m in range(1, nn+1) if '1' in str(m)]
    print(aupto(133)) # Michael S. Branicky, Jan 10 2021
  • Scala
    (0 to 119).filter(.toString.indexOf('1') > -1) // _Alonso del Arte, Jan 12 2020
    

Formula

a(n) ~ n. - Charles R Greathouse IV, Nov 02 2022

A121041 Number of divisors of n that are also contained in the decimal representation of n.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Jul 21 2006

Keywords

Examples

			a(22) = #{2, 22} = 2;
a(23) = #{23} = 1;
a(24) = #{2, 4, 24} = 3.
		

Crossrefs

Programs

  • Haskell
    import Data.List (isInfixOf)
    a121041 n = length $ filter (\d -> n `mod` d == 0
                                       && show d `isInfixOf` show n) [1..n]
    -- Reinhard Zumkeller, Feb 11 2011
    
  • Mathematica
    A121041[n_] := DivisorSum[n, 1 &, StringContainsQ[IntegerString[n], IntegerString[#]] &]; Array[A121041, 150] (* Paolo Xausa, Feb 25 2024 *)
  • PARI
    substr(a,b)=a=digits(a); b=digits(b); for(i=0,#a-#b, for(j=1,#b, if(a[i+j]!=b[j], next(2))); return(1)); 0
    a(n)=sumdiv(n,d, substr(n,d)) \\ Charles R Greathouse IV, Mar 31 2016
    
  • Python
    from sympy import divisors
    def a(n):
        s = str(n)
        return sum(1 for d in divisors(n, generator=True) if str(d) in s)
    print([a(n) for n in range(1, 106)]) # Michael S. Branicky, Jul 11 2022

Formula

a(n) = 1 iff A121042(n) = n.
a(A155005(n)) = n and a(m) < n for m < A155005(n). - Reinhard Zumkeller, Jan 18 2009

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.

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).

A383749 Positive numbers k whose decimal expansion does not contain the decimal expansion of any proper divisor of k.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 23, 27, 29, 34, 37, 38, 43, 46, 47, 49, 53, 54, 56, 57, 58, 59, 67, 68, 69, 73, 74, 76, 78, 79, 83, 86, 87, 89, 94, 97, 98, 203, 207, 209, 223, 227, 229, 233, 239, 247, 249, 253, 257, 259, 263, 267, 269, 277, 283, 289, 293, 299, 307
Offset: 1

Views

Author

Rémy Sigrist, May 08 2025

Keywords

Comments

Also fixed points of A121042.
This sequence is infinite as it contains A173041.
a(n) > 5 contains no decimal digit 1 and does not end in 2 or 5. - Michael S. Branicky, May 11 2025

Examples

			The proper divisors of 54 are 1, 2, 3, 6, 9, 18 and 27; none of them appear in the decimal expansion of 54 so 54 belongs to this sequence.
		

Crossrefs

A038603 and A173041 are subsequences.

Programs

  • Mathematica
    A383749Q[k_] := SelectFirst[Divisors[k], StringContainsQ[IntegerString[k], IntegerString[#]] &] == k;
    Select[Range[500], A383749Q] (* Paolo Xausa, May 12 2025 *)
  • PARI
    is(n, base = 10) = {
        my (d = digits(n, base));
        for (i = 1, #d,
            if (d[i],
                for (j = i, #d,
                    if ((i!=1 || j!=#d) && n % fromdigits(d[i..j], base)==0,
                        return (0);););););
        return (1);}
    
  • Python
    from itertools import count, islice
    from sympy import divisors
    def A383749_gen(startvalue=1): # generator of terms >= startvalue
        return filter(lambda n:not any(dA383749_list = list(islice(A383749_gen(),40)) # Chai Wah Wu, May 10 2025
    
  • Python
    def ok(n):
        s = str(n)
        subs = (s[i:j] for i in range(len(s)) for j in range(i+1, len(s)+1) if s[i]!='0')
        return n and not any(n%v == 0 for ss in subs if n > (v:=int(ss)) > 0)
    print([k for k in range(308) if ok(k)]) # Michael S. Branicky, May 11 2025
Showing 1-5 of 5 results.