OFFSET
1,2
COMMENTS
a(n+1) = k(n)*q(a(n)), where k(n) is the number of times (up to and including a(n)) that a term having the same q-value as a(n) has occurred in the sequence so far.
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
EXAMPLE
a(2) is q(a(1))=a(1)=2; a(10)=q(10)=3, and 3=q(a(2)) has been seen once before, so a(11)=3+3=6.
MATHEMATICA
s[n_] := Plus @@(d = IntegerDigits[n]) + Length[d]; a[1] = 1; a[n_] := a[n] = (s1 = s[a[n - 1]])*(1 + Sum[Boole[s[a[k]] == s1], {k, 1, n - 2}]); Array[a, 100] (* Amiram Eldar, Jan 01 2020 *)
PROG
(Magma) q:=func<n|&+Intseq(n)+#Intseq(n)>; a:=[1, 2]; for n in [3..70] do Append( ~a, &+[ q(a[k-1]):k in [2..n]| q(a[k-1]) eq q(a[n-1])]); end for; a; // Marius A. Burtea, Jan 02 2020
CROSSREFS
KEYWORD
nonn,base
AUTHOR
David James Sycamore, Jan 01 2020
STATUS
approved