A365097
Smallest k > 1 such that the total number of digits "1" required to write the numbers 1..k in base n is equal to k.
Original entry on oeis.org
2, 4, 25, 181, 421, 3930, 8177, 102772, 199981, 3179142, 5971945, 143610511, 210826981, 4754446846, 8589934561, 222195898593, 396718580701, 13494919482970, 20479999999961, 764527028941797, 1168636602822613, 41826814261329722, 73040694872113105, 2855533828630999398
Offset: 2
For n=2, the first k=2 positive integers are 1 = 1_2 and 2 = 10_2, which have a total of two 1's, so a(2) = 2.
For n=3, the first k=4 positive integers, which are 1_3, 2_3, 10_3, and 11_3, have a total of four 1's, which is equal to k, so a(3) = 4.
For n=4, a total of 25 1's occur in the first k=25 positive integers (they occur in 1_4, 10_4, 11_4, 12_4, 13_4, 21_4, 31_4, 100_4, 101_4, 102_4, 103_4, 110_4, 111_4, 112_4, 113_4, 120_4, and 121_4 = 25), so a(4) = 25.
-
a[n_] := Module[{k = 1, sum = 1}, While[sum == 1 || sum != k, k++; sum += Count[IntegerDigits[k, n], 1]]; k]; Array[a, 6, 2] (* Amiram Eldar, Aug 29 2023 *)
-
from itertools import count
from sympy.ntheory.factor_ import digits
def A365097(n):
c, a, q, m = 1, 1, 0, 1
for k in count(2):
m += 1
if m == n:
m = 0
q += 1
a = digits(q,n).count(1)
elif m==1:
a += 1
elif m==2:
a -= 1
c += a
if c == k:
return k # Chai Wah Wu, Sep 28 2023
A014885
n is equal to the number of 1's in all numbers <= n written in base 8.
Original entry on oeis.org
1, 8177, 8178, 8179, 8180, 8181, 8182, 8183, 8184, 8192, 8193, 49137, 49138, 49139, 49140, 49141, 49142, 49143, 49144, 90112, 90113, 322096, 1048576, 1048577, 1056753, 1056754, 1056755, 1056756, 1056757, 1056758, 1056759, 1056760, 1056768, 1056769, 1097713, 1097714, 1097715, 1097716, 1097717, 1097718, 1097719, 1097720, 1138688, 1138689, 2396744
Offset: 1
-
T:= 0: R:= NULL:
for n from 1 to (8^8-1)/(8-1) do
T:= T + numboccur(1,convert(n,base,8));
if T = n then R:= R, n; count:= count+1;
fi od:
R; # Robert Israel, Dec 01 2020
-
Module[{nn=106*10^4,n1s},n1s=Accumulate[Table[DigitCount[n,8,1],{n,nn}]];Position[Thread[{n1s,Range[nn]}],?(#[[1]]==#[[2]]&),1,Heads-> False]]// Flatten (* _Harvey P. Dale, Feb 28 2020 *)
A014887
n is equal to the number of 1's in all numbers <= n written in base 7.
Original entry on oeis.org
1, 3930, 6044, 61879, 137256
Offset: 1
A014888
n is equal to the number of 4s in all numbers <= n written in base 7.
Original entry on oeis.org
761729, 761730, 823543, 1585272, 1585273, 1647086, 2408815, 2408816, 2470629, 3232358, 3232359
Offset: 1
A014889
n is equal to the number of 5s in all numbers <= n written in base 7.
Original entry on oeis.org
761664, 817499, 817500, 817507, 817508, 819609, 823543, 1585207, 1641042, 1641043, 1641050, 1641051, 1643152, 1647086, 2408750, 2464585, 2464586, 2464593, 2464594, 2466695, 2470629, 3232293, 3288128, 3288129, 3288136, 3288137, 3290238, 3294172, 4055836, 4111671, 4111672, 4111679, 4111680, 4113781
Offset: 1
-
LinearRecurrence[{1,0,0,0,0,0,1,-1},{761664,817499,817500,817507,817508,819609,823543,1585207},34] (* Harvey P. Dale, Apr 14 2020 *)
A014890
n is equal to the number of 1's in all numbers <= n written in base 6.
Original entry on oeis.org
1, 421, 422, 423, 424, 425, 426, 432, 433, 1726, 3888, 3889, 4309, 4310, 4311, 4312, 4313, 4314, 4320, 4321, 9330
Offset: 1
A014891
n is equal to the number of 2's in all numbers <= n written in base 6.
Original entry on oeis.org
3878, 3879, 3880, 3881, 3882, 3883, 3888, 46656, 50534, 50535, 50536, 50537, 50538, 50539, 50544
Offset: 1
-
Module[{nn=51000,d2},d2=Accumulate[DigitCount[#,6,2]&/@Range[nn]];Select[ Thread[ {Range[ nn],d2}],#[[1]]==#[[2]]&]][[;;,1]] (* Harvey P. Dale, Sep 04 2024 *)
A014892
n is equal to the number of 4s in all numbers <= n written in base 6.
Original entry on oeis.org
42768, 44921, 44922, 44923, 44924, 44925, 46656, 89424, 91577, 91578, 91579, 91580, 91581, 93312, 136080, 138233, 138234, 138235, 138236, 138237, 139968, 182736, 184889, 184890, 184891, 184892, 184893
Offset: 1
A014895
n is equal to the number of 3s in all numbers <= n written in base 5.
Original entry on oeis.org
2787, 2788, 2793, 2794, 2940, 3125, 5912, 5913, 5918, 5919, 6065, 6250, 9037, 9038, 9043, 9044, 9190
Offset: 1
A200863
List of numbers n without 1's in their decimal expansion such that n is equal to the total number of 1's in the decimal expansion of all positive numbers < n.
Original entry on oeis.org
200000, 2600000, 35000000, 35200000, 500000000, 502600000, 535000000, 535200000
Offset: 1
N. J. A. Sloane, Nov 23 2011, based on a posting to the Sequence Fans Mailing List by Vladimir Shevelev, Nov 22, 2011
Comments