OFFSET
1,2
COMMENTS
The first difference is eventually 2-periodic: 4, 1, 4, 5, 4, 5, 4, etc. The minimum numbers k associated to the first elements of the sequence are (n,k): (0,0), (4,2), (5,7), (9,3), (14,19), (18,33), (23,67), (27,69), etc.
FORMULA
Conjecture: a(n) = (18*n-(-1)^n-35)/4 for n>2. a(n) = a(n-1)+a(n-2)-a(n-3) for n>5. G.f.: x^2*(4+x+4*x^3)/((1-x)^2*(1+x)). [Colin Barker, Apr 10 2012]
EXAMPLE
n = 36 -> k = 279 -> 279*abs(36-279)=279*243=67797 -> 6+7+7+9+7 = 36
MAPLE
P:=proc(n) local i, j, k, w; for i from 0 by 1 to n do for j from 0 by 1 to 100*n do w:=0; k:=j*abs(i-j); while k>0 do w:=w+k-(trunc(k/10)*10); k:=trunc(k/10); od; if w=i then print(i); break; fi; od; od; end: P(100000);
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Paolo P. Lava and Giorgio Balzarotti, Jul 26 2007
STATUS
approved