login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A061384 Numbers n with property that sum of digits = number of digits. 7
1, 11, 20, 102, 111, 120, 201, 210, 300, 1003, 1012, 1021, 1030, 1102, 1111, 1120, 1201, 1210, 1300, 2002, 2011, 2020, 2101, 2110, 2200, 3001, 3010, 3100, 4000, 10004, 10013, 10022, 10031, 10040, 10103, 10112, 10121, 10130, 10202, 10211 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

Number of d-digit entries is A071976(d). - Robert Israel, Apr 06 2016

LINKS

Robert Israel, Table of n, a(n) for n = 1..10000

EXAMPLE

120 is a term as the arithmetic mean of the digits is (1+2+0)/3 = 1.

MAPLE

Q:= proc(n, s) option remember;

# n-digit integers with digit sum s

if s = 0 then []

elif s = 1 then [10^(n-1)]

elif n = 1 then

   if s <= 9 then [s]

   else []

   fi

else

  map(op, [seq(map(t -> 10*t+i, procname(n-1, s-i)), i=0..min(9, s-1))])

fi

end proc:

map(op, [seq(sort(Q(n, n)), n=1..5)]); # Robert Israel, Apr 06 2016

MATHEMATICA

Select[Range[15000], Total[IntegerDigits[#]] == IntegerLength[#]&] (* Harvey P. Dale, Jan 08 2011 *)

PROG

(MAGMA) [ n: n in [1..10215] | &+Intseq(n) eq #Intseq(n) ];  // Bruno Berselli, Jun 30 2011

(PARI) isok(n) = (sumdigits(n)/#Str(n) == 1); \\ Michel Marcus, Mar 28 2016

CROSSREFS

Totally balanced subset: A071154. Cf. also A061383-A061388, A061423-A061425.

Cf. A071976.

Sequence in context: A180113 A198310 A085187 * A071154 A071161 A125886

Adjacent sequences:  A061381 A061382 A061383 * A061385 A061386 A061387

KEYWORD

nonn,base,easy

AUTHOR

Amarnath Murthy, May 03 2001

EXTENSIONS

More terms from Erich Friedman, May 08 2001

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy .

Last modified March 27 13:47 EDT 2017. Contains 284176 sequences.