cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-10 of 16 results. Next

A061388 Sum of digits = 5 times number of digits.

Original entry on oeis.org

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
Offset: 1

Views

Author

Amarnath Murthy, May 03 2001

Keywords

Examples

			186 is a term as the arithmetic mean of the digits is (1+8+6)/3 = 5.
		

Crossrefs

Programs

  • Magma
    [ n: n in [1..700] | &+Intseq(n) eq 5*#Intseq(n) ];  // Bruno Berselli, Jun 30 2011
  • Mathematica
    Select[Range[685],Total[x=IntegerDigits[#]]==5*Length[x] &]

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), May 16 2001

A061423 Sum of digits = 6 times number of digits.

Original entry on oeis.org

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
Offset: 1

Views

Author

Amarnath Murthy, May 03 2001

Keywords

Examples

			288 is a term as the arithmetic mean of the digits is (2+8+8)/3 = 6.
		

Crossrefs

Programs

  • Magma
    [n: n in [1..1000] | &+Intseq(n) eq 6*#Intseq(n)]; // Vincenzo Librandi, Jan 28 2016
  • 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:
    seq(op(F(m,6*m)),m=1..3); # Robert Israel, Jan 27 2016
  • Mathematica
    Select[Range[1000],Total[IntegerDigits[#]]==6*IntegerLength[#]&] (* Harvey P. Dale, Dec 20 2014 *)
  • PARI
    isok(n) = {digs = digits(n, 10); return(6*#digs == sum(k=1, #digs, digs[k]));} \\ Michel Marcus, Jul 31 2013
    

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), May 16 2001

A069710 Primes with arithmetic mean of digits = 1 (sum of digits = number of digits).

Original entry on oeis.org

11, 1021, 1201, 2011, 3001, 10103, 10211, 10301, 11003, 12011, 12101, 13001, 20021, 20201, 21011, 21101, 30011, 1000033, 1000213, 1000231, 1000303, 1001023, 1001041, 1001311, 1001401, 1002121, 1003003, 1003111, 1003201, 1010131
Offset: 1

Views

Author

Amarnath Murthy, Apr 08 2002

Keywords

Comments

The sum of the digits of a prime > 3 cannot be a multiple of 3, hence no prime with 3*k digits can be here. - David Radcliffe, May 05 2015
Subsequence of primes of A061384. - Michel Marcus, May 05 2015

Crossrefs

Programs

  • Maple
    F:= proc(d,s) option remember;
      local t,r;
      if d = 1 then
        if s >= 1 and s <= 9 then {s}
        else {}
        fi
      else
        `union`(seq(map(t -> 10*t+r, procname(d-1,s-r)), r=0..min(s,9)))
      fi
    end proc:
    `union`(seq(select(isprime,F(i,i)), i = remove(d -> d mod 3 = 0, [$1..8]));
    # if using Maple 11 or earlier, uncomment the next line
    # sort(convert(%,list)); # Robert Israel, May 05 2015
  • Mathematica
    Do[p = Prime[n]; If[ Apply[ Plus, IntegerDigits[p]] == Floor[ Log[10, p] + 1], Print[p]], {n, 1, 10^5}]
  • Python
    from itertools import count, islice
    from collections import Counter
    from sympy.utilities.iterables import partitions, multiset_permutations
    from sympy import isprime
    def A069710_gen(): # generator of terms
        for l in count(1):
            for i in range(1,min(9,l)+1):
                yield from sorted(q for q in (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()))) if isprime(q))
    A069710_list = list(islice(A069710_gen(),30)) # Chai Wah Wu, Nov 28 2023

Extensions

Edited and extended by Robert G. Wilson v, Apr 12 2002

A164771 Numbers k such that the average digit of k^2 is 1.

Original entry on oeis.org

1, 1049, 1490, 10002, 10005, 10011, 10020, 10050, 10101, 10110, 10149, 10200, 10500, 11001, 11010, 11100, 11490, 12000, 14499, 15000, 17610, 18000, 20001, 20010, 20100, 21000, 24900, 30000, 33200, 35000, 36100, 44900, 44990, 45100
Offset: 1

Views

Author

Zak Seidov, Aug 26 2009

Keywords

Comments

There are 117 such n's < 10^7: 1, 1049, 1490, 10002, 10005, 10011, 10020, 10050, 10101, 10110, 10149, 10200, 10500, 11001, 11010, 11100, 11490, 12000, 14499, 15000, 17610, 18000, 20001, 20010, 20100, 21000, 24900, 30000, 33200, 35000, 36100, 44900, 44990, 45100, 46000, 54800, 55000, 64900, 71000, 80000, 1000006, 1000015, 1000051, 1000055, 1000060, 1000105, 1000150, 1000501, 1000510, 1000550, 1000600, 1001005, 1001050, 1001500, 1005001, 1005010, 1005100, 1005500, 1006000, 1006490, 1009951, 1010005, 1010050, 1010149, 1010500, 1011490, 1015000, 1024900, 1050001, 1050010, 1050100, 1051000, 1055000, 1060000, 1064900, 1095500, 1096000, 1100005, 1100050, 1100500, 1105000, 1114900, 1145000, 1150000, 1190000, 1224749, 1244990, 1249000, 1414249, 1415000, 1420000, 1424900, 1429000, 1451000, 1460000, 1484251, 1500001, 1500010, 1500100, 1501000, 1510000, 1550000, 1600000, 1735000, 1739000, 1789000, 1820000, 2000005, 2000050, 2000500, 2005000, 2050000, 2239000, 2261000, 2450000, 2500000, 2900000.
Or: Numbers k such that k^2 is in A061384, i.e., square root of squares in A061384. - M. F. Hasler, Dec 05 2010

Examples

			1049 is a term because 1049^2 = 1100401 and (1 + 1 + 0 + 0 + 4 + 0 + 1)/7 = 1.
		

Crossrefs

Subsequence of A164817.
Average of digits of n^2 = s: A164771 (s=1), A164770 (s=2), A164782 (s=3), A164776 (s=4), A164774 (s=5), A164778 (s=6), A164773 (s=7), A164772 (s=8).

Programs

  • Mathematica
    Select[Range[50000],Mean[IntegerDigits[#^2]]==1&] (* Harvey P. Dale, Dec 15 2014 *)
  • PARI
    {for(d=1,9, for(n=sqrtint(10^(d-1)-1)+1, sqrtint(10^d-1), my(n2=divrem(n^2,10)); sum( k=2,d, (n2=divrem(n2[1],10))[2],n2[2])/d==1 & print1(n",")))}  \\ M. F. Hasler, Dec 05 2010

Formula

A055642(a(n)^2) = A007953(a(n)^2). - M. F. Hasler, Dec 05 2010

Extensions

Terms up to a(117) checked with given PARI code by M. F. Hasler, Dec 05 2010

A061385 Numbers n such that sum of digits = twice number of digits.

Original entry on oeis.org

2, 13, 22, 31, 40, 105, 114, 123, 132, 141, 150, 204, 213, 222, 231, 240, 303, 312, 321, 330, 402, 411, 420, 501, 510, 600, 1007, 1016, 1025, 1034, 1043, 1052, 1061, 1070, 1106, 1115, 1124, 1133, 1142, 1151, 1160, 1205, 1214, 1223, 1232, 1241, 1250, 1304
Offset: 1

Views

Author

Amarnath Murthy, May 03 2001

Keywords

Examples

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

Crossrefs

Programs

  • Magma
    [ n: n in [1..1310] | &+Intseq(n) eq 2*#Intseq(n) ];  // Bruno Berselli, Jun 30 2011
  • Maple
    S:= proc(d,k,flag) option remember;
      if d = 1 then
        if k >= 0 and k <= 9 then return [k]
        else return []
        fi
      fi;
      [seq(op(map(`+`, procname(d-1,k-i,0), i*10^(d-1))),i=flag..min(k,9))]
    end proc:
    seq(op(S(d,2*d,1)),d=1..5); # Robert Israel, Apr 23 2017

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), May 16 2001

A061387 Sum of digits = 4 times number of digits.

Original entry on oeis.org

4, 17, 26, 35, 44, 53, 62, 71, 80, 129, 138, 147, 156, 165, 174, 183, 192, 219, 228, 237, 246, 255, 264, 273, 282, 291, 309, 318, 327, 336, 345, 354, 363, 372, 381, 390, 408, 417, 426, 435, 444, 453, 462, 471, 480, 507, 516, 525, 534, 543, 552, 561, 570, 606
Offset: 1

Views

Author

Amarnath Murthy, May 03 2001

Keywords

Examples

			147 is a term as the arithmetic mean of the digits is (1+4+7)/3 = 4.
		

Crossrefs

Programs

  • Magma
    [ n: n in [1..610] | &+Intseq(n) eq 4*#Intseq(n) ];  // Bruno Berselli, Jun 30 2011

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), May 16 2001

A071976 Number of lists of length n from {0..9} summing to n but not beginning with 0.

Original entry on oeis.org

1, 2, 6, 20, 70, 252, 924, 3432, 12870, 48619, 184735, 705222, 2702609, 10390940, 40062132, 154830696, 599641425, 2326640877, 9042327525, 35194002709, 137160956815, 535193552973, 2090558951396, 8174176541450, 31990402045260, 125301956523471, 491168514123342
Offset: 1

Views

Author

Amarnath Murthy, Jun 18 2002

Keywords

Comments

Number of n-digit numbers with digit sum n.
Middle diagonal of A213651. - Miquel Cerda, Aug 11 2017

Examples

			a(3) = 6 as there are six three-digit numbers with digit sum 3: 102, 111, 120, 201, 210, 300.
a(10) = binomial(18,9)-1; a(11) = binomial(20,10)-21; a(12) = binomial(22,11)-210.
		

Crossrefs

Different from A000984.
Number of n-digit entries in A061384.

Programs

  • Maple
    T:= add(x^i,i=0..9):
    seq(coeff(T^n - T^(n-1),x,n), n=1..25); # Robert Israel, Apr 06 2016
  • Mathematica
    Do[c = 0; k = 10^n; l = 10^(n + 1) - 1; While[k < l, If[ Plus @@ IntegerDigits[k] == n + 1, c++ ]; k++ ]; Print[c], {n, 0, 7}]
  • PARI
    a(n)=local(y=(x^10-1)/(x-1)); if(n<1,0,polcoeff((y-1)*y^(n-1),n))

Formula

Equals binomial(2n-2, n-1) for n <= 9, by the stars and bars argument. [To get such a number take n boxes in which the leftmost box contains a 1 and the rest are empty. Distribute the remaining n-1 1's into the n boxes subject to the constraint that no box contains more than 9 1's. This can be done in binomial(2n-2, n-1) ways for n <= 9.]
Coefficient of x^n in T^n - T^(n-1), where T = 1+x+...+x^9. - Robert Israel, Apr 06 2016

Extensions

Edited by N. J. A. Sloane and Robert G. Wilson v, Jun 20 2002
More terms from Vladeta Jovovic, Jun 21 2002
More terms from John W. Layman, Jun 22 2002

A071154 Totally balanced decimal numbers: if we assign the weight w(d) = d-1 to each digit d (i.e., w(0) = -1, w(1) = 0, ..., w(9) = 8) and then read the digits of the term from left to right, the partial sum of the weights is never negative and the total weighted sum is zero.

Original entry on oeis.org

1, 11, 20, 111, 120, 201, 210, 300, 1111, 1120, 1201, 1210, 1300, 2011, 2020, 2101, 2110, 2200, 3001, 3010, 3100, 4000, 11111, 11120, 11201, 11210, 11300, 12011, 12020, 12101, 12110, 12200, 13001, 13010, 13100, 14000, 20111, 20120, 20201
Offset: 1

Views

Author

Antti Karttunen, May 14 2002

Keywords

Comments

The initial portion of this sequence (up to the 6917th term) is equal to A071153 (Łukasiewicz words for rooted plane trees) sorted in ascending order.

Crossrefs

Subset of A061384. Superset of A071161.
Cf. A014486 (totally balanced binary numbers), A071153.

Programs

  • PARI
    isok(n) = {my(s = 0); my(d = digits(n)); for (k=1, #d, s += d[k]-1; if (s<0, return (0));); if (s, 0, 1);} \\ Michel Marcus, Oct 16 2015

A316481 Squares whose arithmetic mean of digits is 1 (i.e., the sum of digits equals the number of digits).

Original entry on oeis.org

1, 1100401, 2220100, 100040004, 100100025, 100220121, 100400400, 101002500, 102030201, 102212100, 103002201, 104040000, 110250000, 121022001, 121220100, 123210000, 132020100, 144000000, 210221001, 225000000, 310112100, 324000000, 400040001, 400400100
Offset: 1

Views

Author

Jon E. Schoenfield, Jul 04 2018

Keywords

Comments

Each term's number of digits is in A056991 (Numbers with digital root 1, 4, 7, or 9). For every term k in A056991, this sequence contains at least one k-digit term, with the exception of k=4. (See A316480.)

Examples

			1049^2 = 1100401, a 7-digit number whose digit sum is 1+1+0+0+4+0+1 = 7, so 1100401 is a term.
		

Crossrefs

Intersection of A000290 and A061384. - Michel Marcus, Jul 06 2018

A271239 Numbers n such that n is divisible by the median of its digits.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 15, 18, 20, 21, 22, 24, 27, 30, 33, 36, 40, 42, 44, 45, 48, 50, 51, 54, 55, 60, 63, 66, 70, 72, 77, 80, 81, 84, 88, 90, 99, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119
Offset: 1

Views

Author

Keywords

Comments

The first cases that are prime numbers :
a(2)=2;
a(3)=3;
a(5)=5;
a(7)=7;
a(11)=11;
a(44)=101;
a(46)=103;
a(50)=107.
The first difference from A180477 is that n = 100 is in that sequence but not here.

Examples

			72 is a member because the median of its digits (7, 2) is 9/2 and 72 is divisible by 9/2 (i.e., the ratio 72/(9/2) is an integer).
		

Crossrefs

Programs

  • Mathematica
    Select[Range[500], Quiet@ Divisible[#, Median@ IntegerDigits@ #] &] (* Giovanni Resta, Apr 08 2016 *)
Showing 1-10 of 16 results. Next