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.

A068127 Triangular numbers with sum of digits = 3.

Original entry on oeis.org

3, 21, 120, 210, 300, 10011, 20100, 2001000, 200010000, 20000100000, 2000001000000, 200000010000000, 20000000100000000, 2000000001000000000, 200000000010000000000, 20000000000100000000000, 2000000000001000000000000, 200000000000010000000000000, 20000000000000100000000000000
Offset: 1

Views

Author

Amarnath Murthy, Feb 21 2002

Keywords

Comments

The sequence is unbounded, as the (2*10^k)-th triangular number is a term.

Crossrefs

Programs

  • Mathematica
    t = {}; Do[tri = n*(n+1)/2; If[Total[IntegerDigits[tri, 10]] == 3, AppendTo[t, tri]], {n, 1000000}]; t (* T. D. Noe, Jun 05 2012 *)
    Select[Accumulate[Range[2*10^6]],Total[IntegerDigits[#]]==3&] (* Harvey P. Dale, Jun 22 2021 *)
    Sort @ Select[Plus @@@ (10^Select[Tuples[Range[0, 29], 3], Min[Differences[#]] >= 0 &]), IntegerQ[Sqrt[8*# + 1]] &] (* Amiram Eldar, May 19 2022 *)
  • Python
    from math import isqrt
    from itertools import count, islice
    def istri(n): return (lambda x: x == isqrt(x)**2)(8*n+1)
    def agen(): yield from filter(istri, (10**i + 10**j + 10**k for i in count(0) for j in range(i+1) for k in range(j+1)))
    print(list(islice(agen(), 20))) # Michael S. Branicky, May 14 2022

Extensions

More terms from Sascha Kurz, Mar 06 2002
One additional term (a(12)) from Harvey P. Dale, May 14 2022
More terms and offset changed to 1 from Michael S. Branicky, May 14 2022