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-20 of 71 results. Next

A153745 Numbers k such that the number of digits d in k^2 is not prime and for each factor f of d the sum of the d/f digit groupings in k^2 of size f is a square.

Original entry on oeis.org

1, 2, 3, 39, 60, 86, 90, 321, 347, 401, 3387, 3414, 3578, 3900, 4767, 6000, 6549, 6552, 6744, 6780, 6783, 7387, 7862, 7889, 8367, 8598, 8600, 8773, 8898, 9000, 9220, 9884, 9885, 10000, 10001, 10002, 10003, 10004, 10005, 10010, 10011, 10012, 10013, 10020
Offset: 1

Views

Author

Doug Bell, Dec 31 2008

Keywords

Comments

This sequence is a subsequence of A061910.

Examples

			39^2 = 1521; 1+5+2+1 = 9 = 3^2 and 15+21 = 36 = 6^2.
321^2 = 103041; 1+0+3+0+4+1 = 9 = 3^2; 10+30+41 = 81 = 9^2; and 103+041 = 144 = 12^2.
		

Crossrefs

Programs

  • PARI
    isok(n) = {my(d = digits(n^2)); if (! isprime(#d), my(dd = divisors(#d)); for (k=1, #dd, my(tg = 10^dd[k]); my(s = 0); my(m = n^2); for (i=1, #d/dd[k], s += m % tg; m = m\tg;); if (! issquare(s), return(0));); return (1););} \\ Michel Marcus, Jun 06 2015
    
  • Python
    from sympy import divisors
    from gmpy2 import is_prime, isqrt_rem, isqrt, is_square
    A153745_list = []
    for l in range(1,20):
        if not is_prime(l):
            fs = divisors(l)
            a, b = isqrt_rem(10**(l-1))
            if b > 0:
                a += 1
            for n in range(a,isqrt(10**l-1)+1):
                ns = str(n**2)
                for g in fs:
                    y = 0
                    for h in range(0,l,g):
                        y += int(ns[h:h+g])
                    if not is_square(y):
                        break
                else:
                    A153745_list.append(n) # Chai Wah Wu, Jun 08 2015

Formula

a(n) = sqrt(A258660(n)). - Doug Bell, Jun 15 2015

Extensions

Data corrected by Doug Bell, Jan 19 2009
Name corrected by Doug Bell, Jun 06 2015

A164817 Positive numbers n with property that average digit of n^2 is an integer.

Original entry on oeis.org

1, 2, 3, 8, 12, 15, 18, 21, 24, 27, 30, 41, 58, 59, 68, 85, 95, 113, 122, 145, 152, 157, 158, 166, 176, 179, 184, 190, 193, 194, 212, 221, 238, 251, 256, 257, 266, 274, 275, 283, 284, 292, 311, 313, 330, 339, 345, 354, 360, 369, 375, 381, 387, 399, 402, 405, 417
Offset: 1

Views

Author

Zak Seidov, Aug 27 2009

Keywords

Comments

A004159(n)/nod(n^2) = sod(n^2)/nod(n^2) is an integer, where sod(n^2)= sum of digits of n^2, nod(n^2) = number of digits of n^2. Correspondent values of sod(n^2)/nod(n^2) in A164818.

Crossrefs

Programs

  • Maple
    filter:= proc(n) local L;
    L:= convert(n^2,base,10);
    type(convert(L,`+`)/nops(L), integer)
    end proc:
    select(filter, [$1..1000]); # Robert Israel, Feb 24 2016
  • Mathematica
    Select[Range[500],IntegerQ[Mean[IntegerDigits[#^2]]]&] (* Harvey P. Dale, May 25 2011 *)
  • PARI
    isok(n) = my(d=digits(n^2)); (vecsum(d) % #d) == 0; \\ Michel Marcus, Feb 24 2016

A316480 Table read by rows: T(n,k), 0 <= k <= 9, is the number of n-digit squares whose average digit is exactly k.

Original entry on oeis.org

1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 21, 0, 0, 1, 0, 0, 0, 0, 57, 0, 0, 42, 0, 0, 0, 0, 2, 0, 0, 192, 0, 0, 14, 0, 0, 0, 0, 52, 0, 0, 499, 0, 0, 0, 0, 0, 25, 191, 1281, 2658, 2282, 705, 65, 0, 0
Offset: 1

Views

Author

Jon E. Schoenfield, Jul 04 2018

Keywords

Comments

The only square whose average digit is 0 is the 1-digit number 0^2 = 0.
The only square whose average digit is 9 is the 1-digit number 3^2 = 9.
Suppose m^2 is an n-digit number whose average digit is an integer k, i.e., digitsum(m^2) = n*k. Since digitsum(m^2) mod 9 = 0, 1, 4, or 7 (cf. A004159), it follows that
- if k = 1, 4, or 7, then n mod 9 = 0, 1, 4, or 7;
- if k = 2, 5, or 8, then n mod 9 = 0, 2, 5, or 8;
- if k = 3 or 6, then n mod 9 = 0, 3, or 6.
In this table, each possible combination of a value of k and a value of n mod 9 is identified with an asterisk (*):
.
n mod 9
.
0 1 2 3 4 5 6 7 8
+----------------------------------
1 | * * * *
|
2 | * * * *
|
3 | * * *
|
4 | * * * *
k |
5 | * * * *
|
6 | * * *
|
7 | * * * *
|
8 | * * * *
.
Not surprisingly, among the values k=1..8, the value of k that occurs least frequently as the average digit of a square is 8.

Examples

			Table begins
  n\k| 0   1      2       3        4        5       6     7 8 9
  ---+---------------------------------------------------------
   1 | 1   1      0       0        1        0       0     0 0 1
   2 | 0   0      0       0        0        1       0     0 0 0
   3 | 0   0      0       5        0        0       2     0 0 0
   4 | 0   0      0       0        6        0       0     0 0 0
   5 | 0   0      5       0        0       21       0     0 1 0
   6 | 0   0      0      57        0        0      42     0 0 0
   7 | 0   2      0       0      192        0       0    14 0 0
   8 | 0   0     52       0        0      499       0     0 0 0
   9 | 0  25    191    1281     2658     2282     705    65 0 0
  10 | 0  12      0       0     5308        0       0    93 0 0
  11 | 0   0    548       0        0    13597       0     0 1 0
  12 | 0   0      0   23310        0        0   12871     0 0 0
  13 | 0  77      0       0   143724        0       0   753 0 0
  14 | 0   0   5572       0        0   360720       0     0 1 0
  15 | 0   0      0  449170        0        0  239403     0 0 0
  16 | 0 102      0       0  3990950        0       0  6029 0 0
  17 | 0   0  51977       0        0  9994767       0     0 4 0
  18 | 0 417 157382 8665925 55115308 45351595 4568205 36552 8 0
		

Crossrefs

Cf. A316481-A316488 (Squares whose arithmetic mean of digits is k, for k=1..8).

Programs

  • Mathematica
    Block[{nn = 9, s}, s = MapAt[Prepend[#, 0] &, Map[Mean@ IntegerDigits[#] &, SplitBy[Range[10^(nn/2)]^2, IntegerLength], {2}], 1]; Table[Count[s[[n]], k], {n, nn}, {k, 0, 9}]] // Flatten (* Michael De Vlieger, Jul 06 2018 *)

A061912 a(n) is the smallest m for which sqrt(sum of digits of m^2) = n.

Original entry on oeis.org

0, 1, 2, 3, 13, 67, 264, 1667, 16667, 94863, 1643167, 29983327, 706399164, 31144643167, 1296109172867, 62441868958167, 6927459779738887, 447213595487659543, 77453069648658793167, 14104963594032775808167, 3146266035952345970972687
Offset: 0

Views

Author

Asher Auel, May 17 2001

Keywords

Comments

a(15) <= 62441868958167. - Donovan Johnson, Jul 10 2012
a(21) <= 29999999949999914454883190583. a(22) <= 948566760423324122079007168333. - Zhining Yang, Jun 21 2024

Examples

			Sum of digits of 13^2 = sum of digits of 169 = 16 is the first occurrence of 4^2, so a(4) = 13.
		

Crossrefs

Programs

  • Maple
    f := []: a := 1: for i from 1 to 10 do for j from 1 do if sqrt(convert(convert(j^2,base,10),`+`)) = i then f := [op(f),j]; a := j; break fi; od; od; f;
  • Mathematica
    t={}; m=0; Do[While[Sqrt[Total[IntegerDigits[m^2]]] != n, m++]; AppendTo[t, m], {n,0,9}]; t (* Jayanta Basu, May 06 2013 *)
  • PARI
    a(n) = my(k=0); while(sumdigits(k^2) != n^2, k++); k; \\ Michel Marcus, Jan 07 2017

Extensions

a(11) from John W. Layman, Jan 10 2002
a(12) from Ryan Propper, Jul 07 2005
a(13) from Zak Seidov, Jan 27 2011
a(14) from Donovan Johnson, Jul 10 2012
a(15)-a(20) from Zhining Yang, Jun 21 2024

A061903 Number of distinct elements of the iterative cycle: n -> sum of digits of n^2.

Original entry on oeis.org

1, 1, 4, 1, 3, 3, 1, 2, 2, 1, 1, 4, 1, 2, 2, 1, 2, 3, 1, 2, 4, 1, 2, 2, 2, 2, 3, 2, 3, 2, 1, 2, 3, 2, 2, 2, 2, 3, 2, 1, 3, 2, 2, 3, 3, 1, 2, 2, 1, 3, 3, 1, 2, 3, 2, 2, 2, 2, 2, 2, 1, 2, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 2, 3, 3, 2, 3, 3, 2, 2, 2, 2, 3, 3, 2, 2, 3, 3, 3, 3, 1, 3, 3, 3, 3, 2, 2, 3, 3, 2, 1, 4, 1, 2, 2
Offset: 0

Views

Author

Asher Auel, May 17 2001

Keywords

Comments

It seems that any such iterative cycle can contain at most 4 distinct elements.
a(197483417) = 5 is the first counterexample: 136 -> 28 -> 19 -> 10 -> 1. In fact this sequence is unbounded, since you can extend any chain leftward with the number k999...999 for suitably chosen k. In particular this gives the (pessimistic) bound that there is some n < 10^21942602 with a(n) = 6. - Charles R Greathouse IV, May 30 2014

Examples

			a(2) = 4 since 2 -> 4 -> 1+6 = 7 -> 4+9 = 13 -> 1+6+9 = 16 -> 2+5+6 = 13, thus {4,7,13,16} are the distinct elements of the iterative cycle of 2. a(6) = 1 since 6 -> 3+6 = 9 -> 8+1 = 9 thus 9 is the only element in the iterative cycle of 6.
		

Crossrefs

Programs

  • Maple
    A:= proc(n) local L,m,x;
      L:= {}; x:= n;
      do
        x:= convert(convert(x^2,base,10),`+`);
        if member(x,L) then return nops(L)  fi;
        L:= L union {x};
      od:
    end proc:
    seq(A(n), n=0..200); # Robert Israel, May 30 2014
  • PARI
    a(n)=my(v=List()); while(1, n=sumdigits(n^2); for(i=1, #v, if(n==v[i], return(#v))); listput(v,n)) \\ Charles R Greathouse IV, May 30 2014

Extensions

Corrected a(0) and example, Robert Israel, May 30 2014

A071317 a(n) = a(n-1) + sum of digits of n^2.

Original entry on oeis.org

0, 1, 5, 14, 21, 28, 37, 50, 60, 69, 70, 74, 83, 99, 115, 124, 137, 156, 165, 175, 179, 188, 204, 220, 238, 251, 270, 288, 307, 320, 329, 345, 352, 370, 383, 393, 411, 430, 443, 452, 459, 475, 493, 515, 534, 543, 553, 566, 575, 582, 589, 598, 611, 630, 648, 658
Offset: 0

Views

Author

Labos Elemer, May 27 2002

Keywords

References

  • N. Agronomof, Question 4419, L'Intermédiaire des Math. 21 (1914) 147.

Crossrefs

Partial sums of A004159.

Programs

  • Haskell
    a071317 n = a071317_list !! n
    a071317_list = scanl1 (+) a004159_list
    -- Reinhard Zumkeller, Apr 12 2014
    
  • Mathematica
    s=0; Do[s=s+Apply[Plus, IntegerDigits[n^2]]; Print[s], {n, 1, 128}]
    nxt[{n_,a_}]:={n+1,a+Total[IntegerDigits[(n+1)^2]]}; NestList[nxt,{0,0},60][[All,2]] (* Harvey P. Dale, Mar 09 2017 *)
    FoldList[#1 + Total@ IntegerDigits[#2^2] &, 0, Range@ 55] (* Michael De Vlieger, Mar 25 2017 *)
    Accumulate[Plus @@@ IntegerDigits[Range[0, 50]^2]] (* Giovanni Resta, Mar 25 2017 *)
  • Python
    from itertools import count, islice, accumulate
    def A071317_gen(): # generator of terms
        return accumulate(map(lambda n:sum(map(int,str(n**2))),count(0)))
    A071317_list = list(islice(A071317_gen(),20)) # Chai Wah Wu, Mar 15 2023

Extensions

a(0) = 0 prepended by Reinhard Zumkeller, Apr 12 2014

A055567 Sum of digits of n^6.

Original entry on oeis.org

0, 1, 10, 18, 19, 19, 27, 28, 19, 18, 1, 28, 45, 37, 37, 27, 37, 37, 18, 37, 10, 36, 37, 46, 36, 28, 46, 45, 37, 37, 18, 46, 37, 54, 37, 46, 45, 46, 37, 45, 19, 28, 45, 37, 46, 45, 64, 46, 36, 37, 19, 54, 55, 37, 54, 46, 55, 54, 55, 37, 27, 37, 46, 36, 64, 55, 45, 55, 64, 45
Offset: 0

Views

Author

Henry Bottomley, May 26 2000

Keywords

Examples

			a(2) = 10 because 2^6 = 64 and 6+4 = 10.
		

Crossrefs

Programs

  • Mathematica
    DigitSum[Range[0, 100]^6] (* Paolo Xausa, Jul 03 2024 *)
  • PARI
    a(n) = sumdigits(n^6); \\ Seiichi Manyama, Nov 16 2021

A064399 Numbers k whose sum of digits exceeds the sum of the digits of k^2.

Original entry on oeis.org

39, 48, 49, 79, 149, 179, 249, 318, 348, 349, 389, 390, 399, 448, 449, 480, 489, 490, 498, 499, 548, 549, 579, 649, 679, 749, 789, 790, 795, 799, 849, 889, 895, 898, 899, 949, 1049, 1096, 1149, 1249, 1429, 1488, 1489, 1490, 1497, 1498, 1499, 1735, 1739
Offset: 1

Views

Author

Robert G. Wilson v, Sep 28 2001

Keywords

Crossrefs

Programs

  • Mathematica
    Select[ Range[ 2500 ], Apply[ Plus, IntegerDigits[ # ] ] > Apply[ Plus, IntegerDigits[ #^2 ] ] & ]
  • PARI
    isok(n) = sumdigits(n) > sumdigits(n^2); \\ Michel Marcus, Jun 24 2018

A348300 a(n) is the largest number that is the digit sum of the square of an n-digit number.

Original entry on oeis.org

13, 31, 46, 63, 81, 97, 112, 130, 148, 162, 180, 193, 211, 229, 244, 262, 277, 297, 310, 331, 343, 360, 378, 396
Offset: 1

Views

Author

Keywords

Comments

18*n-a(n) appears to be nondecreasing. - Chai Wah Wu, Nov 18 2021
According to new data 18*n-a(n) sometimes decreases. - David A. Corneth, Feb 21 2024
a(n) is the digit sum of the square of the last n-digit integer in A067179. - Zhao Hui Du, Mar 04 2024
a(n) appears to be approximately equal to 16.5*n. - Zhining Yang, Mar 12 2024
a(n) modulo 9 is either 0, 1, 4 or 7. - Chai Wah Wu, Apr 04 2024

Examples

			a(3) = 46 because 46 is the largest digital sum encountered among the squares (that of 937) of all 3-digit numbers. Such maximal digital sum can be achieved by more than one square (squares of 836 and 883 also have digital sum 46). Largest of these is A348303.
		

Crossrefs

Programs

  • Mathematica
    Array[Max@ Map[Total@ IntegerDigits[#^2] &, Range[10^(# - 1), 10^# - 1]] &, 8] (* Michael De Vlieger, Oct 12 2021 *)
  • Python
    def A348300(n): return max(sum(int(d) for d in str(m**2)) for m in range(10**(n-1),10**n)) # Chai Wah Wu, Jun 26 2024
  • Sage
    def A348300(n):
        return max(sum((k^2).digits()) for k in (10^(n-1)..10^n-1))
    

Formula

a(n) = Max_{k=10^(n-1)..10^n-1} A004159(k).

Extensions

a(11) from Chai Wah Wu, Nov 18 2021
a(12)-a(13) from Martin Ehrenstein, Nov 20 2021
a(14)-a(24) from Zhao Hui Du, Feb 23 2024
Name edited by Jon E. Schoenfield, Mar 10 2024

A055568 Numbers not greater than the sum of digits of their squares.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 13, 14, 17
Offset: 1

Views

Author

Henry Bottomley, May 26 2000

Keywords

Examples

			4 is a term because 4^2 = 16 and 1+6 = 7 >= 4.
		

Crossrefs

Previous Showing 11-20 of 71 results. Next