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 33 results. Next

A053816 Another version of the Kaprekar numbers (A006886): 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 and n an m-digit number.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Consider an m-digit number n. Square it and add the right m digits to the left m or m-1 digits. If the resultant sum is n, then n is a term of the sequence.
4879 and 5292 are in A006886 but not in this version.
Shape of plot (see links) seems to consist of line segments whose lengths along the x-axis depend on the number of unitary divisors of 10^m-1 which is equal to 2^w if m is a multiple of 3 or 2^(w+1) otherwise, where w is the number of distinct prime factors of the repunit of length m (A095370). w for m = 60 is 20, whereas w <= 15 for m < 60. This leads to the long segment corresponding to m = 60. - Chai Wah Wu, Jun 02 2016
If n*(n-1) is divisible by 10^m-1 then n is a term where m is the number of decimal digits in n. - Giorgos Kalogeropoulos, Mar 27 2025

Examples

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

References

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

Crossrefs

Programs

  • Haskell
    a053816 n = a053816_list !! (n-1)
    a053816_list = 1 : filter f [4..] where
       f x = length us - length vs <= 1 &&
             read (reverse us) + read (reverse vs) == x
             where (us, vs) = splitAt (length $ show x) (reverse $ show (x^2))
    -- Reinhard Zumkeller, Oct 04 2014
    
  • Mathematica
    kapQ[n_]:=Module[{idn2=IntegerDigits[n^2],len},len=Length[idn2];FromDigits[ Take[idn2,Floor[len/2]]]+FromDigits[Take[idn2, -Ceiling[len/2]]]==n]; Select[Range[540000],kapQ] (* Harvey P. Dale, Aug 22 2011 *)
    ktQ[n_] := ((x = n^2) - (z = FromDigits[Take[IntegerDigits[x], y = -IntegerLength[n]]]))*10^y + z == n; Select[Range[540000], ktQ] (* Jayanta Basu, Aug 04 2013 *)
    Select[Range[540000],Total[FromDigits/@TakeDrop[IntegerDigits[#^2], Floor[ IntegerLength[ #^2]/2]]] ==#&] (* The program uses the TakeDrop function from Mathematica version 10 *) (* Harvey P. Dale, Jun 03 2016 *)
    maxDigits=6; Flatten[Table[lst={};sub=Subsets@FactorInteger[v=10^d-1]; Do[a=Times@@Power@@@s; n=ChineseRemainder[{0,1},{a,v/a},1]; If[10^(d-1)<=n<10^d,AppendTo[lst,n]],{s,sub}];Union@lst,{d,maxDigits}]] (* Giorgos Kalogeropoulos, Mar 27 2025 *)
  • PARI
    isok(n) = n == vecsum(divrem(n^2, 10^(1+logint(n, 10)))); \\ Ruud H.G. van Tol, Jun 02 2024
    
  • Python
    def is_A053816(n): return n==sum(divmod(n**2,10**len(str(n)))) and n
    print(upto_1e5:=list(filter(is_A053816, range(10**5)))) # M. F. Hasler, Mar 28 2025

Extensions

More terms from Michel ten Voorde, Apr 11 2001

A193992 Position where 10^n-1 occurs in the Kaprekar sequence A006886.

Original entry on oeis.org

2, 5, 8, 17, 24, 54, 62, 91, 102, 132, 149, 264, 281, 316, 385, 503, 527, 762, 790, 1035, 1154, 1278, 1378, 2304, 2374, 2498, 2575, 3122, 3910, 11330, 11714, 15400, 15478, 15642, 16039, 17892, 17909, 17968, 18401, 22238, 23747, 38524, 38728, 40625, 41101
Offset: 1

Views

Author

T. D. Noe, Aug 17 2011

Keywords

Comments

Partial sums of A194232.
The Mathematica code computes 50 terms, but only these 45 terms are correct.

Crossrefs

Programs

  • Mathematica
    Inv[a_, b_] := PowerMod[a, -1, b]; t = {1}; Do[h = 10^k-1; d = Divisors[h]; d2 = Select[d, GCD[#, h/#] == 1 &]; AppendTo[t, h]; Do[AppendTo[t, d2[[i]]*Inv[d2[[i]], h/d2[[i]]]], {i, 2, Length[d2]-1}], {k, 50}]; t = Union[t]; Table[Position[t, 10^n-1, 1, 1][[1,1]], {n, Log[10, t[[-1]]]}]

A194232 Number of n-digit Kaprekar numbers (A006886).

Original entry on oeis.org

2, 3, 3, 9, 7, 30, 8, 29, 11, 30, 17, 115, 17, 35, 69, 118, 24, 235, 28, 245, 119, 124, 100, 926, 70, 124, 77, 547, 788, 7420, 384, 3686, 78, 164, 397, 1853, 17, 59, 433, 3837, 1509, 14777, 204, 1897, 476, 185, 748, 7390, 213, 1877, 320, 963, 421, 3812, 1190
Offset: 1

Views

Author

Hans Havermann, Aug 19 2011

Keywords

Comments

First difference of A193992. - Hans Havermann, Aug 19 2011

Crossrefs

A382160 Kaprekar numbers according to the definition in A006886 that are not in A053816.

Original entry on oeis.org

4879, 5292, 38962, 627615, 5479453, 8161912, 243902440, 665188470, 867208672, 909090909, 2646002646, 7359343993, 8975672343, 19481019481, 65098401732, 71428071429, 74074074075, 74761738129, 81433418067, 81933418567, 90909090910, 93555093555, 98268434902, 218400870420
Offset: 1

Views

Author

N. J. A. Sloane, Mar 25 2025

Keywords

Crossrefs

Extensions

More terms from Amiram Eldar, Mar 26 2025

A382165 Kaprekar numbers (A006886) that are divisible by the sum of their digits.

Original entry on oeis.org

1, 9, 45, 999, 2223, 4950, 5050, 5292, 7272, 142857, 148149, 187110, 356643, 466830, 499500, 500500, 538461, 627615, 648648, 681318, 791505, 818181, 961038, 994708, 5555556, 11111112, 16590564, 30884184, 36363636, 49995000, 50005000, 55474452, 74747475, 234567901, 432432432, 665188470, 999999999, 2020202020, 3846956652, 4132841328, 4999950000, 5000050000
Offset: 1

Views

Author

N. J. A. Sloane, Mar 26 2025

Keywords

Crossrefs

Intersection of A005349 and A006886.

A164704 A006886 mod 9.

Original entry on oeis.org

1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1
Offset: 1

Views

Author

Paul Curtz, Aug 23 2009

Keywords

Comments

The definition implies that if m is A006886(n) for some n, then m == m^2 mod 9, hence m == 0 or 1 mod 9, as conjectured by Paul Curtz. - N. J. A. Sloane, Aug 23 2009

Extensions

Edited and extended by N. J. A. Sloane, Aug 23 2009

A003052 Self numbers or Colombian numbers (numbers that are not of the form m + sum of digits of m for any m).

Original entry on oeis.org

1, 3, 5, 7, 9, 20, 31, 42, 53, 64, 75, 86, 97, 108, 110, 121, 132, 143, 154, 165, 176, 187, 198, 209, 211, 222, 233, 244, 255, 266, 277, 288, 299, 310, 312, 323, 334, 345, 356, 367, 378, 389, 400, 411, 413, 424, 435, 446, 457, 468, 479, 490, 501, 512, 514, 525
Offset: 1

Views

Author

Keywords

Comments

From Amiram Eldar, Nov 28 2020: (Start)
The term "self numbers" was coined by Kaprekar (1959). The term "Colombian number" was coined by Recamán (1973) of Bogota, Colombia.
The asymptotic density of this sequence is approximately 0.0977778 (Guaraldo, 1978). (End)

References

  • Steven R. Finch, Mathematical Constants, Cambridge, 2003, Section 2.24.
  • Martin Gardner, Time Travel and Other Mathematical Bewilderments. Freeman, NY, 1988, p. 116.
  • V. S. Joshi, A note on self-numbers. Volume dedicated to the memory of V. Ramaswami Aiyar. Math. Student, Vol. 39 (1971), pp. 327-328. MR0330032 (48 #8371).
  • D. R. Kaprekar, Puzzles of the Self-Numbers. 311 Devlali Camp, Devlali, India, 1959.
  • D. R. Kaprekar, The Mathematics of the New Self Numbers, Privately Printed, 311 Devlali Camp, Devlali, India, 1963.
  • D. R. Kaprekar, The Mathematics of the New Self Numbers (Part V). 311 Devlali Camp, Devlali, India, 1967.
  • Bernardo Recamán, The Bogota Puzzles, Dover Publications, Inc., 2020, chapter 36, p. 33.
  • József Sándor and Borislav Crstici, Handbook of Number theory II, Kluwer Academic Publishers, 2004, Chapter 4, pp. 384-386.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • Author?, J. Recreational Math., vol. 23, no. 1, p. 244, 1991.

Crossrefs

For self primes, i.e., self numbers which are primes, see A006378.
Complement of A176995.
See A010061 for the binary version, A283002 for a base-100 version.
Cf. A247104 (subsequence of squarefree terms).
Cf. A377472 for first differences, A377474 for indices where new differences appear.

Programs

  • Haskell
    a003052 n = a003052_list !! (n-1)
    a003052_list = filter ((== 0) . a230093) [1..]
    -- Reinhard Zumkeller, Oct 11 2013, Aug 21 2011
  • Maple
    isA003052 := proc(n) local k ; for k from 0 to n do if k+A007953(k) = n then RETURN(false): fi; od: RETURN(true) ; end:
    A003052 := proc(n) option remember; if n = 1 then 1; else for a from procname(n-1)+1 do if isA003052(a) then RETURN(a) ; fi; od; fi; end: # R. J. Mathar, Jul 27 2009
  • Mathematica
    nn = 525; Complement[Range[nn], Union[Table[n + Total[IntegerDigits[n]], {n, nn}]]] (* T. D. Noe, Mar 31 2013 *)
  • PARI
    is_A003052(n)={for(i=1,min(n\2,9*#digits(n)), sumdigits(n-i)==i && return); n}  \\ M. F. Hasler, Mar 20 2011, updated Nov 08 2018
    
  • PARI
    is(n) = {if(n < 30, return((n < 10 && n%2 == 1) || n == 20)); qd = 1 + logint(n, 10); r = 1 + (n-1)%9; h = (r + 9 * (r%2))/2; ld = 10; while(h + 9*qd >= n % ld, ld*=10); vs = vecsum(digits(n \ ld)); n %= ld; for(i = 0, qd, if(vs + vecsum(digits(n - h - 9*i)) == h + 9*i, return(0))); 1} \\ David A. Corneth, Aug 20 2020
    

Formula

A230093(a(n)) = 0. - Reinhard Zumkeller, Oct 11 2013
In fact this defines the sequence: x is in the sequence iff A230093(x) = 0. - M. F. Hasler, Nov 08 2018

Extensions

More terms from James Sellers, Jul 06 2000

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

A238237 Numbers which when chopped into two parts with equal length, added and squared result in the same number.

Original entry on oeis.org

81, 2025, 3025, 9801, 494209, 998001, 24502500, 25502500, 52881984, 60481729, 99980001, 6049417284, 6832014336, 9048004641, 9999800001, 101558217124, 108878221089, 123448227904, 127194229449, 152344237969, 213018248521, 217930248900, 249500250000, 250500250000
Offset: 1

Views

Author

Arkadiusz Wesolowski, Feb 20 2014

Keywords

Comments

Yet another variant of the Kaprekar numbers A006886. - N. J. A. Sloane, Aug 06 2017
From Bernard Schott, Jan 21 2022: (Start)
Three subsequences:
-> {(10^m-1)^2, m >= 1} = A059988 \ {0}; see example 9801.
-> {(10^m-1)^2 * 10^(2*m) / 4, m >= 1} = A350869 \ {0}; see example 2025.
-> {(10^m+1)^2 * 10^(2*m) / 4, m >= 1} = A038544 \ {1}, see example 3025. (End)

Examples

			2025 = (20 + 25)^2, so 2025 is in the sequence.
3025 = (30 + 25)^2, so 3025 is in the sequence.
9801 = (98 + 01)^2, so 9801 is in the sequence.
		

Crossrefs

Subsequence of A102766.
Subsequence: A350870.
For square roots see A290449.

Programs

  • Mathematica
    Select[Range[600000]^2, EvenQ[len=IntegerLength[#]] && # == (Mod[#,10^(len/2)] + Floor[#/10^(len/2)])^2 &] (* Stefano Spezia, Jan 01 2025 *)
  • PARI
    forstep(m=1, 7, 2, p=10^((m+1)/2); for(n=10^m, 10^(m+1)-1, d=lift(Mod(n, p)); if(((n-d)/p+d)^2==n, print1(n, ", "))));

Formula

a(n) = A290449(n)^2. - Bernard Schott, Jan 20 2022

Extensions

a(12)-a(24) from Donovan Johnson, Feb 22 2014

A053394 The full list of 3-Kaprekar numbers.

Original entry on oeis.org

1, 297, 703, 999
Offset: 1

Views

Author

N. J. A. Sloane, Jan 07 2000

Keywords

Crossrefs

Showing 1-10 of 33 results. Next