OFFSET
1,2
COMMENTS
Numbers of the form 2 + 3*k will not appear in this sequence.
Do all other positive integers appear in this sequence?
EXAMPLE
a(4) = 15 because it is the double + 1 of a(3) = 7.
a(5) = 6 and not 31 because the sum of the digits of 15, 1 + 5 = 6 and 6 is not yet in the sequence.
a(6) = 13 because it is the double + 1 of a(5) = 6.
Written as an irregular triangle the sequence begins:
1, 3, 7, 15;
6, 13;
4, 9, 19;
10, 21, 43, 87, 175, 351, 703, 1407;
12, 25, 51, 103, 207, 415, 831, 1663;
16, 33, 67, 135, 271, 543, 1087, 2175, 4351, 8703;
18, 37, 75, 151, 303, 607, 1215, 2431, 4863, 9727, 19455;
24, 49, 99, 199, 399, 799, 1599, 3199;
...
MATHEMATICA
seq[len_] := Module[{s = {1}, k, d}, While[Length[s] < len, k = s[[-1]]; If[MemberQ[s, (d = Plus @@ IntegerDigits[k])], AppendTo[s, 2*k + 1], AppendTo[s, d]]]; s]; seq[50] (* Amiram Eldar, Oct 21 2021 *)
PROG
(PARI) lista(nn) = my(s, v=List([1])); for(n=1, nn, if(setsearch(vecsort(v), s=sumdigits(v[n])), listput(v, 2*v[n]+1), listput(v, s))); Vec(v); \\ Jinyuan Wang, Oct 21 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rodolfo Kurchan, Oct 20 2021
STATUS
approved