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.

A343951 Numbers with decimal expansion (d_1, ..., d_k) such that all the sums d_i + ... + d_j with 1 <= i <= j <= k are distinct.

This page as a plain text file.
%I A343951 #15 May 05 2021 18:13:15
%S A343951 0,1,2,3,4,5,6,7,8,9,12,13,14,15,16,17,18,19,21,23,24,25,26,27,28,29,
%T A343951 31,32,34,35,36,37,38,39,41,42,43,45,46,47,48,49,51,52,53,54,56,57,58,
%U A343951 59,61,62,63,64,65,67,68,69,71,72,73,74,75,76,78,79,81,82
%N A343951 Numbers with decimal expansion (d_1, ..., d_k) such that all the sums d_i + ... + d_j with 1 <= i <= j <= k are distinct.
%C A343951 This sequence is finite, the last term being a(5562) = 8657913.
%C A343951 All positive terms are zeroless (A052382) and have distinct decimal digits (A010784).
%C A343951 There are 10, 72, 440, 1622, 2502, 906, 10, and 0 terms with 1..8 digits, resp. - _Michael S. Branicky_, May 05 2021
%H A343951 Rémy Sigrist, <a href="/A343951/b343951.txt">Table of n, a(n) for n = 1..5562</a>
%e A343951 Regarding 12458:
%e A343951 - we have the following partial sums of digits:
%e A343951      i\j|  1  2  3  4  5
%e A343951      ---+---------------
%e A343951        1|  1  3  7 12 20
%e A343951        2|  .  2  6 11 19
%e A343951        3|  .  .  4  9 17
%e A343951        4|  .  .  .  5 13
%e A343951        5|  .  .  .  .  8
%e A343951 - as they are all distinct, 12458 is a term.
%o A343951 (PARI) is(n) = { my (d=digits(n), s=setbinop((i,j)->vecsum(d[i..j]), [1..#d])); #s==#d*(#d+1)/2 }
%o A343951 (Python)
%o A343951 def ok(n):
%o A343951   d, sums = str(n), set()
%o A343951   for i in range(len(d)):
%o A343951     for j in range(i, len(d)):
%o A343951       sij = sum(map(int, d[i:j+1]))
%o A343951       if sij in sums: return False
%o A343951       else: sums.add(sij)
%o A343951   return True
%o A343951 print(list(filter(ok, range(83)))) # _Michael S. Branicky_, May 05 2021
%Y A343951 Cf. A010784, A052382, A101274.
%K A343951 nonn,base,fini,full
%O A343951 1,3
%A A343951 _Rémy Sigrist_, May 05 2021