OFFSET
1,2
COMMENTS
Numbers m such that m = digitsum(k*(m+k)) for some k>=0.
The first differences are 2-periodic: 5, 4, 5, 4, etc. The minimum numbers k associated to the first elements of the sequence are (m,k): (0,0), (5,2), (9,3), (14,5), (18,15), (23,44), (27,42), (32,119), etc.
LINKS
FORMULA
a(n) = a(n-2) + 9 for n >= 3.
a(n) = 9/2*(n+1) - 4 + Sum{j=0..n} (-1)^j/2.
O.g.f.: x^2(5+4x)/((1+x)(1-x)^2). a(n) = 9(n-1)/2+(1+(-1)^n)/4. - R. J. Mathar, Jun 13 2008
a(n) = 5n - 5 - floor((n-1)/2). - Wesley Ivan Hurt, Oct 25 2013
MAPLE
op(select(n->n mod 9=0 or n mod 9=5, [$0..257])); # Paolo P. Lava, Jul 12 2018
MATHEMATICA
Table[5n-5-Floor[(n-1)/2], {n, 100}] (* Wesley Ivan Hurt, Oct 25 2013 *)
Select[Range[0, 300], MemberQ[{0, 5}, Mod[#, 9]]&] (* or *) LinearRecurrence[ {1, 1, -1}, {0, 5, 9}, 60] (* Harvey P. Dale, Aug 04 2019 *)
PROG
(PARI) forstep(n=0, 200, [5, 4], print1(n", ")) \\ Charles R Greathouse IV, Oct 17 2011
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Paolo P. Lava and Giorgio Balzarotti, Jul 25 2007
STATUS
approved