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

A067552 a(n) = SumOfDigits(n)^2 - SumOfDigits(n^2), where SumOfDigits = A007953.

Original entry on oeis.org

0, 0, 0, 0, 9, 18, 27, 36, 54, 72, 0, 0, 0, 0, 9, 27, 36, 45, 72, 90, 0, 0, 0, 9, 18, 36, 45, 63, 81, 108, 0, 0, 18, 18, 36, 54, 63, 81, 108, 135, 9, 9, 18, 27, 45, 72, 90, 108, 135, 162, 18, 27, 36, 45, 63, 90, 108, 126, 153, 180, 27, 36, 45, 54, 81, 108, 126, 144, 180, 207
Offset: 0

Views

Author

Reinhard Zumkeller, Jan 28 2002

Keywords

Comments

All terms are divisible by 9; see A069912 for the quotient. - Ivan Neretin, Sep 01 2016

Examples

			a(16) = SumOfDigits(16)^2 - SumOfDigits(16^2) = (1+6)^2 - SumOfDigits(256) = 7^2 - (2+5+6) = 49 - 13 = 36.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Plus @@ IntegerDigits[n]^2 - Plus @@ (IntegerDigits[n^2]); Table[ f[n], {n, 0, 100}]
  • PARI
    a(n) = sumdigits(n)^2 - sumdigits(n^2); \\ Michel Marcus, Sep 01 2016

Formula

a(n) = A007953(n)^2 - A004159(n).

Extensions

Edited by Robert G. Wilson v, May 04 2002

A215614 Numbers k that are not multiples of 10 and such that sum of digits of k^2 is 7.

Original entry on oeis.org

4, 5, 32, 49, 149, 1049
Offset: 1

Views

Author

Zak Seidov, Aug 17 2012

Keywords

Comments

Except for the number 1, the terms of this sequence and numbers 10^k+1 (A062397) are the only numbers (up to trailing 0's) whose square has sum of digits less than 9. - M. F. Hasler, Sep 23 2014
Is this sequence finite? See also A384095 for a similar problem with digit sum 9. - M. F. Hasler, Jun 20 2025
a(7) > 10^15 if it exists. - David A. Corneth, Jun 21 2025
a(7) > 10^65 if it exists. - Michael S. Branicky, Jun 25 2025
a(7) > 10^700 if it exists. - Max Alekseyev, Jun 27 2025

Crossrefs

Cf. A004159 (sum of digits of n^2).
Subsequence of A262711.
Cf. A384094 (similar for digit sum 9), A384095 (subset of "sporadic solutions").

Programs

  • Mathematica
    Select[Range[1500],Mod[#,10]!=0&&Total[IntegerDigits[#^2]]==7&] (* Harvey P. Dale, Aug 21 2022 *)
  • PARI
    for(n=1,9e9, n%10&&sumdigits(n^2)==7&&print1(n",")) \\ M. F. Hasler, Sep 23 2014

Extensions

Edited and unproven keywords fini,full removed by Max Alekseyev, Jun 20 2025

A056527 Numbers where iterated sum of digits of square settles down to a cyclic pattern (in fact 13, 16, 13, 16, ...).

Original entry on oeis.org

2, 4, 5, 7, 11, 13, 14, 16, 20, 22, 23, 25, 29, 31, 32, 34, 38, 40, 41, 43, 47, 49, 50, 52, 56, 58, 59, 61, 65, 67, 68, 70, 74, 76, 77, 79, 83, 85, 86, 88, 92, 94, 95, 97, 101, 103, 104, 106, 110, 112, 113, 115, 119, 121, 122, 124, 128, 130, 131, 133, 137, 139, 140
Offset: 1

Views

Author

Henry Bottomley, Jun 19 2000

Keywords

Comments

Numbers == 2, 4, 5 or 7 mod 9, i.e. such that n^4 is not congruent to n^2 mod 9.
Numbers congruent to {2, 4, 5, 7} mod 9.

Examples

			a(1)=2 because iteration starts 2, 4, 7, 13, 16, 13, 16, ....
		

Crossrefs

Cf. A004159 for sum of digits of square, A056020 where iteration settles to 1, A056020 where iteration settles to 9, also A056528, A056529. Unhappy numbers A031177 deal with iteration of square of sum of digits not settling to a single result.

Programs

  • Mathematica
    Flatten[Table[9n+{2,4,5,7},{n,0,20}]] (* or *) LinearRecurrence[{1,0,0,1,-1},{2,4,5,7,11},100] (* Harvey P. Dale, Apr 05 2015 *)
  • PARI
    Vec(x*(2 + 2*x + x^2 + 2*x^3 + 2*x^4) / ((1 - x)^2*(1 + x)*(1 + x^2)) + O(x^80)) \\ Colin Barker, Dec 19 2017

Formula

a(n) = a(n-1) + a(n-4) - a(n-5) for n>5. - Harvey P. Dale, Apr 05 2015
From Colin Barker, Dec 19 2017: (Start)
G.f.: x*(2 + 2*x + x^2 + 2*x^3 + 2*x^4) / ((1 - x)^2*(1 + x)*(1 + x^2)).
a(n) = (-9 + (-1)^(1+n) - (3-3*i)*(-i)^n - (3+3*i)*i^n + 18*n) / 8 where i=sqrt(-1).
(End)

A202089 Numbers n such that n^2 and (n+1)^2 have same digit sum.

Original entry on oeis.org

4, 13, 22, 49, 58, 76, 103, 130, 139, 157, 193, 202, 229, 247, 256, 274, 283, 301, 391, 418, 427, 454, 463, 472, 481, 508, 526, 553, 598, 607, 616, 643, 661, 679, 688, 724, 733, 742, 760, 769, 778, 796, 850, 868, 877, 886, 904, 913, 931, 949, 958, 976, 1003
Offset: 1

Views

Author

Zak Seidov, Dec 11 2011

Keywords

Comments

Or numbers n such that A004159(n)=A004159(n+1), or A007953(n^2)=A007953((n+1)^2).
Corresponding digit sums are of the form 7+9k, with k=1, 2, 3,... .
Numbers n are of the form 4+9m, with m=0, 1, 2, 5, 6, 8, 11, ... .
A240752(a(n)) = 0. - Reinhard Zumkeller, Apr 12 2014

Examples

			4^2=16 and 5^2=25 have same digit sum ds=7.
13^2=169 and 14^2=196 have ds=16.
76^2=5776 and 77^2=5929 have ds=25.
526^2=276676 and 527^2=277729 have ds=34.
		

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndices)
    a202089 n = a202089_list !! (n-1)
    a202089_list = elemIndices 0 a240752_list
    -- Reinhard Zumkeller, Apr 12 2014
    
  • Mathematica
    cnt = 0; nn = 10000; n = 4; Reap[While[cnt < nn, While[Total[IntegerDigits[n^2]] != Total[IntegerDigits[(n + 1)^2]], n = n + 9]; cnt++; Sow[n]; n = n + 9]][[2, 1]]
  • Python
    def ok(n): return sum(map(int, str(n*n))) == sum(map(int, str((n+1)**2)))
    print(list(filter(ok, range(1004)))) # Michael S. Branicky, Apr 13 2021

A239878 Numbers k with digit_sum(k*k) + 1 = digit_sum((k+1)*(k+1)).

Original entry on oeis.org

0, 18, 27, 36, 45, 72, 81, 108, 153, 198, 216, 225, 243, 252, 270, 297, 306, 342, 369, 396, 423, 441, 450, 477, 486, 495, 504, 513, 522, 549, 558, 576, 603, 630, 639, 657, 693, 702, 729, 747, 756, 783, 801, 846, 891, 918, 954, 963, 972, 981
Offset: 1

Views

Author

Reiner Moewald, Mar 28 2014

Keywords

Comments

All terms are divisible by 9.
The number of terms is unlimited: n = 3*10^z + 6, i.e., digit_sum(n*n) + 1 = 27 + 1 = 28 = digit_sum((n+1)*(n+1)). - Reiner Moewald, Apr 20 2014

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndices)
    a239878 n = a239878_list !! (n-1)
    a239878_list = elemIndices 1 a240752_list
    -- Reinhard Zumkeller, Apr 12 2014
  • PARI
    isok(n) = (sumdigits(n^2) + 1) == sumdigits((n+1)^2); \\ Michel Marcus, Apr 06 2014
    
  • Python
    def digit_Sum(n):
       integerString = str(n)
       digit_Sum=0
       for digitLetter in integerString:
          digit_Sum = digit_Sum + int(digitLetter)
       return digit_Sum
    count = 0;
    for i in range(20000):
       if(digit_Sum(i*i) + 1 == digit_Sum((i+1)*(i+1))):
          count = count +1
          print(count,"   ",i)
    

Formula

A240752(a(n)) = 1. - Reinhard Zumkeller, Apr 12 2014

A240754 Numbers k with digit_sum(k*k) - 1 = digit_sum((k+1)*(k+1)).

Original entry on oeis.org

8, 26, 53, 98, 107, 143, 161, 170, 179, 188, 224, 233, 242, 260, 269, 278, 287, 296, 350, 368, 386, 404, 413, 431, 449, 476, 494, 503, 539, 548, 557, 584, 593, 629, 638, 647, 674, 683, 737, 746, 773, 791, 818, 827, 863, 872, 908, 926, 944, 998, 1007, 1043
Offset: 1

Views

Author

Reinhard Zumkeller, Apr 12 2014

Keywords

Comments

A240752(a(n)) = 0.

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndices)
    a240754 n = a240754_list !! (n-1)
    a240754_list = elemIndices (-1) a240752_list
    
  • Python
    def ds(n): return sum(map(int, str(n)))
    def ok(n): return ds(n*n) - 1 == ds((n+1)*(n+1))
    print(list(filter(ok, range(1044)))) # Michael S. Branicky, Aug 26 2021

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

Original entry on oeis.org

9, 13, 19, 31, 40, 46, 54, 63, 70, 81, 88, 97, 106, 112, 121, 130, 136, 148, 154, 162, 171, 180, 187, 193, 205, 211, 220, 229, 235, 244, 253, 262, 271, 277, 286, 297, 301, 310, 319, 331, 334, 343, 355, 360, 367, 378, 388, 396
Offset: 1

Views

Author

Zhining Yang, Apr 04 2024

Keywords

Comments

a(n) appears to be approximately equal to (33*n-11)/4.

Examples

			a(6) = 46 because 46 is the largest digital sum encountered among all 6-digit squares (698896, 779689, 877969).
		

Crossrefs

Programs

  • Mathematica
    Array[Max@Map[Total@IntegerDigits[#^2] &, Range[Floor@Sqrt[10^(#)]], Floor@Sqrt[10^(# + 1) - 1]] &, 15]

Extensions

a(22)-a(48) from Zhao Hui Du, Apr 05 2024
a(49)-a(62) from Zhining Yang, May 08 2024
a(63)-a(64) from Zhining Yang, May 23 2024
Incorrect a(61) and unverified a(49) onward deleted by Zhining Yang, Mar 03 2025

A062685 Smallest square with digit sum n (or 0 if no such square exists).

Original entry on oeis.org

1, 0, 0, 4, 0, 0, 16, 0, 9, 64, 0, 0, 49, 0, 0, 169, 0, 576, 289, 0, 0, 1849, 0, 0, 4489, 0, 3969, 17956, 0, 0, 6889, 0, 0, 27889, 0, 69696, 98596, 0, 0, 97969, 0, 0, 499849, 0, 1887876, 698896, 0, 0, 2778889, 0, 0, 4999696, 0, 9696996, 19998784, 0, 0
Offset: 1

Views

Author

Erich Friedman, Jul 04 2001

Keywords

Comments

a(n) > 0 iff n mod 9 is 0, 1, 4, or 7. - Jon E. Schoenfield, Jul 06 2018

Examples

			16 is the smallest square with digit sum 7, so a(7)=16.
		

Crossrefs

Programs

  • Mathematica
    Array[If[FreeQ[{1, 4, 7, 9}, FixedPoint[Total@ IntegerDigits@ # &, #]], 0, Block[{k = 1, s}, While[Total@ IntegerDigits@ Set[s, k^2] != #, k++]; s]] &, 57] (* Michael De Vlieger, Jul 06 2018 *)

A262711 Numbers k such that sum of digits of k^2 is 7.

Original entry on oeis.org

4, 5, 32, 40, 49, 50, 149, 320, 400, 490, 500, 1049, 1490, 3200, 4000, 4900, 5000, 10490, 14900, 32000, 40000, 49000, 50000, 104900, 149000, 320000, 400000, 490000, 500000, 1049000, 1490000, 3200000, 4000000, 4900000, 5000000, 10490000, 14900000
Offset: 1

Views

Author

Vincenzo Librandi, Sep 28 2015

Keywords

Comments

Subsequence of A156638. [Bruno Berselli, Sep 28 2015]

Examples

			4 is in sequence because 4^2 = 16 and 1+6 = 7.
		

Crossrefs

Cf. sum of digits of n^2 is k: A052216 (k=4), this sequence (k=7), A262712 (k=9), A262713 (k=10).
Cf. A215614.

Programs

  • Magma
    [n: n in [1..2*10^7] | &+Intseq(n^2) eq 7];
    
  • Mathematica
    Select[Range[10^7], Total[IntegerDigits[#^2]] == 7 &]
  • PARI
    for(n=1, 1e8, if (sumdigits(n^2) == 7, print1(n", "))) \\ Altug Alkan, Sep 28 2015

A336225 Table read by antidiagonals: T(n, k) = digitsum(n*k) with n >= 0 and k >= 0.

Original entry on oeis.org

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

Views

Author

Stefano Spezia, Jul 12 2020

Keywords

Examples

			The table T(n, k) begins
0   0   0   0   0   0   0   0 ...
0   1   2   3   4   5   6   7 ...
0   2   4   6   8   1   3   5 ...
0   3   6   9   3   6   9   3 ...
0   4   8   3   7   2   6  10 ...
0   5   1   6   2   7   3   8 ...
0   6   3   9   6   3   9   6 ...
0   7   5   3  10   8   6  13 ...
...
		

Crossrefs

Cf. A003991, A004092, A004159 (diagonal), A004164 (digitsum of n^3), A004247, A007953, A055565 (digitsum of n^4), A055566 (digitsum of n^5), A055567 (digitsum of n^6).

Programs

  • Mathematica
    T[n_,k_]:=Total[IntegerDigits[n*k]]; Table[T[n-k,k],{n,0,12},{k,0,n}]//Flatten
  • PARI
    T(n, k) = sumdigits(n*k);

Formula

T(n, k) = A007953(A004247(n, k)).
T(n, 1) = T(1, n) = A007953(n).
T(n, 2) = T(2, n) = A004092(n).
T(n, k) = A007953(A003991(n, k)) for n*k > 0. - Michel Marcus, Jul 13 2020.
Previous Showing 21-30 of 71 results. Next