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.

A269306 a(n+1) is the smallest integer such that the difference between its digital sum and the digital sum of a(n) is n.

This page as a plain text file.
%I A269306 #17 Jun 22 2025 03:11:10
%S A269306 0,1,3,6,19,69,399,1999,9999,99999,1999999,39999999,699999999,
%T A269306 19999999999,699999999999,39999999999999,1999999999999999,
%U A269306 99999999999999999,9999999999999999999,1999999999999999999999
%N A269306 a(n+1) is the smallest integer such that the difference between its digital sum and the digital sum of a(n) is n.
%C A269306 The digital sums are the triangular numbers A000217. A similar idea is in A268605 (thanks to Michel Marcus for this comment).
%e A269306 a(8) = 1999 and 1 + 9 + 9 + 9 = 28; so a(9) = 9999 because 9 + 9 + 9 + 9 = 36 and 36 - 28 = 8.
%o A269306 (Python)
%o A269306 s = 0
%o A269306 for i in range(0, 100):
%o A269306   alfa = ""
%o A269306   k = i + s
%o A269306   s = k
%o A269306   while k > 9:
%o A269306     alfa = alfa + "9"
%o A269306     k = k - 9
%o A269306   alfa = str(k) + alfa
%o A269306   print(alfa)
%o A269306 (PARI) findnext(x, k) = {sx = sumdigits(x); y = 1; while (sumdigits(y) - sx != k, y++); y; }
%o A269306 lista(nn) = {print1(x = 0, ", "); for (k=1, nn, y = findnext(x, k); print1(y, ", "); x = y; ); }
%Y A269306 Cf. A000217, A268605.
%K A269306 nonn,base
%O A269306 1,3
%A A269306 _Francesco Di Matteo_, Feb 23 2016