Displaying 1-10 of 34 results found.
Corresponding values of arithmetic means of digits of numbers from A061383.
+20
1
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 2, 3, 4, 5, 6, 2, 3, 4, 5, 6, 3, 4, 5, 6, 7, 3, 4, 5, 6, 7, 4, 5, 6, 7, 8, 4, 5, 6, 7, 8, 5, 6, 7, 8, 9, 1, 2, 3, 1, 2, 3, 1, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 5, 3, 4, 5, 3, 4, 5, 3, 4, 5, 6, 4, 5, 6
PROG
(Magma) [&+Intseq(n) / #Intseq(n): n in [1..100000] | &+Intseq(n) mod #Intseq(n) eq 0]
(PARI) lista(nn) = {for (n=0, nn, if (n, d = digits(n), d = [0]); if (!( vecsum(d) % #d), print1(vecsum(d)/#d, ", ")); ); } \\ Michel Marcus, Apr 15 2017
CROSSREFS
Cf. A061383 (numbers with integer arithmetic mean of digits in base 10).
Arithmetic mean of digits of n (rounded up).
+10
29
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 1, 1, 1, 2, 2, 2, 3, 3
COMMENTS
a(100)=1 is the first value that differs from the variant "... rounded to the nearest integer". - M. F. Hasler, May 10 2015
MATHEMATICA
Ceiling[Mean[IntegerDigits[#]]]&/@Range[0, 110] (* Harvey P. Dale, Aug 29 2014 *)
PROG
(PARI) A004427(n)=ceil(sum(i=1, #n=digits(n), n[i])/#n) \\ ...Vecsmall(Str(n))...-48 is a little faster. \\ M. F. Hasler, May 10 2015
CROSSREFS
Cf. A178358, A178359, A178361, A178362, ..., A178369, A178401, A178402, A178403, A178404, A178405.
Sum of digits = 5 times number of digits.
+10
20
5, 19, 28, 37, 46, 55, 64, 73, 82, 91, 159, 168, 177, 186, 195, 249, 258, 267, 276, 285, 294, 339, 348, 357, 366, 375, 384, 393, 429, 438, 447, 456, 465, 474, 483, 492, 519, 528, 537, 546, 555, 564, 573, 582, 591, 609, 618, 627, 636, 645, 654, 663, 672, 681
EXAMPLE
186 is a term as the arithmetic mean of the digits is (1+8+6)/3 = 5.
MATHEMATICA
Select[Range[685], Total[x=IntegerDigits[#]]==5*Length[x] &]
PROG
(Magma) [ n: n in [1..700] | &+Intseq(n) eq 5*#Intseq(n) ]; // Bruno Berselli, Jun 30 2011
EXTENSIONS
More terms from Larry Reeves (larryr(AT)acm.org), May 16 2001
Sum of digits = 6 times number of digits.
+10
19
6, 39, 48, 57, 66, 75, 84, 93, 189, 198, 279, 288, 297, 369, 378, 387, 396, 459, 468, 477, 486, 495, 549, 558, 567, 576, 585, 594, 639, 648, 657, 666, 675, 684, 693, 729, 738, 747, 756, 765, 774, 783, 792, 819, 828, 837, 846, 855, 864, 873, 882, 891, 909
EXAMPLE
288 is a term as the arithmetic mean of the digits is (2+8+8)/3 = 6.
MAPLE
F:= proc(m, s)
option remember;
# list of all m-digit numbers with sum of digits s
if s > 9*m or s < 0 then return [] fi;
if m = 1 then return [s] fi;
[seq(seq(op(map(`+`, procname(j, s-i), 10^(m-1)*i)), j=1..m-1), i=1..min(9, s))]
end proc:
MATHEMATICA
Select[Range[1000], Total[IntegerDigits[#]]==6*IntegerLength[#]&] (* Harvey P. Dale, Dec 20 2014 *)
PROG
(PARI) isok(n) = {digs = digits(n, 10); return(6*#digs == sum(k=1, #digs, digs[k])); } \\ Michel Marcus, Jul 31 2013
(Magma) [n: n in [1..1000] | &+Intseq(n) eq 6*#Intseq(n)]; // Vincenzo Librandi, Jan 28 2016
EXTENSIONS
More terms from Larry Reeves (larryr(AT)acm.org), May 16 2001
Sum of digits = 8 times number of digits.
+10
19
8, 79, 88, 97, 699, 789, 798, 879, 888, 897, 969, 978, 987, 996, 5999, 6899, 6989, 6998, 7799, 7889, 7898, 7979, 7988, 7997, 8699, 8789, 8798, 8879, 8888, 8897, 8969, 8978, 8987, 8996, 9599, 9689, 9698, 9779, 9788, 9797, 9869, 9878, 9887, 9896, 9959
EXAMPLE
879 is a term as the arithmetic mean of the digits is (8+7+9)/3 = 8.
MAPLE
Q:= proc(n, t) option remember; local j, R;
if t > 9*n or t <= 0 then return [] fi;
R:= NULL;
for j from 0 to min(t, 9) do
R:= R, op(map(s -> 10*s+j, procname(n-1, t-j)))
od;
[R]
end proc;
for i from 0 to 9 do Q(1, i):= [i] od:
EXTENSIONS
More terms from Larry Reeves (larryr(AT)acm.org), May 16 2001
Numbers n such that sum of digits = number of digits.
+10
16
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
COMMENTS
Equivalently, numbers n > 0 for which the arithmetic mean of the digits equals 1. - M. F. Hasler, Dec 07 2018
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
(PARI) A061384_row(n)={my(L=List(), u=vector(n, i, i==1), d); forvec(v=vector(n+1, i, [if(i>n, n, 1), if(i>1, n, 1)]), vecmax(d=v[^1]-v[^-1]+u)<10 && listput(L, fromdigits(d)), 1); Vec(L)} \\ Return the list of all n-digit terms. - M. F. Hasler, Dec 07 2018
(Python)
from itertools import count, islice
def Q(n, s): # length-n strings of 0..9 with sum s, after Robert Israel
if s == 0: yield "0"*n
elif n == 1: yield (str(s) if s <= 9 else "")
else:
m = min(9, s) + 1
yield from (str(i)+t for i in range(m) for t in Q(n-1, s-i))
def agen():
yield from (int(t) for n in count(1) for t in Q(n, n) if t[0] != "0")
(Python)
from itertools import count, islice
from collections import Counter
from sympy.utilities.iterables import partitions, multiset_permutations
def A061384_gen(): # generator of terms
for l in count(1):
for i in range(1, min(l, 9)+1):
yield from sorted(int(str(i)+''.join(map(str, j))) for s, p in partitions(l-i, k=9, size=True) for j in multiset_permutations([0]*(l-1-s)+list(Counter(p).elements())))
Arithmetic mean of digits of n (rounded down).
+10
14
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 0, 0, 1, 1, 1, 2, 2, 2
PROG
(Haskell)
a004426 n = (a007953 n) `div` (a055642 n)
Numbers n such that all digits have same parity.
+10
9
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 13, 15, 17, 19, 20, 22, 24, 26, 28, 31, 33, 35, 37, 39, 40, 42, 44, 46, 48, 51, 53, 55, 57, 59, 60, 62, 64, 66, 68, 71, 73, 75, 77, 79, 80, 82, 84, 86, 88, 91, 93, 95, 97, 99, 111, 113, 115, 117, 119, 131, 133, 135, 137, 139
MATHEMATICA
Select[Range[0, 140], (cnt = Count[id = IntegerDigits[#], _?OddQ]; cnt == 0 || cnt == Length[id]) & ] (* Jean-François Alcover, May 16 2013 *)
PROG
(Haskell)
a059708 n = a059708_list !! (n-1)
a059708_list = filter sameParity [0..] where
sameParity n = all (`elem` "02468") ns
|| all (`elem` "13579") ns where ns = show n
Sum of digits = 7 times number of digits.
+10
9
7, 59, 68, 77, 86, 95, 399, 489, 498, 579, 588, 597, 669, 678, 687, 696, 759, 768, 777, 786, 795, 849, 858, 867, 876, 885, 894, 939, 948, 957, 966, 975, 984, 993, 1999, 2899, 2989, 2998, 3799, 3889, 3898, 3979, 3988, 3997, 4699, 4789, 4798, 4879, 4888, 4897
EXAMPLE
498 is a term as the arithmetic mean of the digits is (4+9+8)/3 = 7.
MAPLE
filter:= proc(n) local L;
L:= convert(n, base, 10);
convert(L, `+`)=nops(L)*7
end proc:
MATHEMATICA
Select[Range[5000], Total[IntegerDigits[#]]==7IntegerLength[#]&] (* Harvey P. Dale, Oct 22 2022 *)
EXTENSIONS
More terms from Larry Reeves (larryr(AT)acm.org), May 16 2001
Harmonic mean of digits is an integer.
+10
8
1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 22, 26, 33, 36, 44, 55, 62, 63, 66, 77, 88, 99, 111, 136, 144, 163, 222, 236, 244, 263, 288, 316, 326, 333, 346, 361, 362, 364, 414, 424, 436, 441, 442, 444, 463, 488, 555, 613, 623, 631, 632, 634, 643, 666, 777, 828, 848, 882, 884
EXAMPLE
1236 is a term as the harmonic mean is 4/(1+1/2+1/3+1/6) = 2.
MATHEMATICA
Do[ h = IntegerDigits[n]; If[ Sort[h] [[1]] != 0 && IntegerQ[ Length[h] / Apply[ Plus, 1/h] ], Print[n]], {n, 1, 10^4} ] Note that the number of entries <= 10^n are 9, 22, 61, 198, 927, 4738, 24620, 130093,
hmdiQ[n_]:=DigitCount[n, 10, 0]==0&&IntegerQ[HarmonicMean[ IntegerDigits[ n]]]; Select[Range[1000], hmdiQ] (* Harvey P. Dale, Sep 22 2012 *)
Search completed in 0.016 seconds
|