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.

A006886 Kaprekar numbers: positive numbers n such that n = q+r and n^2 = q*10^m+r, for some m >= 1, q >= 0 and 0 <= r < 10^m, with n != 10^a, a >= 1.

Original entry on oeis.org

1, 9, 45, 55, 99, 297, 703, 999, 2223, 2728, 4879, 4950, 5050, 5292, 7272, 7777, 9999, 17344, 22222, 38962, 77778, 82656, 95121, 99999, 142857, 148149, 181819, 187110, 208495, 318682, 329967, 351352, 356643, 390313, 461539, 466830, 499500, 500500, 533170
Offset: 1

Views

Author

Keywords

Comments

4879 and 5292 are in this sequence but not in A053816.
Digital root is either 1 or 9. - Ezhilarasu Velayutham, Jul 27 2019
Named after the Indian recreational mathematician Dattatreya Ramchandra Kaprekar (1905-1986). - Amiram Eldar, Jun 19 2021
The term a(11) = 4879 is the first not in subsequence A053816. - M. F. Hasler, Mar 28 2025

Examples

			703 is a Kaprekar number because 703 = 494 + 209, 703^2 = 494209.
		

References

  • D. R. Kaprekar, On Kaprekar numbers, J. Rec. Math., Vol. 13 (1980-1981), pp. 81-82.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • David Wells, The Penguin Dictionary of Curious and Interesting Numbers, Penguin Books, NY, 1986, p. 151.

Crossrefs

See A053816 for another version.
Cf. A193992 (where 10^n-1 occurs in A006886), A194232 (first differences).
Subsequence of A248353.

Programs

  • Haskell
    -- See A194218 for another version
    a006886 n = a006886_list !! (n-1)
    a006886_list = 1 : filter chi [4..] where
       chi n = read (reverse us) + read (reverse vs) == n where
           (us,vs) = splitAt (length $ show n) (reverse $ show (n^2))
    -- Reinhard Zumkeller, Aug 18 2011
    
  • Mathematica
    (* This Mathematica code computes five additional powers in order to be sure that all the Kaprekar numbers have been computed. This fix works for mx <= 50, which includes terms computed by Gerbicz. *)
    Inv[a_, b_] := PowerMod[a, -1, b]; mx = 20; t = {1}; Do[h = 10^k - 1; d = Divisors[h]; d2 = Select[d, GCD[#, h/#] == 1 &]; If[Log[10, h] < mx, AppendTo[t, h]]; Do[q = d2[[i]]*Inv[d2[[i]], h/d2[[i]]]; If[Log[10, q] < mx, AppendTo[t, q]], {i, 2, Length[d2] - 1}], {k, mx + 5}]; t = Union[t] (* T. D. Noe, Aug 17 2011, Aug 18 2011 *)
    kaprQ[\[Nu]_] := Module[{n = \[Nu]^2},
      MemberQ[Plus @@ # & /@
        Select[Table[{Floor[n/10^j], 10^j*FractionalPart[n/10^j]}, {j,
           IntegerLength@n - 1}], #[[2]] != 0 &], \[Nu]]];
    Select[Range@1000000, kaprQ] (* Hans Rudolf Widmer, Oct 22 2021 *)
  • PARI
    select( {is_A006886(n)=my(N=n^2,m=1);while(N>m*=10,n==N%m+N\m && m!=n && return(m));n==1}, [1..10^5]) \\ M. F. Hasler, Mar 28 2025
    
  • Python
    def is_A006886(n):
        m=1; return (N:=n**2)and any(n==sum(divmod(N,m:=m*10))!=m for _ in str(N))
    print(upto_1e5 := [n for n in range(10**5)if is_A006886(n)]) # M. F. Hasler, Mar 28 2025

Formula

a(n) = A194218(n) + A194219(n) and A194218(n) concatenated with A194219(n) gives a(n)^2. - Reinhard Zumkeller, Aug 19 2011

Extensions

More terms from Michel ten Voorde, Apr 11 2001
4879 and 5292 added by Larry Reeves (larryr(AT)acm.org), Apr 24 2001
38962 added by Larry Reeves (larryr(AT)acm.org), May 23 2002

A102766 Numbers n that can be chopped into two parts, which when added and squared result in n.

Original entry on oeis.org

1, 81, 100, 2025, 3025, 9801, 10000, 88209, 494209, 998001, 1000000, 4941729, 7441984, 23804641, 24502500, 25502500, 28005264, 52881984, 60481729, 99980001, 100000000, 300814336, 493817284, 1518037444, 6049417284, 6832014336, 9048004641, 9999800001, 10000000000
Offset: 1

Views

Author

Bodo Zinser, Feb 10 2005

Keywords

Examples

			a(7) = 88209 is a term as (88+209)^2 = 297^2 = 88209.
		

Crossrefs

Supersequence of A238237.

Programs

  • Python
    from math import isqrt
    from itertools import count, islice
    def ok(n):
        if n == 1: return True
        r = isqrt(n)
        if r**2 != n: return False
        s = str(n)
        return any(int(s[:i])+int(s[i:])== r for i in range(1, len(s)))
    def agen(): yield from (k**2 for k in count(1) if ok(k**2))
    print(list(islice(agen(), 29))) # Michael S. Branicky, Dec 29 2024

Formula

a(n) = A248353(n)^2.

Extensions

a(1)=1 prepended by Max Alekseyev, Aug 04 2017
a(27) and beyond from Michael S. Branicky, Dec 29 2024

A045913 Kaprekar numbers: numbers k such that k = q + r and k^2 = q*10^m + r, for some m >= 1, q >= 0 and 0 <= r < 10^m. Here q and r must both have the same number of digits.

Original entry on oeis.org

1, 9, 45, 55, 703, 4950, 5050, 7272, 7777, 77778, 82656, 318682, 329967, 351352, 356643, 390313, 461539, 466830, 499500, 500500, 533170, 538461, 609687, 643357, 648648, 670033, 681318, 791505, 812890, 818181, 851851, 857143, 4444444, 4927941, 5072059, 5555556, 11111112, 36363636, 38883889, 44363341, 44525548, 49995000, 50005000
Offset: 1

Views

Author

Keywords

Comments

A variant of Kaprekar's original definition (A006886).

Examples

			703 is Kaprekar because 703 = 494 + 209, 703^2 = 494209.
11111112^2 = 123456809876544 = (1234568 + 9876544)^2. The two "halves" of the square have the same length here, although it's not m but rather m - 1.
		

References

  • D. R. Kaprekar, On Kaprekar numbers, J. Rec. Math., 13 (1980-1981), 81-82.
  • D. Wells, The Penguin Dictionary of Curious and Interesting Numbers, Penguin Books, NY, 1986, p. 151.

Crossrefs

Extensions

More terms from Michel ten Voorde, Apr 13 2001
Definition clarified by Reinhard Zumkeller, Oct 05 2014
Definition modified and terms corrected by Max Alekseyev, Aug 06 2017

A328173 Numbers k such that decimal expansion of k^2 can be split into two parts whose sum is a number with repeated digits.

Original entry on oeis.org

4, 5, 6, 9, 10, 11, 20, 22, 30, 33, 44, 55, 57, 66, 77, 99, 100, 111, 159, 171, 200, 222, 300, 333, 444, 555, 666, 704, 889, 999, 1000, 1111, 1149, 1578, 1755, 2000, 2025, 2222, 2618, 3000, 3111, 3333, 6666, 7777, 9999, 10000, 11111, 20000, 22222, 22568, 22972, 30000, 30297, 33333
Offset: 1

Views

Author

Seiichi Manyama, Oct 06 2019

Keywords

Examples

			   4^2 =   16,   1 +  6 =   7.
   5^2 =   25,   2 +  5 =   7.
   6^2 =   36,   3 +  6 =   9.
   9^2 =   81,   8 +  1 =   9.
  10^2 =  100,   1 +  0 =   1.
  11^2 =  121,   1 + 21 =  22.
  20^2 =  400,   4 +  0 =   4.
  22^2 =  484,   4 + 84 =  88.
  30^2 =  900,   9 +  0 =   9.
  33^2 = 1089,  10 + 89 =  99.
  44^2 = 1936,  19 + 36 =  55.
  55^2 = 3025,  30 + 25 =  55.
  57^2 = 3249, 324 +  9 = 333.
  66^2 = 4356,  43 + 56 =  99.
  77^2 = 5929,  59 + 29 =  88.
  99^2 = 9801,  98 +  1 =  99.
		

Crossrefs

Programs

  • Ruby
    def A(str)
      (0..str.size - 2).any?{|i| (str[0..i].to_i + str[i + 1..-1].to_i).to_s.split('').uniq.size == 1}
    end
    p (0..10 ** 4).select{|i| A((i * i).to_s)}
Showing 1-4 of 4 results.