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-10 of 23 results. Next

A147523 a(n) = number of n-digit terms in A058369.

Original entry on oeis.org

3, 8, 37, 195, 1159, 6951, 42421, 261430, 1631123, 10238173, 64536808
Offset: 1

Views

Author

Zak Seidov, Apr 25 2009

Keywords

Examples

			a(1)=3: 0,1,9; a(2)=8: 10,18,19,45,46,55,90,99.
		

Crossrefs

A058369 Numbers n such that n and n^2 have same digit sum. A004159 Sum of digits of n^2. A007953 Digital sum (i.e. sum of digits) of n.

Extensions

a(9) from Donovan Johnson, Dec 08 2009
a(10)-a(11) from Donovan Johnson, Jul 31 2011

A007953 Digital sum (i.e., sum of digits) of n; also called digsum(n).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 8, 9, 10, 11, 12, 13, 14, 15
Offset: 0

Views

Author

R. Muller

Keywords

Comments

Do not confuse with the digital root of n, A010888 (first term that differs is a(19)).
Also the fixed point of the morphism 0 -> {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, 1 -> {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, 2 -> {2, 3, 4, 5, 6, 7, 8, 9, 10, 11}, etc. - Robert G. Wilson v, Jul 27 2006
For n < 100 equal to (floor(n/10) + n mod 10) = A076314(n). - Hieronymus Fischer, Jun 17 2007
It appears that a(n) is the position of 10*n in the ordered set of numbers obtained by inserting/placing one digit anywhere in the digits of n (except a zero before 1st digit). For instance, for n=2, the resulting set is (12, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 32, 42, 52, 62, 72, 82, 92) where 20 is at position 2, so a(2) = 2. - Michel Marcus, Aug 01 2022
Also the total number of beads required to represent n on a Russian abacus (schoty). - P. Christopher Staecker, Mar 31 2023
a(n) / a(2n) <= 5 with equality iff n is in A169964, while a(n) / a(3n) is unbounded, since if n = (10^k + 2)/3, then a(n) = 3*k+1, a(3n) = 3, so a(n) / a(3n) = k + 1/3 -> oo when k->oo (see Diophante link). - Bernard Schott, Apr 29 2023
Also the number of symbols needed to write number n in Egyptian numerals for n < 10^7. - Wojciech Graj, Jul 10 2025

Examples

			a(123) = 1 + 2 + 3 = 6, a(9875) = 9 + 8 + 7 + 5 = 29.
		

Crossrefs

Programs

  • Haskell
    a007953 n | n < 10 = n
              | otherwise = a007953 n' + r where (n',r) = divMod n 10
    -- Reinhard Zumkeller, Nov 04 2011, Mar 19 2011
    
  • Magma
    [ &+Intseq(n): n in [0..87] ];  // Bruno Berselli, May 26 2011
    
  • Maple
    A007953 := proc(n) add(d,d=convert(n,base,10)) ; end proc: # R. J. Mathar, Mar 17 2011
  • Mathematica
    Table[Sum[DigitCount[n][[i]] * i, {i, 9}], {n, 50}] (* Stefan Steinerberger, Mar 24 2006 *)
    Table[Plus @@ IntegerDigits @ n, {n, 0, 87}] (* or *)
    Nest[Flatten[# /. a_Integer -> Array[a + # &, 10, 0]] &, {0}, 2] (* Robert G. Wilson v, Jul 27 2006 *)
    Total/@IntegerDigits[Range[0,90]] (* Harvey P. Dale, May 10 2016 *)
    DigitSum[Range[0, 100]] (* Requires v. 14 *) (* Paolo Xausa, May 17 2024 *)
  • PARI
    a(n)=if(n<1, 0, if(n%10, a(n-1)+1, a(n/10))) \\ Recursive, very inefficient. A more efficient recursive variant: a(n)=if(n>9, n=divrem(n, 10); n[2]+a(n[1]), n)
    
  • PARI
    a(n, b=10)={my(s=(n=divrem(n, b))[2]); while(n[1]>=b, s+=(n=divrem(n[1], b))[2]); s+n[1]} \\ M. F. Hasler, Mar 22 2011
    
  • PARI
    a(n)=sum(i=1, #n=digits(n), n[i]) \\ Twice as fast. Not so nice but faster:
    
  • PARI
    a(n)=sum(i=1,#n=Vecsmall(Str(n)),n[i])-48*#n \\ M. F. Hasler, May 10 2015
    /* Since PARI 2.7, one can also use: a(n)=vecsum(digits(n)), or better: A007953=sumdigits. [Edited and commented by M. F. Hasler, Nov 09 2018] */
    
  • PARI
    a(n) = sumdigits(n); \\ Altug Alkan, Apr 19 2018
    
  • Python
    def A007953(n):
        return sum(int(d) for d in str(n)) # Chai Wah Wu, Sep 03 2014
    
  • Python
    def a(n): return sum(map(int, str(n))) # Michael S. Branicky, May 22 2021
    
  • Scala
    (0 to 99).map(.toString.map(.toInt - 48).sum) // Alonso del Arte, Sep 15 2019
    
  • Smalltalk
    "Recursive version for general bases. Set base = 10 for this sequence."
    digitalSum: base
    | s |
    base = 1 ifTrue: [^self].
    (s := self // base) > 0
      ifTrue: [^(s digitalSum: base) + self - (s * base)]
      ifFalse: [^self]
    "by Hieronymus Fischer, Mar 24 2014"
    
  • Swift
    A007953(n): String(n).compactMap{$0.wholeNumberValue}.reduce(0, +) // Egor Khmara, Jun 15 2021

Formula

a(A051885(n)) = n.
a(n) <= 9(log_10(n)+1). - Stefan Steinerberger, Mar 24 2006
From Benoit Cloitre, Dec 19 2002: (Start)
a(0) = 0, a(10n+i) = a(n) + i for 0 <= i <= 9.
a(n) = n - 9*(Sum_{k > 0} floor(n/10^k)) = n - 9*A054899(n). (End)
From Hieronymus Fischer, Jun 17 2007: (Start)
G.f. g(x) = Sum_{k > 0, (x^k - x^(k+10^k) - 9x^(10^k))/(1-x^(10^k))}/(1-x).
a(n) = n - 9*Sum_{10 <= k <= n} Sum_{j|k, j >= 10} floor(log_10(j)) - floor(log_10(j-1)). (End)
From Hieronymus Fischer, Jun 25 2007: (Start)
The g.f. can be expressed in terms of a Lambert series, in that g(x) = (x/(1-x) - 9*L[b(k)](x))/(1-x) where L[b(k)](x) = sum{k >= 0, b(k)*x^k/(1-x^k)} is a Lambert series with b(k) = 1, if k > 1 is a power of 10, else b(k) = 0.
G.f.: g(x) = (Sum_{k > 0} (1 - 9*c(k))*x^k)/(1-x), where c(k) = Sum_{j > 1, j|k} floor(log_10(j)) - floor(log_10(j-1)).
a(n) = n - 9*Sum_{0 < k <= floor(log_10(n))} a(floor(n/10^k))*10^(k-1). (End)
From Hieronymus Fischer, Oct 06 2007: (Start)
a(n) <= 9*(1 + floor(log_10(n))), equality holds for n = 10^m - 1, m > 0.
lim sup (a(n) - 9*log_10(n)) = 0 for n -> oo.
lim inf (a(n+1) - a(n) + 9*log_10(n)) = 1 for n -> oo. (End)
a(n) = A138530(n, 10) for n > 9. - Reinhard Zumkeller, Mar 26 2008
a(A058369(n)) = A004159(A058369(n)); a(A000290(n)) = A004159(n). - Reinhard Zumkeller, Apr 25 2009
a(n) mod 2 = A179081(n). - Reinhard Zumkeller, Jun 28 2010
a(n) <= 9*log_10(n+1). - Vladimir Shevelev, Jun 01 2011
a(n) = a(n-1) + a(n-10) - a(n-11), for n < 100. - Alexander R. Povolotsky, Oct 09 2011
a(n) = Sum_{k >= 0} A031298(n, k). - Philippe Deléham, Oct 21 2011
a(n) = a(n mod b^k) + a(floor(n/b^k)), for all k >= 0. - Hieronymus Fischer, Mar 24 2014
Sum_{n>=1} a(n)/(n*(n+1)) = 10*log(10)/9 (Shallit, 1984). - Amiram Eldar, Jun 03 2021

Extensions

More terms from Hieronymus Fischer, Jun 17 2007
Edited by Michel Marcus, Nov 11 2013

A004159 Sum of digits of n^2.

Original entry on oeis.org

0, 1, 4, 9, 7, 7, 9, 13, 10, 9, 1, 4, 9, 16, 16, 9, 13, 19, 9, 10, 4, 9, 16, 16, 18, 13, 19, 18, 19, 13, 9, 16, 7, 18, 13, 10, 18, 19, 13, 9, 7, 16, 18, 22, 19, 9, 10, 13, 9, 7, 7, 9, 13, 19, 18, 10, 13, 18, 16, 16, 9, 13, 19, 27, 19, 13, 18, 25, 16, 18, 13, 10, 18, 19, 22, 18, 25, 25, 18, 13
Offset: 0

Views

Author

Keywords

Comments

If 3|n then 9|a(n); otherwise, a(n) == 1 (mod 3). - Jon E. Schoenfield, Jun 30 2018

Examples

			Trajectories under the map x -> a(x):
1 ->  1 ->  1 ->  1 ->  1 ->  1 ->  1 ->  1 ->  1 -> ...
2 ->  4 ->  7 -> 13 -> 16 -> 13 -> 16 -> 13 -> 16 -> ...
3 ->  9 ->  9 ->  9 ->  9 ->  9 ->  9 ->  9 ->  9 -> ...
4 ->  7 -> 13 -> 16 -> 13 -> 16 -> 13 -> 16 -> 13 -> ...
5 ->  7 -> 13 -> 16 -> 13 -> 16 -> 13 -> 16 -> 13 -> ...
6 ->  9 ->  9 ->  9 ->  9 ->  9 ->  9 ->  9 ->  9 -> ...
7 -> 13 -> 16 -> 13 -> 16 -> 13 -> 16 -> 13 -> 16 -> ...
- _R. J. Mathar_, Jul 08 2012
		

Crossrefs

Cf. A240752 (first differences), A071317 (partial sums).
Cf. A062685 (smallest square with digit sum n, or 0 if no such square exists).

Programs

  • Haskell
    a004159 = a007953 . a000290  -- Reinhard Zumkeller, Apr 12 2014
    
  • Maple
    read("transforms"):
    A004159 := proc(n)
            digsum(n^2) ;
    end proc: # R. J. Mathar, Jul 08 2012
  • Mathematica
    a004159[n_Integer] := Apply[Plus, IntegerDigits[n^2]]; Table[
    a004159[n], {n, 0, 100}] (* Michael De Vlieger, Jul 21 2014 *)
    Total[IntegerDigits[#]]&/@(Range[0,100]^2) (* Harvey P. Dale, Feb 03 2019 *)
  • PARI
    A004159(n)=sumdigits(n^2) \\ M. F. Hasler, Sep 23 2014
  • Python
    def A004159(n):
        return sum(int(d) for d in str(n*n)) # Chai Wah Wu, Sep 03 2014
    

Formula

a(n) = A007953(A000290(n)); a(A058369(n)) = A007953(A058369(n)). - Reinhard Zumkeller, Apr 25 2009
a(10n) = a(n). If n > 1 is not a multiple of 10, then a(n)=4 iff n = 10^k+1 = A062397(k), a(n)=7 iff n is in A215614={4, 5, 32, 49, 149, 1049}, and else a(n) >= 9. - M. F. Hasler, Sep 23 2014

A077436 Let B(n) be the sum of binary digits of n. This sequence contains n such that B(n) = B(n^2).

Original entry on oeis.org

0, 1, 2, 3, 4, 6, 7, 8, 12, 14, 15, 16, 24, 28, 30, 31, 32, 48, 56, 60, 62, 63, 64, 79, 91, 96, 112, 120, 124, 126, 127, 128, 157, 158, 159, 182, 183, 187, 192, 224, 240, 248, 252, 254, 255, 256, 279, 287, 314, 316, 317, 318, 319, 351, 364, 365, 366, 374, 375, 379, 384
Offset: 1

Views

Author

Giuseppe Melfi, Nov 30 2002

Keywords

Comments

Superset of A023758.
Hare, Laishram, & Stoll show that this sequence contains infinitely many odd numbers. In particular for each k in {12, 13, 16, 17, 18, 19, 20, ...} there are infinitely many terms in this sequence with binary digit sum k. - Charles R Greathouse IV, Aug 25 2015

Examples

			The element 79 belongs to the sequence because 79=(1001111) and 79^2=(1100001100001), so B(79)=B(79^2)
		

Crossrefs

Cf. A211676 (number of n-bit numbers in this sequence).
A261586 is a subsequence. Subsequence of A352084.

Programs

  • Haskell
    import Data.List (elemIndices)
    import Data.Function (on)
    a077436 n = a077436_list !! (n-1)
    a077436_list = elemIndices 0
       $ zipWith ((-) `on` a000120) [0..] a000290_list
    -- Reinhard Zumkeller, Apr 12 2011
    
  • Magma
    [n: n in [0..400] | &+Intseq(n, 2) eq &+Intseq(n^2, 2)]; // Vincenzo Librandi, Aug 30 2015
    
  • Maple
    select(t -> convert(convert(t,base,2),`+`) = convert(convert(t^2,base,2),`+`), [$0..1000]); # Robert Israel, Aug 27 2015
  • Mathematica
    t={}; Do[If[DigitCount[n, 2, 1] == DigitCount[n^2, 2, 1], AppendTo[t, n]], {n, 0, 364}]; t
    f[n_] := Total@ IntegerDigits[n, 2]; Select[Range[0, 384], f@ # == f[#^2] &] (* Michael De Vlieger, Aug 27 2015 *)
  • PARI
    is(n)=hammingweight(n)==hammingweight(n^2) \\ Charles R Greathouse IV, Aug 25 2015
    
  • Python
    def ok(n): return bin(n).count('1') == bin(n**2).count('1')
    print([m for m in range(400) if ok(m)]) # Michael S. Branicky, Mar 11 2022

Formula

A159918(a(n)) = A000120(a(n)). - Reinhard Zumkeller, Apr 25 2009

Extensions

Initial 0 added by Reinhard Zumkeller, Apr 28 2012, Apr 12 2011

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

A058852 Palindromes n such that n and n^2 have same digit sum.

Original entry on oeis.org

0, 1, 9, 55, 99, 585, 595, 838, 999, 5995, 8668, 9999, 45954, 48384, 55755, 56665, 59895, 59995, 64846, 65656, 77977, 86968, 88488, 89398, 97479, 97579, 99099, 99199, 99999, 158851, 176671, 509905, 549945, 558855, 594495, 599995, 779977
Offset: 1

Views

Author

Patrick De Geest, Dec 15 2000

Keywords

Crossrefs

Programs

  • Maple
    read("transforms") :
    n := 1;
    for i from 1 do
        p := A002113(i) ;
        if digsum(p) = digsum(p^2) then
            printf("%d %d\n",n,p) ;
            n := n+1 ;
        end if;
    end do: # R. J. Mathar, Sep 09 2015
  • Mathematica
    Select[Range[0,78*10^4],PalindromeQ[#]&&Total[IntegerDigits[#]] == Total[ IntegerDigits[ #^2]]&] (* Harvey P. Dale, Sep 26 2021 *)

A292787 For n > 1, a(n) = least positive k, not a power of n, such that the digital sum of k in base n equals the digital sum of k^2 in base n.

Original entry on oeis.org

3, 2, 3, 4, 5, 3, 7, 8, 9, 5, 11, 4, 13, 7, 6, 16, 17, 9, 19, 5, 7, 11, 23, 9, 25, 13, 27, 8, 29, 6, 31, 32, 12, 17, 15, 9, 37, 19, 13, 16, 41, 7, 43, 12, 10, 23, 47, 16, 49, 25, 18, 13, 53, 27, 11, 8, 19, 29, 59, 16, 61, 31, 28, 64, 26, 12, 67, 17, 24, 15, 71
Offset: 2

Views

Author

Rémy Sigrist, Sep 23 2017

Keywords

Comments

For n > 2, a(n) <= n-1 (and the sum of digits of a(n)^2 in base n equals a(n)).
The term a(10) = 9 belongs to A058369.
For any n > 1 and k >= 0:
- let d_n(k) be the digital sum of k in base n,
- we have d_n(1) = 1 and d_n(n-1) = d_n((n-1)^2),
- for any k such that 0 <= k <= n, we have d_n(k^2) - d_n(k) = d_n((n-k)^2) - d_n(n-k),
- for any even n > 2, d_n(n/2) != d_n((n/2)^2),
- hence, for any n > 2, either a(n) < n/2 or a(n) = n-1,
- and the scatterplot of the sequence (for n > 2) has only points in the region y < x/2 and on the line y = x-1.
Apparently (see colorized scatterplot in Links section):
- for any k > 0, a(2^k + 1) = 2^k,
- if n is odd and not of the form 2^k + 1, then a(n) <= (n-1)/2.
See also A292788 for a similar sequence involving cubes instead of squares.

Examples

			For n = 8:
- 1 is a power of 8,
- d_8(2) = 2 and d_8(2^2) = 4,
- d_8(3) = 3 and d_8(3^2) = 2,
- d_8(4) = 4 and d_8(4^2) = 2,
- d_8(5) = 5 and d_8(5^2) = 4,
- d_8(6) = 6 and d_8(6^2) = 8,
- d_8(7) = 7 and d_8(7^2) = 7,
- hence a(8) = 7.
		

Crossrefs

Programs

  • Mathematica
    With[{kk = 10^3}, Table[SelectFirst[Complement[Range[2, kk], n^Range@ Floor@ Log[n, kk]], Total@ IntegerDigits[#, n] == Total@ IntegerDigits[#^2, n] &] /. k_ /; MissingQ@ k -> -1, {n, 2, 72}]] (* Michael De Vlieger, Sep 24 2017 *)
  • PARI
    a(n) = my (p=1); for (k=1, oo, if (k==p, p*=n, if (sumdigits(k,n) == sumdigits(k^2,n), return (k))))

A049343 Numbers m such that 2m and m^2 have same digit sum.

Original entry on oeis.org

0, 2, 9, 11, 18, 20, 29, 38, 45, 47, 90, 99, 101, 110, 119, 144, 146, 180, 182, 189, 198, 200, 245, 290, 299, 335, 344, 351, 362, 369, 380, 398, 450, 452, 459, 461, 468, 470, 479, 488, 495, 497, 639, 729, 794, 839, 848, 900, 929, 954, 990, 999
Offset: 1

Views

Author

Keywords

Comments

An easy way to prove that this sequence is infinite is to observe that it contains all numbers of the form 10^k+1. - Stefan Steinerberger, Mar 31 2006
For n>0: digital root (A010888) of 2n or n^2 is either 4 or 9. - Reinhard Zumkeller, Oct 01 2007

References

  • Problem 117 in Loren Larson's translation of Paul Vaderlind's book.

Crossrefs

Cf. A058369, A077436 (binary). - Reinhard Zumkeller, Apr 03 2011

Programs

  • Haskell
    import Data.List (elemIndices)
    import Data.Function (on)
    a049343 n = a049343_list !! (n-1)
    a049343_list = elemIndices 0
       $ zipWith ((-) `on` a007953) a005843_list a000290_list
    -- Reinhard Zumkeller, Apr 03 2011
    
  • Magma
    [n: n in [0..1000] | &+Intseq(2*n) eq &+Intseq(n^2)]; // Vincenzo Librandi, Nov 17 2015
  • Mathematica
    Select[Range[0, 1000], Sum[DigitCount[2# ][[i]]*i, {i, 1, 9}] == Sum[DigitCount[ #^2][[i]]*i, {i, 1, 9}] &] (* Stefan Steinerberger, Mar 31 2006 *)
    Select[Range[0,1000],Total[IntegerDigits[2#]]==Total[ IntegerDigits[ #^2]]&] (* Harvey P. Dale, Sep 25 2012 *)

Formula

A007953(A005843(a(n))) = A007953(A000290(a(n))). - Reinhard Zumkeller, Oct 01 2007

A058370 Primes p such that p and p^2 have same digit sum.

Original entry on oeis.org

19, 199, 379, 739, 1747, 1999, 3169, 3259, 4519, 4789, 4951, 5689, 5851, 5869, 6481, 6679, 7489, 8389, 9199, 10729, 12799, 12889, 13789, 14149, 14851, 14869, 15679, 17389, 17497, 17659, 17929, 22699, 26479, 26497, 26839, 28297, 28549, 29179
Offset: 1

Views

Author

G. L. Honaker, Jr., Dec 17 2000

Keywords

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[3300]],Total[IntegerDigits[#]]==Total[IntegerDigits[ #^2]]&] (* Harvey P. Dale, May 08 2011 *)
Showing 1-10 of 23 results. Next