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.

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

A111434 Numbers k such that the sums of the digits of k, k^2 and k^3 coincide.

Original entry on oeis.org

0, 1, 10, 100, 468, 585, 1000, 4680, 5850, 5851, 5868, 10000, 28845, 46800, 58500, 58510, 58680, 58968, 100000, 288450, 468000, 585000, 585100, 586800, 589680, 1000000, 2884500, 4680000, 5850000, 5851000, 5868000, 5896800, 10000000
Offset: 1

Views

Author

Giovanni Resta, Nov 21 2005

Keywords

Comments

The sequence is clearly infinite, since we can add trailing zeros. Is the subset of values not ending in 0 infinite too (see A114135)?

Examples

			468 is in the sequence since 468^2 = 219024 and 468^3 = 102503232 and we have 18 = 4+6+8 = 2+1+9+0+2+4 = 1+0+2+5+0+3+2+3+2.
5851 is in the sequence because 5851, 34234201 (= 5851^2) and 200304310051 (=5851^3) all have digital sum 19.
		

Crossrefs

Programs

  • Maple
    s:=proc(n) local nn: nn:=convert(n,base,10): sum(nn[j],j=1..nops(nn)): end: a:=proc(n) if s(n)=s(n^2) and s(n)=s(n^3) then n else fi end: seq(a(n),n=0..1000000); # Emeric Deutsch, May 13 2006
  • Mathematica
    SumOfDig[n_]:=Apply[Plus, IntegerDigits[n]]; Do[s=SumOfDig[n]; If[s==SumOfDig[n^2] && s==SumOfDig[n^3], Print[n]], {n, 10^6}]
    Select[Range[0,10000000],Length[Union[Total/@IntegerDigits[{#,#^2,#^3}]]] == 1&] (* Harvey P. Dale, Apr 26 2014 *)

Extensions

b-file Corrected by David A. Corneth, Jul 22 2021

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