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

A114135 Primitive numbers n such that the sums of the digits of n, n^2 and n^3 coincide (cf. A111434).

Original entry on oeis.org

1, 468, 585, 5851, 5868, 28845, 58968, 21688965, 29588877, 37848897, 49879981, 58577797, 79898994, 79958368, 79979698, 89757468, 109699677, 159699969, 468957888, 479597652, 479896587, 480749985, 494899398, 497349981, 498678256
Offset: 1

Views

Author

Keywords

Comments

Members of A111434 not congruent to 0 (mod 10). If k is a member of A111434 then so is 10^e*k.
The authors have calculated all members below 10^11.
The number of members less than 10^n {n=0..11}: 0,1,1,3,5,7,7,7,16,34,57,125.
Number of members congruent to k (mod 10): 0,7,1,0,2,23,8,20,49,15. But more interesting, number of members are congruent to k (mod 9): 66,59,0,0,0,0,0,0,0.
A007953(n) == n mod 9. Since 0 and 1 are the only k in [0,1,...8] with k == k^2 mod 9, all terms are congruent to 0 or 1 mod 9. - Robert Israel, Jan 26 2015

Crossrefs

Programs

  • Mathematica
    sod[n_] := Plus @@ IntegerDigits@n; lst = {}; Do[ If[(Mod[n, 9] == 0 || Mod[n, 9] == 1) && Mod[n, 10] != 0 && sod@n == sod[n2] == sod[n3], AppendTo[lst, n]], {n, 108/2}]; lst
    Select[Range[5*10^8],Length[Union[Total/@IntegerDigits/@{#,#^2,#^3}]]==1 && Mod[#,10]!=0&] (* Harvey P. Dale, Jul 07 2020 *)
  • PARI
    isok(n) = (n % 10) && ((sd=sumdigits(n)) == sumdigits(n^2)) && (sd == sumdigits(n^3)); \\ Michel Marcus, Jan 20 2015

A254066 Primitive numbers n such that the sums of the digits of n and n^2 coincide.

Original entry on oeis.org

1, 9, 18, 19, 45, 46, 55, 99, 145, 189, 198, 199, 289, 351, 361, 369, 379, 388, 451, 459, 468, 495, 496, 558, 559, 568, 585, 595, 639, 729, 739, 775, 838, 855, 954, 955, 999, 1098, 1099, 1179, 1188, 1189, 1198, 1269, 1468, 1485, 1494, 1495, 1585, 1738, 1747
Offset: 1

Views

Author

Nikhil Mahajan, Jan 25 2015

Keywords

Comments

Members of A058369 not congruent to 0 (mod 10).
This sequence is to A058369 what A114135 is to A111434.
Hare, Laishram, & Stoll show that this sequence is infinite. In particular for each k in {846, 847, 855, 856, 864, 865, 873, ...} there are infinitely many terms in this sequence with digit sum k. - Charles R Greathouse IV, Aug 25 2015

Examples

			9 is in the sequence because the digit sum of 9^2 = 81 is 9.
18 is in the sequence because the digit sum of 18^2 = 324 is 9, same as the digit sum of 18.
		

Crossrefs

Subsequence of A090570.

Programs

  • Magma
    [n: n in [1..1000] | &+Intseq(n) eq &+Intseq(n^2) and not IsZero(n mod 10)]; // Bruno Berselli, Jan 29 2015
    
  • Mathematica
    Select[Range[1000],!Divisible[#,10]&&Total[IntegerDigits[#]] == Total[ IntegerDigits[#^2]]&] (* Harvey P. Dale, Dec 27 2015 *)
  • PARI
    is(n)=sumdigits(n)==sumdigits(n^2) \\ Charles R Greathouse IV, Aug 25 2015
    
  • PARI
    list(lim)=my(v=List()); forstep(n=1,lim,[8, 9, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9], if(sumdigits(n)==sumdigits(n^2), listput(v,n))); Vec(v) \\ Charles R Greathouse IV, Aug 26 2015
  • Sage
    [n for n in [0..1000] if sum(n.digits())==sum((n^2).digits()) and n%10!=0] # Tom Edgar, Jan 27 2015
    

Extensions

More terms from Harvey P. Dale, Dec 27 2015

A257768 Numbers m such that for some power k, m is the sum of d + d^k as d runs through the digits of m.

Original entry on oeis.org

12, 18, 30, 90, 666, 870, 960, 1998, 7816, 42648, 119394, 302034, 360522, 1741752, 12051036, 909341082, 931186956, 1136424308, 1145082306, 8390370196, 49388550660, 52927388760, 100552730520, 41845367362266, 51671446297908, 245917854035004, 607628544623816, 858683110606660, 4023730658941192
Offset: 1

Views

Author

Pieter Post, May 07 2015

Keywords

Comments

The power k of most terms in this sequence is equal to or one more or one less than the number of digits in the term. One exception is 302034: 302034 = 3^9 + 0^9 + 2^9 + 0^9 + 3^9 + 4^9 + 3+0+2+0+3+4.

Examples

			666 = (6+6+6) + (6^3 + 6^3 + 6^3).
7816 = (7+8+1+6) + (7^4 + 8^4 + 1^4 + 6^4).
360522 = (3+6+0+5+2+2) + (3^7 + 6^7 + 0^7 + 5^7 + 2^7 + 2^7).
		

Crossrefs

Programs

  • Maple
    mmax:= 10:  # to get all terms < 10^mmax
    Res:= NULL:
    score:= (c,p) -> add(c[i+1]*(i+i^p), i=0..9):
    for m from 2 to mmax do
    comps:= convert(map(`-`,combinat:-composition(10+m,10),[1$10]),list):
    for c in comps do
      cL:= [seq(i$c[i+1], i=0..9)];
      if max(c[3..-1]) = 0 then slim:= 0 else slim:= 10^m fi;
      for p from 1 do
        s:= score(c,p);
        L:= sort(convert(s,base,10));
        if L = cL then Res:= Res,s; break fi;
        if s >= slim then break fi;
      od:
    od:
    od:
    sort([Res]); # Robert Israel, May 08 2015
  • Python
    # WARNING: this prints numbers in the sequence, but not in increasing order.
    def moda(n,a):
        kk = 0
        while n > 0:
            kk= kk+(n%10)**a
            n = n//10
        return kk
    def sod(n):
        kk = 0
        while n > 0:
            kk += n % 10
            n = n//10
        return kk
    for a in range (1, 10):
        for c in range (10, 10**6):
            if c == moda(c,a)+sod(c):
                print(c, end=",")

Extensions

a(14)-a(29) from Giovanni Resta, May 08 2015

A257787 Numbers n such that the sum of the digits of n to some power divided by the sum of the digits equal n.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 37, 48, 415, 231591, 3829377463694454, 56407086228259246207394322684
Offset: 1

Views

Author

Pieter Post, May 08 2015

Keywords

Comments

The first nine terms are trivial, but then the terms become very rare. It appears that this sequence is finite.

Examples

			37 = (3^3+7^3)/(3+7).
231591 = (2^7+3^7+1^7+5^7+9^7+1^7)/(2+3+1+5+9+1).
		

Crossrefs

Programs

  • Python
    def moda(n,a):
        kk = 0
        while n > 0:
            kk= kk+(n%10)**a
            n =int(n//10)
        return kk
    def sod(n):
        kk = 0
        while n > 0:
            kk= kk+(n%10)
            n =int(n//10)
        return kk
    for a in range (1, 10):
        for c in range (1, 10**6):
            if c*sod(c)==moda(c, a):
                print (a,c, moda(c,a),sod(c))

Extensions

a(14) from Giovanni Resta, May 09 2015
a(15) from Chai Wah Wu, Nov 30 2015
Showing 1-4 of 4 results.