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.

Previous Showing 31-40 of 61 results. Next

A060712 Smallest number whose sum of digits is 3^n.

Original entry on oeis.org

1, 3, 9, 999, 999999999, 999999999999999999999999999, 999999999999999999999999999999999999999999999999999999999999999999999999999999999
Offset: 0

Views

Author

Robert G. Wilson v, Apr 21 2001

Keywords

Crossrefs

Cf. A051885.

Programs

  • Mathematica
    Do[ a = {}; While[ Apply[ Plus, a ] + 9 < 3^n, a = Append[ a, 9 ] ]; If[ Apply[ Plus, a ] != 3^n, a = Prepend[ a, 3^n - Apply[ Plus, a ] ] ]; Print[ FromDigits[ a ] ], {n, 1, 6} ]
    Join[{1,3},Table[FromDigits[PadRight[{},3^(n-2),9]],{n,2,6}]] (* Harvey P. Dale, Jun 10 2015 *)
  • PARI
    a(n)={ my(s=3^n, x=s\9, d=s-9*x); (d+1)*10^x - 1 } \\ Harry J. Smith, Jul 10 2009

Formula

a(n) = A051885(3^n). - Andrew Howroyd, Dec 08 2024
a(n) = 10^(3^(n-2)) - 1 for n > 1. - Stefano Spezia, Mar 27 2025

A077495 a(n) = smallest k such that the digit sum of 8k is n.

Original entry on oeis.org

0, 125, 25, 15, 5, 4, 3, 2, 1, 9, 8, 7, 6, 23, 22, 12, 11, 37, 36, 62, 61, 87, 86, 112, 111, 236, 361, 486, 611, 736, 861, 986, 1111, 1236, 2486, 3736, 4986, 6236, 7486, 8736, 9986, 11236, 12486, 24986, 37486, 49986, 62486, 74986, 87486, 99986, 112486, 124986
Offset: 0

Views

Author

Amarnath Murthy, Nov 07 2002

Keywords

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndex)
    import Data.Maybe (fromJust)
    a077495 n = fromJust $ elemIndex n $ map a007953 a008590_list
    a077495_list = map a077495 [0..]
    -- Reinhard Zumkeller, Dec 09 2011

Formula

From Robert Israel, Nov 19 2022: (Start) G.f.: -x^24*(985*x^9 - 125*x^8 - 125*x^7 - 125*x^6 - 125*x^5 - 125*x^4 - 125*x^3 - 125*x^2 - 125*x - 111)/((x - 1)*(10*x^9 - 1)) + 112*x^23 + 86*x^22 + 87*x^21 + 61*x^20 + 62*x^19 + 36*x^18 + 37*x^17 + 11*x^16 + 12*x^15 + 22*x^14 + 23*x^13 + 6*x^12 + 7*x^11 + 8*x^10 + 9*x^9 + x^8 + 2*x^7 + 3*x^6 + 4*x^5 + 5*x^4 + 15*x^3 + 25*x^2 + 125*x.
For n >= 24, a(n) = 125*A051885(n-24) + 111. (End)

Extensions

Corrected and extended by Ray Chandler, Aug 03 2003
Missing a(0)=0 added and offset adjusted by Reinhard Zumkeller, Dec 09 2011

A061219 a(n) is the largest number which can be formed with no zeros, using least number of digits and having digit sum = n.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 91, 92, 93, 94, 95, 96, 97, 98, 99, 991, 992, 993, 994, 995, 996, 997, 998, 999, 9991, 9992, 9993, 9994, 9995, 9996, 9997, 9998, 9999, 99991, 99992, 99993, 99994, 99995, 99996, 99997, 99998, 99999, 999991, 999992, 999993, 999994
Offset: 1

Views

Author

Amarnath Murthy, Apr 22 2001

Keywords

Comments

a(n) is the digit reversal of terms of A051885 giving such smallest numbers.

Examples

			a(22) = 994, digit sum = 22.
a(100) = 999999999991.
		

Crossrefs

Cf. A051885.

Programs

  • Mathematica
    dsn[n_]:=Module[{d=Quotient[n,9]},FromDigits[PadLeft[{n-9d},d,9]]]; If[Divisible[#,10],#/10,#]&/@Array[dsn,50,10] (* Harvey P. Dale, Dec 08 2013 *)
  • Python
    def a(n): return int("9"*(n//9)+str(n%9)*(n%9>0))
    print([a(n) for n in range(1, 50)]) # Michael S. Branicky, Aug 16 2023

Extensions

More terms from Harvey P. Dale, Dec 08 2013
Offset corrected by Michael S. Branicky, Aug 16 2023

A131668 Smallest number whose sum of digits is 2n+1.

Original entry on oeis.org

1, 3, 5, 7, 9, 29, 49, 69, 89, 199, 399, 599, 799, 999, 2999, 4999, 6999, 8999, 19999, 39999, 59999, 79999, 99999, 299999, 499999, 699999, 899999, 1999999, 3999999, 5999999, 7999999, 9999999, 29999999, 49999999, 69999999, 89999999, 199999999
Offset: 0

Views

Author

Paul Curtz, Oct 03 2007

Keywords

Comments

Numbers which can't be represented as the sum of two numbers with the same sum of digits in base 10 (according to Daniel Starodubtsev). More generally, this definition and the definition from the name of this sequence matches for any even base. - Mikhail Kurkov, May 19 2019 [verification needed]

Examples

			For n=0, the least number with sum of digits 2*0+1=1 is 1, so a(0)=1.
		

Crossrefs

Programs

  • PARI
    a(n) = {my(k=0); while (sumdigits(k) != 2*n+1, k++); k;} \\ Michel Marcus, May 19 2019
    
  • PARI
    a(n) = if(n<5, return(2*n+1)); n-=5;[30, 50, 70, 90, 200, 400, 600, 800, 1000][n%9+1] * 100^(n\9)-1 \\ David A. Corneth, May 19 2019

Formula

a(n) = h(n,10)*10^g(n,10)-1, with f(n,k) = floor((n+1)/(k-1)) - floor(n/(k-1)), g(n,k) = floor(2*(n+1)/(k-1)) - f(n,k), h(n,k) = 2*(n+1) - (k-1)*g(n,k). - Mikhail Kurkov, May 19 2019

A213653 Least semiprime whose digital sum is n, or 0 if no such integer exists.

Original entry on oeis.org

0, 10, 10001, 21, 4, 14, 6, 25, 26, 9, 46, 38, 39, 49, 77, 69, 169, 278, 0, 289, 299, 489, 589, 689, 699, 799, 899, 0, 2899, 3899, 4989, 5899, 5999, 6999, 7999, 9899, 0, 19999, 29999, 48999, 58999, 68999, 69999, 88999, 99899, 0, 299899, 398999, 589989
Offset: 0

Views

Author

Robert G. Wilson v, Jun 17 2012

Keywords

Comments

a(9k) = 0 for all k>1.
I conjecture that all terms > 278, except for 10001, end in the digit "9". What is the next term a(n) > 69 violating monotony, i.e., such that a(n) < a(n-1)? M. F. Hasler, Jun 17 2012
a(88) = 7999999999 < a(87) = 8899899999. - Alois P. Heinz, Jun 17 2012
a(76) = 499999999 < a(75) = 597999999. - Donovan Johnson, Jun 18 2012

Programs

  • Mathematica
    semiPrimeQ[n_] := PrimeOmega[n] == 2; t = Table[0, {100}]; k = 1; While[k < 10^7, If[ semiPrimeQ@ k, s = Plus @@ IntegerDigits@ k; If[s < 101 && t[[s]] == 0, t[[s]] = k; Print[{s, k}]]]; k++]
  • PARI
    A213653(n)={ n%9 || n==9 || return; forstep( a=A051885(n),9e9,9, bigomega(a)==2 || next; A007953(a)==n & return(a))} \\ - M. F. Hasler, Jun 17 2012

Extensions

a(0)-a(62) double-checked with given PARI code by M. F. Hasler, Jun 17 2012

A259046 Smallest m such that A259043(m) = n.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 19, 15, 25, 16, 26, 17, 27, 18, 59, 78, 69, 88, 79, 98, 89, 108, 99, 509, 618, 609, 718, 709, 818, 809, 918, 909, 5009, 6018, 6009, 7018, 7009, 8018, 8009, 9018, 9009, 50009, 60018, 60009, 70018, 70009, 80018, 80009, 90018
Offset: 0

Views

Author

Reinhard Zumkeller, Jun 17 2015

Keywords

Comments

A259043(a(n)) = n and A259043(m) != n for m < a(n).

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndex); import Data.Maybe (fromJust)
    a259046 = fromJust . (`elemIndex` (map a259043 [0..]))
    
  • PARI
    f(n) = if (n<10, n, my(u=n%10); f(n\10 + u) + u); \\ A259043
    a(n) = my(m=0); while (f(m)!=n, m++); m; \\ Michel Marcus, Jan 23 2022

A268605 a(1) = 0; a(n+1) is the smallest integer in which the difference between its digits sum and the a(n) digits sum is equal to the n-th prime.

Original entry on oeis.org

0, 2, 5, 19, 89, 1999, 59999, 4999999, 599999999, 199999999999, 399999999999999, 799999999999999999, 8999999999999999999999, 499999999999999999999999999, 29999999999999999999999999999999, 4999999999999999999999999999999999999
Offset: 1

Views

Author

Francesco Di Matteo, Feb 17 2016

Keywords

Comments

First 8 terms are primes (and are also in A061248). Next terms are not always primes.

Examples

			a(4) = 19 and 1 + 9 = 10; so a(5) = 89 because 8 + 9 = 17 and 17 - 10 = 7, that is the 4th prime.
		

Crossrefs

Programs

  • PARI
    findnext(x, k) = {sx = sumdigits(x); pk = prime(k); y = 1; while (sumdigits(y) - sx != pk, y++); y;}
    lista(nn) = {print1(x = 0, ", "); for (k=1, nn, y = findnext(x, k); print1(y, ", "); x = y;);} \\ Michel Marcus, Feb 19 2016
  • Python
    sumprime = 0
    isPrime=lambda x: all(x % i != 0 for i in range(int(x**0.5)+1)[2:])
    print(0)
    for i in range(2,100):
      if isPrime(i):
        alfa = ""
        k = i + sumprime
        sumprime = k
        while k > 9:
          alfa = alfa + "9"
          k = k - 9
        alfa = str(k)+alfa
        print(alfa)
    

Formula

a(n) = A051885( A007504(n-1) ). - R. J. Mathar, Jun 19 2021

Extensions

NAME adapted to offset by R. J. Mathar, Jun 19 2021

A307560 a(n) = smallest m such that A307629(m) = n.

Original entry on oeis.org

0, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 29, 39, 49, 59, 69, 79, 89, 99, 10000000000000000000, 109, 1006, 119, 100000000000000000000000, 129, 100004, 139, 1008, 149, 100000000000000000000000000000, 159, 10000000000000000000000000000000, 169, 1019, 179, 100006
Offset: 0

Views

Author

Arran Ireland, Apr 14 2019

Keywords

Examples

			a(39) = 1039 as (1 + 0) + (1 + 3) + (1 + 9) + (0 + 3) + (0 + 9) + (3 + 9) = 39. The sums in brackets are pairs of digits of 1039. No positive integer less than 1039 has this pairwise digit sum. - _David A. Corneth_, Apr 16 2019
		

Crossrefs

Programs

  • Magma
    for n in [1..50] do for d in Divisors(n) do if n le 9*d*(d+1) then nd:=d+1; sdLeft:=n div d; S:=[]; for j in [1..nd-1] do if sdLeft gt 9 then S[j]:=9; else S[j]:=sdLeft-1; end if; sdLeft-:=S[j]; end for; S[nd]:=sdLeft; a:=Seqint(S); n, a; break; end if; end for; end for; // Jon E. Schoenfield, Apr 15 2019
  • Mathematica
    fs[nd_, s_] := If[nd*9 < s, 0, Block[{n=10^(nd-1), f=0}, While[n < 10^nd, If[Total@ IntegerDigits@ n == s, f = n; Break[], n++]]; f]]; a[n_] := Block[{s}, Do[s = fs[d+1, n/d]; If[s > 0, Break[]], {d, Divisors[n]}]; s];  Join[{0}, Array[a,50]] (* Giovanni Resta, Apr 15 2019 *)

Formula

Let d be the smallest divisor of n for which 9*d*(d+1) >= n; then a(n) is the smallest (d+1)-digit number whose digit sum is n/d. - Jon E. Schoenfield, Apr 15 2019

A342810 Numbers k that divide the smallest number whose sum of digits is k.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 21, 27, 81, 191, 243, 729, 999, 2187, 2997, 6561, 8991, 19683, 26973, 33321, 36963, 39049, 59049, 80919, 100389, 110889, 118827, 177147, 177897, 183951, 242757, 332667, 356481, 531441, 551853, 728271, 998001, 1069443, 1367631, 1594323, 1655559, 2184813
Offset: 1

Views

Author

Ruediger Jehn, Mar 22 2021

Keywords

Comments

By definition, if k divides A051885(k), then k is a term of this sequence.
From Ruediger Jehn, Jun 17 2021: (Start)
None of the terms is divisible by 2*5*11*13.
If a term x has the form 3^m * y where m > 1 (which is the case for the overwhelming number of terms of this sequence), then all prime factors of y are terms of A066364.
If a term x has the form 3^m * p * q where m > 1, where p is a term of A066364 and where q is the product of all other factors of the prime factorization of x, then all numbers 3^m * p^i * q are also terms for any integer i. (End)

Examples

			21 is a term because the smallest number with a digital sum of 21 is 399 (A051885(21) = 399) which is divisible by 21.
		

Crossrefs

Programs

  • PARI
    MAX=10000; for (e = 0, MAX, for (d = 1, 9, k =(d+1)*10^e - 1; x = d+9*e; if (k%x==0, print1(x, ", ");)))
    
  • Python
    A342810_list = [n for n in range(1,10**6) if n==1 or ((n % 9)+1)*pow(10,n//9,n) % n == 1] # Chai Wah Wu, Apr 04 2021

Extensions

Name clarified by Jon E. Schoenfield, Apr 27 2021

A342829 a(n) is the smallest number whose sum of digits is equal to the sum of digits of n.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 19, 2, 3, 4, 5, 6, 7, 8, 9, 19, 29, 3, 4, 5, 6, 7, 8, 9, 19, 29, 39, 4, 5, 6, 7, 8, 9, 19, 29, 39, 49, 5, 6, 7, 8, 9, 19, 29, 39, 49, 59, 6, 7, 8, 9, 19, 29, 39, 49, 59, 69, 7, 8, 9, 19, 29, 39, 49, 59, 69, 79, 8
Offset: 1

Views

Author

Michel Marcus, Mar 23 2021

Keywords

Examples

			For n=10, A007953(10) = 1, and 1 is the smallest integer x satisfying A007953(x)=1, so a(10)=1.
		

Crossrefs

Cf. A007953 (sum of digits), A051885.

Programs

  • PARI
    a(n) = my(k=1, s=sumdigits(n)); while(sumdigits(k) != s, k++); k;

Formula

a(n) = A051885(A007953(n)).
Previous Showing 31-40 of 61 results. Next