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.

A054054 Smallest digit of n.

Original entry on oeis.org

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

Views

Author

Henry Bottomley, Apr 29 2000

Keywords

Comments

a(n) = 0 for almost all n. - Charles R Greathouse IV, Oct 02 2013
More precisely, a(n) = 0 asymptotically almost surely, i.e., except for a set of density 0: As the number of digits of n grows, the probability of having no zero digit goes to zero as 0.9^(length of n), although there are infinitely many counterexamples. - M. F. Hasler, Oct 11 2015

Examples

			a(12) = 1 because 1 < 2.
		

Crossrefs

Programs

  • Haskell
    a054054 = f 9 where
       f m x | x <= 9 = min m x
             | otherwise = f (min m d) x' where (x',d) = divMod x 10
    -- Reinhard Zumkeller, Jun 20 2012, Apr 25 2012
    
  • Maple
    seq(min(convert(n,base,10)),n=0..100); # Robert Israel, Jul 07 2016
  • Mathematica
    A054054[n_]:=Min[IntegerDigits[n]]
  • PARI
    A054054(n)=if(n,vecmin(digits(n)))  \\ or: Set(digits(n))[1]. - M. F. Hasler, Jan 23 2013

Formula

a(A011540(n)) = 0; a(A052382(n)) > 0. - Reinhard Zumkeller, Apr 25 2012
a(n) = A262188(n,0). - Reinhard Zumkeller, Sep 14 2015
a(n) = 0 iff A007954(n) = 0. - M. F. Hasler, Oct 11 2015
a(n) = 9 - A054055(A061601(n)). - Robert Israel, Jul 07 2016

Extensions

Edited by M. F. Hasler, Oct 11 2015

A047813 Largest palindromic substring of n.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

a(n) = A262188(n,A262190(n)-1). - Reinhard Zumkeller, Sep 14 2015

Examples

			a(1313) = Max{1,3,131,313} = 313.
		

Crossrefs

Programs

  • Haskell
    a047813 = last . a262188_row
    -- Reinhard Zumkeller, Sep 14 2015, Aug 23 2011
    
  • Mathematica
    palQ[n_Integer, base_Integer] := Module[{idn = IntegerDigits[n, base]}, idn == Reverse[ idn]]; f[n_] := Block[{id = IntegerDigits@ n, mx = -Infinity}, k = Length@ id; While[k > 0 && mx == -Infinity, mx = Max[mx, Select[ FromDigits@# & /@ Partition[id, k, 1], palQ[#, 10] &]]; k--]; mx] (* Robert G. Wilson v, Aug 24 2011 *)
    lps[n_]:=Module[{idn=IntegerDigits[n]},Max[FromDigits/@Select[ Flatten[ Table[ Partition[ idn,i,1],{i,Length[idn]}],1],#==Reverse[#]&]]]; Array[ lps,100,0] (* Harvey P. Dale, Jan 09 2015 *)
  • Python
    def c(s): return (s[0] != "0" or s == "0") and s == s[::-1]
    def a(n):
        s = str(n)
        ss = (s[i:j] for i in range(len(s)) for j in range(i+1, len(s)+1))
        return max(int(w) for w in ss if c(w))
    print([a(n) for n in range(96)]) # Michael S. Branicky, Sep 18 2022

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

A262190 Number of distinct palindromes contained as substrings in the decimal representation of n.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Sep 14 2015

Keywords

Crossrefs

Length of row n in table A262188.

Programs

Formula

a(n) = A055642(n) for n < 100 = A262198(1);
a(n) != A055642(n) iff n is in A262198.

Extensions

Edited by M. F. Hasler, Jun 19 2018

A262198 Numbers such that the number of distinct palindromes contained as substring in their decimal representation differs from the length thereof.

Original entry on oeis.org

100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1020, 1021, 1030, 1031, 1040, 1041, 1050, 1051, 1060, 1061, 1070, 1071, 1080, 1081, 1090, 1091, 1100, 1200, 1201, 1231, 1241, 1251, 1261, 1271
Offset: 1

Views

Author

Reinhard Zumkeller, Sep 14 2015

Keywords

Comments

Or, numbers n such that A055642(n) != A262190(n).
a(22) = 1021 is the first term which differs from "numbers having at least two digits 0 in their decimal representation" (not in OEIS). It seems that A043490 is a subsequence. - M. F. Hasler, Jun 19 2018

Examples

			a(39) = 1201, containing just 3 trivial palindromes 0, 1 and 2;
1202, also of length = 4, contains exactly 4 palindromes 0, 1, 2 and 202, therefore 1202 is not a term.
		

Crossrefs

Programs

  • Haskell
    a262198 n = a262198_list !! (n-1)
    a262198_list = [x | x <- [0..], a055642 x /= a262190 x]
    
  • PARI
    is(n)=#digits(n)!=A262190(n) \\ M. F. Hasler, Jun 19 2018

Extensions

Definition clarified by M. F. Hasler, Jun 19 2018
Showing 1-5 of 5 results.