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.

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

This page as a plain text file.
%I A218978 #14 Sep 15 2015 11:23:40
%S A218978 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,
%T A218978 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,
%U A218978 7,27,2,8,28,2,9,29,0,3,30,1,3,31,2,3,32,3
%N A218978 Table read by rows: n-th row lists all distinct substrings of decimal representation of n.
%C A218978 A120004(n) = length of n-th row;
%C A218978 A154771(n) = sum of n-th row.
%H A218978 Reinhard Zumkeller, <a href="/A218978/b218978.txt">Rows n=0..1000 of triangle, flattened</a>
%e A218978 Rows 100 .. 112:
%e A218978 .  100:  {0, 1, 10, 100},
%e A218978 .  101:  {0, 1, 10, 101},
%e A218978 .  102:  {0, 1, 2, 10, 102},
%e A218978 .  103:  {0, 1, 3, 10, 103},
%e A218978 .  104:  {0, 1, 4, 10, 104},
%e A218978 .  105:  {0, 1, 5, 10, 105},
%e A218978 .  106:  {0, 1, 6, 10, 106},
%e A218978 .  107:  {0, 1, 7, 10, 107},
%e A218978 .  108:  {0, 1, 8, 10, 108},
%e A218978 .  109:  {0, 1, 9, 10, 109},
%e A218978 .  110:  {0, 1, 10 ,11, 110},
%e A218978 .  111:  {1, 11, 111},
%e A218978 .  112:  {1, 2, 11, 12, 112}.
%o A218978 (Haskell)
%o A218978 import Data.List (inits, tails, sort, nub, genericIndex)
%o A218978 a218978 n k = a218978_row n !! k
%o A218978 a218978_row n = genericIndex a218978_tabf n
%o A218978 a218978_tabf = map (sort . nub . map (foldr (\d v -> 10 * v + d) 0) .
%o A218978                    concatMap (tail . inits) . tails) a031298_tabf
%o A218978 -- _Reinhard Zumkeller_, corrected: Sep 15 2015, May 02 2015, Nov 10 2012
%Y A218978 Cf. A031298, A219031 (squares in row), A262188 (palindromes in row).
%K A218978 nonn,base,tabf,look
%O A218978 0,3
%A A218978 _Reinhard Zumkeller_, May 02 2015, Nov 10 2012