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-3 of 3 results.

A032799 Numbers k such that k equals the sum of its digits raised to the consecutive powers (1,2,3,...).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 89, 135, 175, 518, 598, 1306, 1676, 2427, 2646798, 12157692622039623539
Offset: 1

Views

Author

Patrick De Geest, May 15 1998

Keywords

Comments

Lemma: The sequence is finite with all terms in the sequence having at most 22 digits. Proof: Let n be an m-digit natural number in the sequence for some m. Then 10^(m-1)<=n and n<=9+9^2+...9^m = 9(9^m-1)/8<(9^(m+1))/8. Thus 10^(m-1)<(9^(m+1))/8. Taking logarithms of both sides and solving yields m<22.97 QED. Note proof is identical to that for A208130. [Francis J. McDonnell, Apr 14 2012]
Sometimes referred to as disarium numbers. - Dumitru Damian, Jul 22 2024

Examples

			89 = 8^1 + 9^2.
175 = 1^1 + 7^2 + 5^3.
2427 = 2^1 + 4^2 + 2^3 + 7^4.
2646798 = 2^1 + 6^2 + 4^3 + 6^4 + 7^5 + 9^6 + 8^7.
		

References

  • J.-M. De Koninck, Ces nombres qui nous fascinent, Entry 175, p. 55, Ellipses, Paris 2008.
  • Ken Follett, Code to Zero, Dutton, a Penguin Group, NY 2000, p. 84.
  • Alfred S. Posamentier, Math Charmers, Tantalizing Tidbits for the Mind, Prometheus Books, NY, 2003, page 37.
  • D. Wells, The Penguin Dictionary of Curious and Interesting Numbers, Penguin Books, London, 1986, Entry 175.

Crossrefs

Programs

  • Maple
    N:= 10: # to get solutions of up to N digits
    Branch:= proc(level,sofar)
      option remember;
      local Res, x, x0, lb, ub, y;
      Res:= NULL;
      if perm[level] = 1 then x0:= 1 else x0:= 0 fi;
      for x from x0 to 9 do
        lb:= sofar + b[x,perm[level]] + scmin[level];
        ub:= sofar + b[x,perm[level]] + scmax[level];
        if lb <= 0 and ub >= 0 then
           if level = n then Res:= Res, [x]
           else
             for y in Branch(level+1,sofar+b[x,perm[level]]) do
                Res:= Res, [x, op(y)]
             od
            fi
         fi
       od;
       [Res]
    end:
    count:= 0:
    for n from 1 to N do
      printf("Looking for %d digit solutions\n",n);
      forget(Branch);
      for j from 1 to n do
        for x from 0 to 9 do
          b[x,j]:= x^j - x*10^(n-j)
        od
      od:
      for j from 1 to n do
        smin[j]:= min(seq(b[x,j],x=0..9));
        smax[j]:= max(seq(b[x,j],x=0..9));
      od:
      perm:= sort([seq(smax[j]-smin[j],j=1..n)],`>`,output=permutation):
      for j from 1 to n do
        scmin[j]:= add(smin[perm[i]],i=j+1..n);
        scmax[j]:= add(smax[perm[i]],i=j+1..n);
      end;
      for X in Branch(1,0) do
        xx:= add(X[i]*10^(n-perm[i]),i=1..n);
        count:= count+1;
        A[count]:= xx;
        print(xx);
      od
    od:
    seq(A[i],i=1..count); # Robert Israel, Aug 07 2014
  • Mathematica
    f[n_] := Plus @@ (IntegerDigits[n]^Range[ Floor[ Log[10, n] + 1]]); Select[ Range[10^7], f[ # ] == # &] (* Robert G. Wilson v, May 04 2005 *)
    Join[{0},Select[Range[10^7],Total[IntegerDigits[#]^Range[ IntegerLength[ #]]] == #&]] (* Harvey P. Dale, Oct 13 2015 *)
    sdcpQ[n_]:=n==Inner[Power,IntegerDigits[n],Range[IntegerLength[n]],Plus]; Join[{0},Select[Range[27*10^5],sdcpQ]] (* Harvey P. Dale, May 30 2020 *)
  • PARI
    for(n=1,10^22,d=digits(n);s=sum(i=1,#d,d[i]^i);if(s==n,print1(n,", "))) \\ Derek Orr, Aug 07 2014

Extensions

Corrected by Macsy Zhang (macsy(AT)21cn.com), Feb 17 2002

A362843 Numbers that are equal to the sum of their digits raised to consecutive odd numbered powers (1,3,5,7,...).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 463, 3943, 371915027434113
Offset: 1

Views

Author

Wolfe Padawer, May 05 2023

Keywords

Comments

Unlike A032799 and A208130, this sequence is not easily proven to be finite. With m >= 1, 10^(m - 1) exceeds 9^1 + 9^2 + ... + 9^m when m is approximately 22.97, meaning it is impossible for an integer with 23 or more digits to be equal to the sum of its digits raised to the consecutive powers. However, 10^(m - 1) will never exceed 9^1 + 9^3 + ... + 9^(2m - 1) over m >= 1. It appears that 10^(m - 1) will never exceed 9^1 + 9^(1 + x) + 9^(1 + 2x) ... 9^(mx - x + 1) over m >= 1 when x >= A154160, approximately 1.04795. For A032799, x = 1, and for this sequence, x = 2. This means this sequence could theoretically be infinite, although it is currently unknown whether it is.
a(14) > 10^24 if it exists. The expected number of k-digit terms can be heuristically estimated as about 10^(-0.15*k), which suggests that the sequence is likely finite. - Max Alekseyev, May 17 2025

Examples

			1 = 1^1;
463 = 4^1 + 6^3 + 3^5;
3943 = 3^1 + 9^3 + 4^5 + 3^7.
		

Crossrefs

Programs

  • Mathematica
    kmax=10^6; a={}; For[k=0, k<=kmax, k++,If[Sum[Part[IntegerDigits[k],i]^(2i-1),{i,IntegerLength[k]}]==k, AppendTo[a,k]]]; a (* Stefano Spezia, May 06 2023 *)
  • PARI
    isok(k) = my(d=digits(k)); sum(i=1, #d, d[i]^(2*i-1)) == k; \\ Michel Marcus, May 06 2023
    
  • Python
    from itertools import count, islice
    def A362843_gen(startvalue=0): # generator of terms >= startvalue
        return filter(lambda n:n==sum(int(d)**((i<<1)+1) for i,d in enumerate(str(n))),count(max(startvalue,0)))
    A362843_list = list(islice(A362843_gen(),12)) # Chai Wah Wu, Jun 26 2023

Extensions

a(13) from Martin Ehrenstein, Jul 07 2023

A377012 Numbers k whose digits can be split into substrings so that the sum of these substrings raised to consecutive powers (1, 2, 3, ...) is the number k itself.

Original entry on oeis.org

89, 135, 175, 518, 598, 1306, 1370, 1371, 1676, 2045, 2427, 3055, 5755, 5918, 9899, 11053, 24429, 88297, 135010, 234322, 255050, 255051, 360030, 360031, 494703, 512780, 517380, 568217, 767368, 779243, 785920, 785921, 788834, 819116, 931316, 986562, 998999, 1000100
Offset: 1

Views

Author

Francesco Di Matteo, Oct 28 2024

Keywords

Comments

At least two substrings are required and each substring must have at least one digit.
A subsequence is A032799 (except for 1-digit numbers).
Unlike A032799, which is finite, this sequence is infinite because; e.g., the pattern 89, 9899, 998999, ... can always be split into two equal-length substrings that generate a term as (10^i - 2)^1 + (10^i - 1)^2 = 10^i*(10^i - 2) + (10^i - 1) for all i > 0.
Leading zeros in strings are allowed here. The first such term generated by the author's program is 1010053 = 1^1 + (01005)^2 + 3^3. - Michael S. Branicky, Nov 30 2024
Another pattern is deduced from a(38) = 1000100 = 100^1 + 0^2 + 100^3 with formula (10^i)^1 + 0^2 + ... + 0^n + ([0...0]10^i)^(n+1) = (10^i)^(n+1) + 10^i with i > 1 and n > 1. - Francesco Di Matteo, Jan 15 2025

Examples

			175 = 1^1 + 7^2 + 5^3 is a term.
5755 = 5^1 + 75^2 + 5^3 is a term.
88297 = 88^1 + 297^2 is a term.
234322 = 23^1 + 4^2 + 3^3 + 22^4 is a term.
		

Crossrefs

Programs

  • Python
    import itertools
    analys = range(1, 7) # increase this if you want
    for limite in analys:
        numbers = range(pow(10,limite-1),pow(10,limite))
        r = range(1, limite+1)
        disp_temp = []
        for s in r:
            disp = list(itertools.product(r, repeat=s+1))
            disp_temp.extend(disp)
        disp_ok = [d for d in disp_temp if sum(d)==limite]
        for numero in numbers:
            str_numero = str(numero)
            for combo in disp_ok:
                k = limite
                totale = 0
                for c in range(len(combo), 0, -1):
                    partenza = k-combo[c-1]
                    porzione = str_numero[partenza:k]
                    if c == 1:
                        totale = totale + int(porzione)
                    else:
                        totale = totale + pow(int(porzione),c)
                    k = k - combo[c-1]
                if totale == numero:
                    print(numero)
Showing 1-3 of 3 results.