OFFSET
1,2
COMMENTS
This sequence is most certainly a permutation of the positive integers.
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..10000
Eric Angelini, SuperSums, SuperProducts, personal blog.
EXAMPLE
digitsum a(8) + digitsum a(9) = 8 + 9 = 17 and 17 divides exactly a(8) + a(9) = 8 + 9 = 17;
digitsum a(9) + digitsum a(10) = 9 + 2 + 7 = 18 and 18 divides exactly a(9) + a(10) = 9 + 27 = 36;
digitsum a(10) + digitsum a(11) = 2 + 7 + 2 + 1 = 12 and 12 divides exactly a(10) + a(11) = 27 + 21 = 48; etc.
MATHEMATICA
nn = 120; c[_] := False; Array[Set[{a[#], c[#]}, {#, True}] &, 2]; d = j = 2; u = 3; Do[k = u; While[Or[c[k], ! Divisible[j + k, d + Total@ IntegerDigits[k]]], k++]; Set[{a[n], c[k], j, d}, {k, True, k, Total@ IntegerDigits[k]}], {n, 3, nn}]; Array[a, nn] (* Michael De Vlieger, Jul 12 2023 *)
PROG
(PARI) {first(N, U=[], a)=vector(N, n, a=if(n>1, U=setunion(U, [a]); while(#U>1&&U[1]+1==U[2], U=U[^1]);
my(s=sumdigits(a), k=U[1]); while(setsearch(U, k++) || (k+a)%(sumdigits(k)+s), ); k, 1))}
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Eric Angelini and M. F. Hasler, Jul 12 2023
STATUS
approved