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

A120004 Number of distinct numbers as substrings of n in decimal representation.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Jun 15 2006

Keywords

Comments

a(n) = A079790(n) for n <= 100;
a(A120005(n)) = n and a(m) < n for m < A120005(n).
a(n) = length of n-th row in A218978; see also A154771. - Reinhard Zumkeller, Nov 10 2012

Examples

			n=101: {'1','0','10','01','101'} -> a(101) = #{0,1,10,101} = 4;
n=102: {'1','0','2','10','02','102'} -> a(102) = #{0,1,2,10,102} = 5.
		

Crossrefs

Cf. A119999.

Programs

  • Haskell
    import Data.List (isInfixOf)
    a120004 n = sum $ map (fromEnum . (`isInfixOf` show n) . show) [0..n]
    -- Reinhard Zumkeller, Jul 16 2012, Aug 14 2011
    
  • Mathematica
    a[n_] := Length@ DeleteDuplicates[FromDigits /@ Rest@ Subsequences[ IntegerDigits[n]]]; Array[a, 100, 0] (* Amiram Eldar, Oct 19 2021 *)
  • PARI
    a(n) = if (n==0, return (1)); my(d=digits(n), list=List()); for (k=1, #d, for (j=1, #d-k+1, my(dk=vector(j, i, d[k+i-1])); listput(list, fromdigits(dk)););); #Set(list); \\
    
  • Python
    def A120004(n):
        s = str(n)
        m = len(s)
        return len(set(int(s[i:j]) for i in range(m) for j in range(i+1,m+1))) # Chai Wah Wu, Oct 19 2021

Extensions

Offset changed and a(0)=1 inserted, in consequence of Zak Seidov's correction in A120005. - Reinhard Zumkeller, May 30 2010

A262188 Table read by rows: row n contains all distinct palindromes contained as substrings in decimal representation of n.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 1, 11, 1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 1, 7, 1, 8, 1, 9, 0, 2, 1, 2, 2, 22, 2, 3, 2, 4, 2, 5, 2, 6, 2, 7, 2, 8, 2, 9, 0, 3, 1, 3, 2, 3, 3, 33, 3, 4, 3, 5, 3, 6, 3, 7, 3, 8, 3, 9, 0, 4, 1, 4, 2, 4, 3, 4, 4, 44, 4, 5, 4, 6, 4
Offset: 0

Views

Author

Reinhard Zumkeller, Sep 14 2015

Keywords

Comments

Length of row n = A262190(n);
T(n,0) = A054054(n);
T(n,A262190(n)-1) = A047813(n).

Examples

			.     n |  T(n,*)           n |  T(n,*)              n |  T(n,*)
.  -----+-----------    ------+-------------    -------+--------------
.   100 |  0,1           1000 |  0,1             10000 |  0,1
.   101 |  0,1,101       1001 |  0,1,1001        10001 |  0,1,10001
.   102 |  0,1,2         1002 |  0,1,2           10002 |  0,1,2
.   103 |  0,1,3         1003 |  0,1,3           10003 |  0,1,3
.   104 |  0,1,4         1004 |  0,1,4           10004 |  0,1,4
.   105 |  0,1,5         1005 |  0,1,5           10005 |  0,1,5
.   106 |  0,1,6         1006 |  0,1,6           10006 |  0,1,6
.   107 |  0,1,7         1007 |  0,1,7           10007 |  0,1,7
.   108 |  0,1,8         1008 |  0,1,8           10008 |  0,1,8
.   109 |  0,1,9         1009 |  0,1,9           10009 |  0,1,9
.   110 |  0,1,11        1010 |  0,1,101         10010 |  0,1,1001
.   111 |  1,11,111      1011 |  0,1,11,101      10011 |  0,1,11,1001
.   112 |  1,2,11        1012 |  0,1,2,101       10012 |  0,1,2,1001
.   113 |  1,3,11        1013 |  0,1,3,101       10013 |  0,1,3,1001
.   114 |  1,4,11        1014 |  0,1,4,101       10014 |  0,1,4,1001
.   115 |  1,5,11        1015 |  0,1,5,101       10015 |  0,1,5,1001
.   116 |  1,6,11        1016 |  0,1,6,101       10016 |  0,1,6,1001
.   117 |  1,7,11        1017 |  0,1,7,101       10017 |  0,1,7,1001
.   118 |  1,8,11        1018 |  0,1,8,101       10018 |  0,1,8,1001
.   119 |  1,9,11        1019 |  0,1,9,101       10019 |  0,1,9,1001
.   120 |  0,1,2         1020 |  0,1,2           10020 |  0,1,2
.   121 |  1,2,121       1021 |  0,1,2           10021 |  0,1,2
.   122 |  1,2,22        1022 |  0,1,2,22        10022 |  0,1,2,22
.   123 |  1,2,3         1023 |  0,1,2,3         10023 |  0,1,2,3
.   124 |  1,2,4         1024 |  0,1,2,4         10024 |  0,1,2,4
.   125 |  1,2,5         1025 |  0,1,2,5         10025 |  0,1,2,5  .
		

Crossrefs

Cf. A262190 (row lengths), A054054 (left edge), A047813 (right edge), A136522, A002113.

Programs

  • Haskell
    import Data.List (inits, tails, nub, sort)
    a262188 n k = a262188_tabf !! n !! k
    a262188_row n = a262188_tabf !! n
    a262188_tabf = map (sort . nub . map (foldr (\d v -> 10 * v + d) 0) .
       filter (\xs -> length xs == 1 || last xs > 0 && reverse xs == xs) .
              concatMap (tail . inits) . tails) a031298_tabf
    
  • PARI
    A262188_row(n,b=10)=Set(concat(vector(logint(n+!n,b)+1,m,m=n\=b^(m>1);select(is_A002113,vector(logint(m+!m,b)+1,k,m%b^k))))) \\ M. F. Hasler, Jun 19 2018

A154771 Sum of all numbers that appear as substring of n, written in decimal system.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 15, 17, 19, 21, 23, 25, 27, 29, 22, 24, 24, 28, 30, 32, 34, 36, 38, 40, 33, 35, 37, 36, 41, 43, 45, 47, 49, 51, 44, 46, 48, 50, 48, 54, 56, 58, 60, 62, 55, 57, 59, 61, 63, 60, 67, 69, 71, 73, 66, 68, 70, 72, 74, 76, 72, 80, 82, 84, 77, 79, 81
Offset: 0

Views

Author

M. F. Hasler, Jan 16 2009

Keywords

Comments

a(n) is the sum of n-th row in A218978; see also A120004. - Reinhard Zumkeller, Nov 10 2012

Examples

			Since n=0,...,9 has a single digit, only n itself appears as substring in k, thus a(n)=n.
10 has { 0, 1, 10 } as substrings, thus a(10) = 0+1+10 = 11.
11 has { 1, 11 } as substrings, thus a(11) = 1+11 = 12.
12 has { 1, 2, 12 } as substrings, thus a(12) = 1+2+12 = 15.
		

Crossrefs

Programs

  • Haskell
    a154771 = sum . a218978_row :: Integer -> Integer
    -- Reinhard Zumkeller, Nov 10 2012
    
  • PARI
    A154771(n) = { local(d=#Str(n)); n=vecsort(concat(vector(d,i,vector(d,j,n%10^j)+(d--&!n\=10))),,8);n*vector(#n,i,1)~ }
    
  • Python
    def a(n):
        s = str(n); L = len(s)
        return sum(set(int(s[i:j]) for i in range(L) for j in range(i+1, L+1)))
    print([a(n) for n in range(73)]) # Michael S. Branicky, Nov 08 2022

Formula

a(n) = n+A154781(n).
a(10^n) = A002275(n+1).

A265183 Base-10 analog of Marko Riedel's A265008, but allowing A, B, C to be zero.

Original entry on oeis.org

1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 8, 3, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 1, 1, 0, 0, 0, 0, 5, 5, 0, 0, 0, 0, 1, 0, 0, 1, 5, 5, 1, 0, 0, 0, 0, 0, 0, 0, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 0, 0, 0, 0
Offset: 0

Views

Author

N. J. A. Sloane, Dec 04 2015

Keywords

Crossrefs

Programs

  • Haskell
    a265183 n = length [() | let cs = a218978_row n, a <- cs, b <- cs, c <- cs,
                             a * b == c || c == 0 && a * b == 0]
    -- Reinhard Zumkeller, Dec 05 2015

Extensions

Data corrected by Reinhard Zumkeller, Dec 05 2015

A219031 Table read by rows: n-th row lists all distinct subwords of decimal representation of n-th square.

Original entry on oeis.org

0, 1, 4, 9, 1, 6, 16, 2, 5, 25, 3, 6, 36, 4, 9, 49, 4, 6, 64, 1, 8, 81, 0, 1, 10, 100, 1, 2, 12, 21, 121, 1, 4, 14, 44, 144, 1, 6, 9, 16, 69, 169, 1, 6, 9, 19, 96, 196, 2, 5, 22, 25, 225, 2, 5, 6, 25, 56, 256, 2, 8, 9, 28, 89, 289, 2, 3, 4, 24, 32, 324, 1, 3
Offset: 0

Views

Author

Reinhard Zumkeller, Nov 10 2012

Keywords

Comments

A219032(n) gives number of squares in n-th row.

Examples

			First 50 rows of triangle:
.   0: [0]                      .  25: [2,5,6,25,62,625]
.   1: [1]                      .  26: [6,7,67,76,676]
.   2: [4]                      .  27: [2,7,9,29,72,729]
.   3: [9]                      .  28: [4,7,8,78,84,784]
.   4: [1,6,16]                 .  29: [1,4,8,41,84,841]
.   5: [2,5,25]                 .  30: [0,9,90,900]
.   6: [3,6,36]                 .  31: [1,6,9,61,96,961]
.   7: [4,9,49]                 .  32: [0,1,2,4,10,24,102,1024]
.   8: [4,6,64]                 .  33: [0,1,8,9,10,89,108,1089]
.   9: [1,8,81]                 .  34: [1,5,6,11,15,56,115,156,1156]
.  10: [0,1,10,100]             .  35: [1,2,5,12,22,25,122,225,1225]
.  11: [1,2,12,21,121]          .  36: [1,2,6,9,12,29,96,129,296,1296]
.  12: [1,4,14,44,144]          .  37: [1,3,6,9,13,36,69,136,369,1369]
.  13: [1,6,9,16,69,169]        .  38: [1,4,14,44,144,444,1444]
.  14: [1,6,9,19,96,196]        .  39: [1,2,5,15,21,52,152,521,1521]
.  15: [2,5,22,25,225]          .  40: [0,1,6,16,60,160,600,1600]
.  16: [2,5,6,25,56,256]        .  41: [1,6,8,16,68,81,168,681,1681]
.  17: [2,8,9,28,89,289]        .  42: [1,4,6,7,17,64,76,176,764,1764]
.  18: [2,3,4,24,32,324]        .  43: [1,4,8,9,18,49,84,184,849,1849]
.  19: [1,3,6,36,61,361]        .  44: [1,3,6,9,19,36,93,193,936,1936]
.  20: [0,4,40,400]             .  45: [0,2,5,20,25,202,2025]
.  21: [1,4,41,44,441]          .  46: [1,2,6,11,16,21,116,211,2116]
.  22: [4,8,48,84,484]          .  47: [0,2,9,20,22,209,220,2209]
.  23: [2,5,9,29,52,529]        .  48: [0,2,3,4,23,30,230,304,2304]
.  24: [5,6,7,57,76,576]        .  49: [0,1,2,4,24,40,240,401,2401] .
		

Crossrefs

Programs

  • Haskell
    a219031 n k = a219031_tabf !! n !! k
    a219031_row n = a219031_tabf !! n
    a219031_tabf = map a218978_row a000290_list

A265182 Base-10 analog of Marko Riedel's A265008.

Original entry on oeis.org

1, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 5, 5, 5, 5, 5, 5, 5, 5, 0, 5, 0, 0, 1, 1, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 1, 0, 0, 1, 0, 5, 1, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0
Offset: 1

Views

Author

N. J. A. Sloane, Dec 04 2015

Keywords

Crossrefs

See A265183 for the version where A, B, C may be zero.
Cf. A218978.

Programs

  • Haskell
    a265182 n = length [() | let cs = dropWhile (== 0) $ a218978_row n, c <- cs,
                let as = takeWhile (<= c) cs, a <- as, b <- as, a * b == c]
    -- Reinhard Zumkeller, Dec 05 2015
  • Maple
    F:= proc(n) local L, ss;
      L:= convert(n, base, 10);
      ss:= {seq(seq(add(10^(i-j)*L[i], i=j..k), j=1..k), k=1..nops(L))} minus {0};
      numboccur(true, [seq(seq(member(a*b, ss), a=ss), b=ss)]);
    end proc:
    seq(F(n), n=1..1000); # Robert Israel, Dec 06 2015

Extensions

Corrected by Lars Blomberg, Dec 05 2015

A383592 Positive integers k divisible by all positive integers whose decimal expansion appears as a substring of k.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 15, 20, 22, 24, 30, 33, 36, 40, 44, 48, 50, 55, 60, 66, 70, 77, 80, 88, 90, 99, 100, 110, 120, 150, 200, 210, 220, 240, 250, 300, 330, 360, 400, 420, 440, 480, 500, 510, 520, 550, 600, 630, 660, 700, 770, 800, 840, 880
Offset: 1

Views

Author

Rémy Sigrist, May 01 2025

Keywords

Comments

This sequence is infinite as ten times a term is also a term.
All terms are of the form A037124(k) or A037124(k) + d where k > 0 and d divides A037124(k) while having strictly less decimal digits as A037124(k).
Empirically, all terms have either one or two nonzero decimal digits.

Examples

			The number 240 is divisible by 2, 24, 240, 4 and 40, so 240 belongs to this sequence.
		

Crossrefs

Cf. A037124, A078546, A175381 (binary variant), A178157, A218978.

Programs

  • Mathematica
    Select[Range[880],AllTrue[#/Select[FromDigits/@Subsequences[IntegerDigits[#]],#>0&],IntegerQ]&] (* James C. McMahon, May 13 2025 *)
  • PARI
    is(n, base = 10) = {
        my (d = digits(n, base));
        for (i = 1, #d,
            if (d[i],
                for (j = i, #d,
                    if (n % fromdigits(d[i..j], base),
                        return (0);););););
        return (1); }
    
  • PARI
    \\ See Links section.
    
  • 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 all(n%v == 0 for ss in subs if (v:=int(ss)) > 0)
    print([k for k in range(1000) if ok(k)]) # Michael S. Branicky, May 09 2025
Showing 1-7 of 7 results.