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.

A348400 a(1) = 1; a(n+1) = a(n) + n if the digit sum of a(n) is already in the sequence, otherwise a(n+1) = digitsum(a(n)).

This page as a plain text file.
%I A348400 #75 Oct 26 2021 16:56:34
%S A348400 1,2,4,7,11,16,22,29,37,10,20,31,43,56,70,85,13,30,3,22,42,6,28,51,75,
%T A348400 12,38,65,93,122,5,36,9,42,76,111,147,184,222,261,301,342,384,15,59,
%U A348400 14,60,107,8,57,107,158,210,263,317,372,428,485,17,76,136,197,259
%N A348400 a(1) = 1; a(n+1) = a(n) + n if the digit sum of a(n) is already in the sequence, otherwise a(n+1) = digitsum(a(n)).
%C A348400 Do all the positive integers appear in this sequence?
%C A348400 With 10^6 terms, 87, 89, 90, 91, 92, 94, 95, 96, 97, 98, 101, 102, 103, 104, 105, 106, 108, 109, 110, 112 are the smallest numbers that still are not in the sequence.
%H A348400 Rémy Sigrist, <a href="/A348400/b348400.txt">Table of n, a(n) for n = 1..10000</a>
%H A348400 Rémy Sigrist, <a href="/A348400/a348400.gp.txt">PARI program for A348400</a>
%e A348400 a(8) = 29 and digitsum(29) = 11 is already in the sequence, so a(9) = a(8) + 8 = 29 + 8 = 37.
%e A348400 a(9) = 37 and digitsum(37) = 3 + 7 = 10 is not yet in the sequence, so a(10) = 10.
%e A348400 Written as an irregular triangle, in which each line begins with a term which is the digit sum of its preceding term, the sequence begins:
%e A348400    1,  2,   4,   7,  11,  16,  22,  29,  37;
%e A348400   10, 20,  31,  43,  56,  70,  85;
%e A348400   13, 30;
%e A348400    3, 22,  42;
%e A348400    6, 28,  51,  75;
%e A348400   12, 38,  65,  93, 122;
%e A348400    5, 36;
%e A348400    9, 42,  76, 111, 147, 184, 222, 261, 301, 342, 384;
%e A348400   15, 59;
%e A348400   14, 60, 107;
%e A348400   ...
%t A348400 seq[len_] := Module[{s = {1}, k, d, i = 1}, While[Length[s] < len, k = s[[-1]]; If[MemberQ[s, (d = Plus @@ IntegerDigits[k])], AppendTo[s, k + i], AppendTo[s, d]]; i++]; s]; seq[50] (* _Amiram Eldar_, Oct 21 2021 *)
%o A348400 (PARI) See Links section.
%Y A348400 Cf. A007953, A348483, A348433.
%K A348400 nonn,base
%O A348400 1,2
%A A348400 _Rodolfo Kurchan_, Oct 21 2021
%E A348400 Definition clarified by _Amiram Eldar_, Oct 23 2021