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 11-13 of 13 results.

A262091 Amicable digital pairs: The smaller number of a pair (x,y) with x <> y such that, in decimal notation and with an appropriate number of leading zeros prepended, x=(x_m...x_1x_0){10}, y=(y_m...y_1y_0){10}, x = y_m^m + ... + y_1^m + y_0^m, and y = x_m^m + ... + x_1^m + x_0^m.

Original entry on oeis.org

136, 919, 2178, 58618, 89883, 63804, 2755907, 8139850, 144839908, 277668893, 304162700, 4370652168, 21914086555935085, 187864919457180831, 13397885590701080090, 19095442247273220984552, 108493282045082839040458, 1553298727699254868304830
Offset: 1

Views

Author

Don Knuth, Sep 10 2015

Keywords

Comments

If we allow x to be equal to y we get numbers such as 1, 153, 370, 371, 407, ... See A252648. - Chai Wah Wu, Jan 04 2016

Examples

			a(1) is amicably paired to 244, because 1^3 + 3^3 + 6^3 = 244 and 2^3 + 4^3 + 4^3 = 136.
		

Crossrefs

A262092 has the larger element of each pair. Cf. A252648.

Programs

  • Python
    # print pairs with leading zeros
    from _future_ import print_function
    from itertools import combinations_with_replacement
    for m in range(2,11):
        fs = '0'+str(m+1)+'d'
        for c in combinations_with_replacement(range(10),m+1):
            n = sum(d**m for d in c)
            r = sum(int(q)**m for q in str(n))
            rlist = sorted(int(d) for d in str(r))
            rlist = [0]*(m+1-len(rlist))+rlist
            if n < r and rlist == list(c):
                print(format(n,fs),format(r,fs)) # Chai Wah Wu, Jan 04 2016

Extensions

Definition clarified by Chai Wah Wu, Jan 04 2016

A123253 Sum of 7th powers of digits of n.

Original entry on oeis.org

0, 1, 128, 2187, 16384, 78125, 279936, 823543, 2097152, 4782969, 1, 2, 129, 2188, 16385, 78126, 279937, 823544, 2097153, 4782970, 128, 129, 256, 2315, 16512, 78253, 280064, 823671, 2097280, 4783097, 2187, 2188, 2315, 4374, 18571, 80312, 282123
Offset: 0

Views

Author

Zerinvary Lajos, Nov 06 2006

Keywords

Comments

Fixed points are listed in A124068 = row n=7 of A252648. - M. F. Hasler, Apr 12 2015

Crossrefs

Programs

  • Magma
    [0] cat [&+[d^7: d in Intseq(n)]: n in [1..40]]; // Bruno Berselli, Feb 01 2013
    
  • Maple
    A123253 := proc(n)
            add(d^7,d=convert(n,base,10)) ;
    end proc: # R. J. Mathar, Jan 16 2013
  • Mathematica
    Table[Sum[DigitCount[n][[i]] i^7, {i, 9}], {n, 0, 40}] (* Bruno Berselli, Feb 01 2013 *)
  • PARI
    A123253(n)=sum(i=1,#n=digits(n),n[i]^7) \\ M. F. Hasler, Apr 12 2015

A255668 Number of perfect digital invariants of order n, i.e., numbers equal to the sum of n-th powers of their digits.

Original entry on oeis.org

1, 10, 2, 6, 5, 8, 3, 7, 5, 6, 3, 10, 2, 3, 3, 2, 4, 6, 2, 6, 3, 4, 2, 7, 5, 10, 2, 9, 2, 9, 2, 6, 3, 5, 3, 6, 3, 5, 5, 7, 2, 2, 4, 9, 6, 9, 5, 7, 2, 3, 2, 4, 2, 3, 6, 4, 5, 4, 2, 4, 4, 4, 3, 7, 3, 6, 3, 4, 3, 3, 4, 3, 4, 5, 3, 4, 5, 5, 3, 3, 2, 3, 2, 4, 3, 8, 3, 5, 2, 7, 3
Offset: 0

Views

Author

M. F. Hasler, Apr 14 2015

Keywords

Comments

Row lengths of the table A252648.
For a number with d digits, the sum of n-th powers cannot exceed d*9^n, but the number is not less than 10^(d-1). Therefore there is only a finite number of possible perfect digital invariants for any n, the largest of which has at most d* digits, where d* = 1+(n*log(9)+log d*)/log(10).

Examples

			a(0)=1 because 1 is the only number equal to the sum of 0th powers of its digits.
a(1)=10 because { 0, 1, ... 9 } are the only numbers equal to the sum of their digits (taken to the power 1).
a(2)=2 because 0 and 1 are the only numbers equal to the sum of the squares of their digits.
a(3)=6 because { 0, 1, 153, 370, 371, 407 } is the set of all numbers equal to the sum of the 3rd powers of their digits, cf. A046197.
For more examples, see the table A252648.
		

Crossrefs

Programs

  • Mathematica
    Reap@ For[n = 0, n < 6, n++, Sow@ Length@ Select[Range[0, 10^(n + 1)], Plus @@ (IntegerDigits[#]^n) == # &]] // Flatten // Rest (* Michael De Vlieger, Apr 14 2015 *)

Formula

a(n) >= 2 for all n > 0, since 0 and 1 are digital invariants for any power n > 0.

Extensions

a(10)-a(90) from Don Knuth, Sep 09 2015
Previous Showing 11-13 of 13 results.