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.

A119999 Number of partitions of n into parts that occur in decimal representation as substrings of n.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 8, 6, 5, 5, 4, 4, 4, 4, 2, 12, 2, 5, 8, 4, 6, 3, 5, 3, 2, 12, 7, 2, 4, 4, 8, 3, 3, 6, 2, 12, 12, 5, 2, 4, 5, 3, 8, 3, 2, 12, 7, 5, 4, 2, 3, 3, 3, 3, 2, 12, 12, 12, 7, 4, 2, 3, 4, 5, 2, 12, 7, 5, 4, 4, 3, 2, 3, 3, 2, 12, 12, 5, 12, 4, 5, 3, 2, 3, 2, 12, 7, 12, 4, 4, 7, 3
Offset: 0

Views

Author

Reinhard Zumkeller, Jun 13 2006

Keywords

Comments

A120002 = first differences; A120003 = partial sums;
see A120000 and A120001 for records and where they occur: A120000(n)=a(A120001(n)).

Examples

			a(98) = #{98, 10*9+8, 2*9+10*8} = 3;
a(99) = #{99, 11*9} = 2;
a(100) = #{100, 10*10, 9*10+10*1, 8*10+20*1, 7*10+30*1, 6*10+40*1, 5*10+50*1, 4*10+60*1, 3*10+70*1, 2*10+80*1, 10+90*1, 100*1} = 12;
a(101) = #{101, 10*10+1, 9*10+11*1, 8*10+21*1, 7*10+31*1, 6*10+41*1, 5*10+51*1, 4*10+61*1, 3*10+71*1, 2*10+81*1, 10+91*1, 101*1} = 12;
a(102) = #{102, 10*10+2, 10*10+2*1, 9*10+6*2, ...} = 298.
		

Crossrefs

Programs

  • Haskell
    import Data.List (isInfixOf)
    a119999 n = p (filter ((`isInfixOf` show n) . show) [1..n]) n where
       p _  0 = 1
       p [] _ = 0
       p ks'@(k:ks) m | m < k     = 0
                      | otherwise = p ks' (m - k) + p ks m
    -- Reinhard Zumkeller, Aug 14 2011

A218978 Table read by rows: n-th row lists all distinct substrings of decimal representation of n.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 10, 1, 11, 1, 2, 12, 1, 3, 13, 1, 4, 14, 1, 5, 15, 1, 6, 16, 1, 7, 17, 1, 8, 18, 1, 9, 19, 0, 2, 20, 1, 2, 21, 2, 22, 2, 3, 23, 2, 4, 24, 2, 5, 25, 2, 6, 26, 2, 7, 27, 2, 8, 28, 2, 9, 29, 0, 3, 30, 1, 3, 31, 2, 3, 32, 3
Offset: 0

Views

Author

Reinhard Zumkeller, May 02 2015, Nov 10 2012

Keywords

Comments

A120004(n) = length of n-th row;
A154771(n) = sum of n-th row.

Examples

			Rows 100 .. 112:
.  100:  {0, 1, 10, 100},
.  101:  {0, 1, 10, 101},
.  102:  {0, 1, 2, 10, 102},
.  103:  {0, 1, 3, 10, 103},
.  104:  {0, 1, 4, 10, 104},
.  105:  {0, 1, 5, 10, 105},
.  106:  {0, 1, 6, 10, 106},
.  107:  {0, 1, 7, 10, 107},
.  108:  {0, 1, 8, 10, 108},
.  109:  {0, 1, 9, 10, 109},
.  110:  {0, 1, 10 ,11, 110},
.  111:  {1, 11, 111},
.  112:  {1, 2, 11, 12, 112}.
		

Crossrefs

Cf. A031298, A219031 (squares in row), A262188 (palindromes in row).

Programs

  • Haskell
    import Data.List (inits, tails, sort, nub, genericIndex)
    a218978 n k = a218978_row n !! k
    a218978_row n = genericIndex a218978_tabf n
    a218978_tabf = map (sort . nub . map (foldr (\d v -> 10 * v + d) 0) .
                       concatMap (tail . inits) . tails) a031298_tabf
    -- Reinhard Zumkeller, corrected: Sep 15 2015, May 02 2015, Nov 10 2012

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

A219032 Number of distinct squares as subwords of decimal representation of n-th square.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Nov 10 2012

Keywords

Comments

a(n) is the number of squares in n-th row of triangle A219031.

Examples

			.   n   row n in A219031
.  -----------------------------
.  20   [0, 4, 40, 400]            a(20) = #{0, 4, 400} = 3;
.  21   [1, 4, 41, 44, 441]        a(21) = #{1, 4, 441} = 3;
.  22   [4, 8, 48, 84, 484]        a(22) = #{4, 484} = 2;
.  23   [2, 5, 9, 29, 52, 529]     a(23) = #{9, 529} = 2;
.  24   [5, 6, 7, 57, 76, 576]     a(24) = #{576} = 1;
.  25   [2, 5, 6, 25, 62, 625]     a(25) = #{25, 625} = 2.
		

Crossrefs

Programs

  • Haskell
    a219032 = sum . map a010052 . a219031_row
    
  • Python
    from sympy import integer_nthroot
    def A219032(n):
        s = str(n*n)
        m = len(s)
        return len(set(filter(lambda x: integer_nthroot(x,2)[1], (int(s[i:j]) for i in range(m) for j in range(i+1,m+1))))) # Chai Wah Wu, Oct 19 2021

Formula

a(n) = Sum_{k=0..A120004(n^2)} A010052(A219031(n,k)).

A079790 a(n) = number of m <= n which can be obtained by deleting digits from n.

Original entry on oeis.org

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, 5, 6, 6, 6, 6
Offset: 1

Views

Author

Amarnath Murthy, Feb 04 2003

Keywords

Comments

a(n) = A120004(n) for n <= 100. a(101) = #{0, 1, 10, 11, 101} = 5; a(102) = #{0, 1, 2, 10, 12, 102} = 6. - Reinhard Zumkeller, Jun 15 2006

Examples

			a(124)=7 and the numbers are 1,2,4,12,14,24,124.
		

Programs

  • Maple
    f:= proc(n) local L,V;
      L:= convert(n,base,10);
      V:= convert(map(t -> L[t], combinat:-powerset([$1..nops(L)])),set) minus {[]};
      V:= map(proc(t) local i; add(t[i]*10^(i-1),i=1..nops(t)) end proc,V);
      nops(select(t -> t <= n, V))
    end proc:
    map(f, [$1..100]); # Robert Israel, Dec 03 2024

Extensions

More terms from Antonio G. Astudillo (afg_astudillo(AT)lycos.com), Apr 19 2003
Corrected and extended by Reinhard Zumkeller, Jun 15 2006

A120005 Smallest number containing exactly n distinct numbers in its decimal representation.

Original entry on oeis.org

0, 11, 10, 100, 102, 120, 1012, 1023, 1120, 1230, 10123, 10234, 11203, 11230, 12340, 101234, 102345, 111230, 112130, 112340, 123450, 1012345, 1023456, 1112130, 1112340, 1121340, 1123450, 1234560
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 15 2006

Keywords

Comments

A000030(a(n)) = 1 for n > 1;
A120004(a(n)) = n and A120004(m) < n for m < a(n).

Examples

			Illustration of initial values:
.   n |   a(n) ... and n-1 proper substrings
. ----+----------------------------------------------------
.   1 |     0
.   2 |    11    1
.   3 |    10    1    0
.   4 |   100   10    1   0
.   5 |   102   10    2   1   0
.   6 |   120   20   12   2   1   0
.   7 |  1012  101   12  10   2   1  0
.   8 |  1023  102   23  10   3   2  1  0
.   9 |  1120  120  112  20  12  11  2  1  0
.  10 |  1230  230  123  30  23  12  3  2  1  0
.  11 | 10123 1012  123 101  23  12 10  3  2  1 0
.  12 | 10234 1023  234 102  34  23 10  4  3  2 1 0
.  13 | 11203 1203 1120 203 120 112 20 12 11  3 2 1 0
.  14 | 11230 1230 1123 230 123 112 30 23 12 11 3 2 1 0
.  15 | 12340 2340 1234 340 234 123 40 34 23 12 4 3 2 1 0 .
		

Programs

  • Haskell
    import Data.List (isInfixOf, elemIndex)
    import Data.Maybe (fromJust)
    a120005 = fromJust . (`elemIndex` a120004_list)
    -- Reinhard Zumkeller, Jul 16 2012

Extensions

a(1) changed from 1 to 0 by Zak Seidov, May 30 2010

A348467 The number of distinct decimal representations of integers embedded as slices in the decimal representation of n!.

Original entry on oeis.org

1, 1, 1, 1, 3, 6, 6, 7, 11, 20, 25, 33, 32, 41, 60, 72, 80, 106, 104, 132, 140, 150, 173, 239, 241, 269, 306, 344, 369, 440, 487, 542, 550, 639, 639, 754, 799, 840, 777, 932, 1094, 1032, 1129, 1203, 1376, 1440, 1386, 1681, 1700, 1737, 1700, 1948, 1964, 2099, 2219
Offset: 0

Views

Author

Peter Luschny, Oct 19 2021

Keywords

Examples

			0:  1 // 1;
1:  1 // 1;
2:  1 // 2;
3:  1 // 6;
4:  3 // 2,4,24;
5:  6 // 0,1,2,12,20,120;
6:  6 // 0,2,7,20,72,720;
7:  7 // 0,4,5,40,50,504,5040;
8: 11 // 0,2,3,4,20,32,40,320,403,4032,40320;
9: 20 // 0,2,3,6,8,28,36,62,80,88,288,362,628,880,2880,3628,6288,36288,62880, 362880.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Length@ DeleteDuplicates[FromDigits /@ Rest@ Subsequences[ IntegerDigits[n!]]]; Array[a, 50, 0] (* Amiram Eldar, Oct 19 2021 *)
  • PARI
    f(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); \\ A120004
    a(n) = f(n!); \\ Michel Marcus, Oct 19 2021
    
  • Python
    from math import factorial
    def A348467(n):
        s = str(factorial(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

Formula

a(n) = A120004(n!). - Michel Marcus, Oct 19 2021
Showing 1-7 of 7 results.