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.

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

This page as a plain text file.
%I A154771 #17 Nov 09 2022 19:25:05
%S A154771 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,
%T A154771 34,36,38,40,33,35,37,36,41,43,45,47,49,51,44,46,48,50,48,54,56,58,60,
%U A154771 62,55,57,59,61,63,60,67,69,71,73,66,68,70,72,74,76,72,80,82,84,77,79,81
%N A154771 Sum of all numbers that appear as substring of n, written in decimal system.
%C A154771 a(n) is the sum of n-th row in A218978; see also A120004. - _Reinhard Zumkeller_, Nov 10 2012
%H A154771 Reinhard Zumkeller, <a href="/A154771/b154771.txt">Table of n, a(n) for n = 0..10000</a>
%F A154771 a(n) = n+A154781(n).
%F A154771 a(10^n) = A002275(n+1).
%e A154771 Since n=0,...,9 has a single digit, only n itself appears as substring in k, thus a(n)=n.
%e A154771 10 has { 0, 1, 10 } as substrings, thus a(10) = 0+1+10 = 11.
%e A154771 11 has { 1, 11 } as substrings, thus a(11) = 1+11 = 12.
%e A154771 12 has { 1, 2, 12 } as substrings, thus a(12) = 1+2+12 = 15.
%o A154771 (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)~ }
%o A154771 (Haskell)
%o A154771 a154771 = sum . a218978_row :: Integer -> Integer
%o A154771 -- _Reinhard Zumkeller_, Nov 10 2012
%o A154771 (Python)
%o A154771 def a(n):
%o A154771     s = str(n); L = len(s)
%o A154771     return sum(set(int(s[i:j]) for i in range(L) for j in range(i+1, L+1)))
%o A154771 print([a(n) for n in range(73)]) # _Michael S. Branicky_, Nov 08 2022
%Y A154771 Cf. A154770, A154781.
%K A154771 base,easy,nonn,look
%O A154771 0,3
%A A154771 _M. F. Hasler_, Jan 16 2009