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.

A062688 Smallest triangular number with digit sum n (or 0 if no such number exists).

This page as a plain text file.
%I A062688 #22 Aug 21 2024 12:17:40
%S A062688 1,0,3,0,0,6,0,0,36,28,0,66,0,0,78,0,0,378,496,0,1596,0,0,8385,0,0,
%T A062688 5778,5995,0,8778,0,0,47895,0,0,67896,58996,0,196878,0,0,468996,0,0,
%U A062688 887778,1788886,0,4896885,0,0,5897895,0,0,13999986,15997996,0,38997696
%N A062688 Smallest triangular number with digit sum n (or 0 if no such number exists).
%C A062688 From _Jon E. Schoenfield_, Dec 04 2021: (Start)
%C A062688 a(n) = 0 iff n == (2,4,5,7,8) mod 9.
%C A062688 Nonzero terms are not nondecreasing; e.g., a(9)=36 > a(10)=28.
%C A062688 (End)
%H A062688 Jon E. Schoenfield, <a href="/A062688/b062688.txt">Table of n, a(n) for n = 1..168</a>
%e A062688 66 is the smallest triangular number with digit sum 12, so a(12)=66.
%t A062688 (With[{tbl={#,Total[IntegerDigits[#]]}&/@Accumulate[Range[9000]]},Table[SelectFirst[ tbl,#[[2]] ==n&],{n,60}]]/.Missing["NotFound"]->{0,0})[[;;,1]] (* _Harvey P. Dale_, Aug 21 2024 *)
%o A062688 (PARI) a(n) = if (vecsearch([2,4,5,7,8], n % 9), return (0)); my(k=1); while (sumdigits(k*(k+1)/2) != n, k++); k*(k+1)/2; \\ _Michel Marcus_, Dec 12 2021
%Y A062688 Cf. A000217, A007953, A055264, A068808.
%K A062688 base,nonn
%O A062688 1,3
%A A062688 _Erich Friedman_, Jul 04 2001