OFFSET

0,1

COMMENTS

a(15) = a(1) + a(5);

a(29) = a(2) + a(9) = 29 is the unique term such that a(n) = n.

a(10*n+u) = a(n) + a(u) where n >= 1 is a number and u a digit. - Jean-Marc Rebert, Aug 02 2015

LINKS

EXAMPLE

_XXX____X_

X___X__XX_

X__XX___X_

X_X_X___X_

XX__X___X_

X___X___X_

_XXX___XXX

MATHEMATICA

Table[DigitCount[n].{10, 14, 14, 14, 17, 15, 11, 17, 15, 19}, {n, 0, 68}] (* Michael De Vlieger, Feb 02 2017 *)

PROG

(PARI) a(n)={if(n==0, return(19)); my(p=[19, 10, 14, 14, 14, 17, 15, 11, 17, 15], d=digits(n), s=0); for(j=1, #d, s+=p[d[j]+1]); s; } \\ Joerg Arndt, Aug 02 2015

(Python)

def A039942(n):

....s=0

....for i in str(n):

........s+=[19, 10, 14, 14, 14, 17, 15, 11, 17, 15][int(i)]

....return s # Indranil Ghosh, Feb 02 2017

CROSSREFS

KEYWORD

easy,nonn,base

AUTHOR

EXTENSIONS

More terms from David Wasserman, Feb 04 2002

STATUS

approved