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-8 of 8 results.

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

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

A248353 Kaprekar numbers, allowing powers of 10: n such that n=q+r and n^2=q*10^m+r, for some m >= 1, q>=0 and 0<=r<10^m.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Oct 05 2014

Keywords

Comments

Powers of 10 were excluded in Kaprekar's original definition (A006886), see also A045913.

Crossrefs

Cf. A006886 (subsequence), A045913, A053816, A011557, A102766.

Programs

  • Haskell
    a248353 n = a248353_list !! (n-1)
    a248353_list = filter k [1..] where
       k x = elem x $ map (uncurry (+)) $
             takeWhile ((> 0) . fst) $ map (divMod (x ^ 2)) a011557_list

Formula

a(n) = sqrt(A102766(n)).

A171493 "Kaprekar quadruples": digits of X^4 taken D at a time sum to X (where D is number of digits in X.)

Original entry on oeis.org

1, 7, 45, 55, 67, 100, 433, 4950, 5050, 38212, 65068, 190576, 295075, 299035, 310024, 336700, 343333, 394615, 414558, 433566, 448228, 450550, 467236, 475497, 476191, 486486, 499500, 500500, 523513, 534898, 549550, 599743, 622414, 628408, 647362
Offset: 1

Views

Author

Robert Munafo, Dec 10 2009

Keywords

Comments

Referred to as "natural" Kaprekar numbers on Munafo webpage because a(n) and the 4 pieces of a(n)^4 must all have the same number of digits (some of which can be leading zeros). Analogous to A053816 for squares, as opposed to A006886 and A045913 which allow irregular divisions.

Examples

			7^4 = 2401 ; 2+4+0+1 = 7. 67^4 = 20151121 ; 20+15+11+21 = 67. 4950^4 = 600372506250000 ; 0600+3725+0625+0000 = 4950.
		

Crossrefs

Extensions

Added term a(1)=1, Robert Gerbicz, Jul 28 2011

A380585 a(n) = floor(n^2 / 10^m) + (n^2 mod 10^m) where m is the number of decimal digits in n.

Original entry on oeis.org

0, 1, 4, 9, 7, 7, 9, 13, 10, 9, 1, 22, 45, 70, 97, 27, 58, 91, 27, 64, 4, 45, 88, 34, 81, 31, 82, 36, 91, 49, 9, 70, 34, 99, 67, 37, 108, 82, 58, 36, 16, 97, 81, 67, 55, 45, 37, 31, 27, 25, 25, 27, 31, 37, 45, 55, 67, 81, 97, 115, 36, 58, 82, 108, 136, 67, 99
Offset: 0

Views

Author

Giorgos Kalogeropoulos, Mar 27 2025

Keywords

Comments

The positive fixed points of this sequence are the Kaprekar numbers (A053816).
The sum of two halves of the decimal expansion of n^2 after having added a leading 0 if that number of digits is odd. - Michel Marcus, Mar 28 2025

Crossrefs

Cf. A053816 (fixed points), A055642, A344851, A358072 (similar plot).

Programs

  • Maple
    a:= n-> (k-> iquo(n^2, k)+(n^2 mod k))(10^length(n)):
    seq(a(n), n=0..66);  # Alois P. Heinz, Mar 27 2025
  • Mathematica
    Table[m=IntegerLength@n; Floor[n^2/10^m] + Mod[n^2,10^m], {n,0,66}]
  • PARI
    a(n) = my(d=digits(n^2)); if (#d % 2, d = concat(0, d)); my(m=#d/2); fromdigits(Vec(d,m)) + fromdigits(vector(#d-m, i, d[m+i])); /* Michel Marcus, Mar 28 2025 */
  • Python
    def a(n): return (nn:=n**2)//(M:=10**len(str(n))) + nn%M
    print([a(n) for n in range(0, 67)]) # Michael S. Branicky, Mar 27 2025
    

A171500 "Kaprekar quintuples": digits of X^5 taken D at a time sum to X (where D is number of digits in X.)

Original entry on oeis.org

1, 10, 1000, 7776, 27100, 73440, 95120, 500499, 505791, 540539, 598697, 665335, 697598, 732347, 7607610, 37944478, 46945205, 54995500, 55216205, 56607166, 58106906, 63136413, 66595563, 68167738, 68807564, 69188525, 70667477, 72197730, 73197730, 74145807
Offset: 1

Views

Author

Robert Munafo, Dec 10 2009

Keywords

Comments

Referred to as "natural" Kaprekar numbers on Munafo webpage because a(n) and the 5 pieces of a(n)^5 must all have the same number of digits (some of which can be leading zeros). Analogous to A053816 for squares, as opposed to A006886 and A045913 which allow irregular divisions.

Examples

			7776^5 = 28430288029929701376 ; 2843+0288+0299+2970+1376 = 7776.
27100^5 = 14616603103510000000000 ; 146+16603+10351+00000+00000 = 27100.
		

Crossrefs

Extensions

More terms from Robert Gerbicz, Jul 28 2011

A259316 Numbers n such that the result of n multiplied by the reversal of n can be split into two numbers a and b of equal length (if the length is odd a leading zero is allowed), where a + b equals n (b can also have a leading zero).

Original entry on oeis.org

1, 9, 54, 55, 99, 999, 2727, 3222, 7777, 8272, 9999, 12466, 22222, 25912, 39114, 75880, 87777, 87804, 93357, 99999, 124660, 142857, 181818, 185185, 189189, 230769, 231868, 324675, 390313, 412587, 428274, 443926, 503866, 513513, 533169, 568468
Offset: 1

Views

Author

Pieter Post, Jun 24 2015

Keywords

Comments

All rep'n'-digits have infinite subsequence, except the rep'n'-digits 3 (mod 9) and 6 (mod 9).
For 'n' is 1, we have the Kaprekar numbers (A145875), the repdigit numbers.
If length is 1 (mod 9), repdigit 1 is part of the sequence, 1111111111*1111111111 = 1234567900987654321 => 123456790 + 987654321 = 1111111111.
If length is 2 (mod 9), repdigit 5 is part of the sequence, 55555555555*55555555555 = 3086419753024691358025 => 30864197530 + 24691358025 = 5555555555.
If length is 4 (mod 9), repdigit 7 is part of the sequence, 7777 * 7777 = 60481729 => 6048 + 1729 = 7777.
If length is 5 (mod 9), repdigit 2 is part of the sequence.
If length is 7 (mod 9), repdigit 4 is part of the sequence.
If length is 8 (mod 9), repdigit 8 is part of the sequence.
Repdigit 9 is part of this sequence in every length.
For 'n' is 2, we have numbers where two digits are repeated, like 52525252.
The rep2-digits which are divisible by 9 have the following infinite subsequences:
If length is 2 (mod 22), rep2-digit 54 is a part of this sequence, 545454545454545454545454 * 454545454545454545454545 = 247933884297520661157024297520661157024793388430 => 247933884297520661157024 + 297520661157024793388430 = 545454545454545454545454
If length is 4 (mod 22), rep2-digit 27 is a part of this sequence.
If length is 6 (mod 22), rep2-digit 18 is a part of this sequence.
If length is 8 (mod 22), rep2-digit 63 is a part of this sequence.
If length is 10 (mod 22), rep2-digit 90 is a part of this sequence.
If length is 14 (mod 22), rep2-digit 36 is a part of this sequence.
If length is 16 (mod 22), rep2-digit 81 is a part of this sequence.
If length is 18 (mod 22), rep2-digit 72 is a part of this sequence.
If length is 20 (mod 22), rep2-digit 45 is a part of this sequence.
Other rep2-digits also have infinite subsequences with length l (mod 198).
Example: rep2-digit 52 has length 8: 52525252 * 25252525 = 1326395239261300 => 13263952 + 39261300 = 52525252, the next length is 206.

Examples

			124660 is a term. Indeed 124660*66421 = 8280041860 and 82800 + 41860 = 124660.
		

Crossrefs

Programs

  • Mathematica
    fQ[n_] := Block[{c, d, len}, c = n FromDigits@ Reverse@ IntegerDigits@ n; d = IntegerDigits@ c; len = Length@ d; If[OddQ@ len, d = PadLeft[d, len + 1]; len++]; n == FromDigits@ Take[d, len/2] + FromDigits@ Take[d, -len/2]]; Select[Range@ 1000000, fQ] (* Michael De Vlieger, Jul 20 2015 *)
  • Python
    def sod(n,m):
        kk = 0
        while n > 0:
            kk= kk+(n%m)
            n =int(n//m)
        return kk
    uu=1
    for a in range (1,9):
        for n in range (10**(a-1)+1, 10**a):
            y=int(str(n)[::-1])
            ll=int(len(str(n*y))/2+0.5)
            u=sod(n*y,10**ll)
            if n==u:
                print (n)
    
  • Python
    # for rep2-digit
    for f in range (12,98):
        aa=1
        for i in range(1,200):
            aa=10**(2*i)+aa
            c=f*aa
            cc=str(c*int(str(c)[::-1]))
            l=int(len(cc)/2)
            cc1,cc2=int(cc[0:l]),int(cc[l:2*l+1])
            if c==cc1+cc2:
                print (c)

Extensions

Missing a(21) from Giovanni Resta, Jul 19 2015

A380714 a(n) = n*(n-1) mod (10^m-1) where m is the number of decimal digits in n.

Original entry on oeis.org

0, 2, 6, 3, 2, 3, 6, 2, 0, 90, 11, 33, 57, 83, 12, 42, 74, 9, 45, 83, 24, 66, 11, 57, 6, 56, 9, 63, 20, 78, 39, 2, 66, 33, 2, 72, 45, 20, 96, 75, 56, 39, 24, 11, 0, 90, 83, 78, 75, 74, 75, 78, 83, 90, 0, 11, 24, 39, 56, 75, 96, 20, 45, 72, 2, 33, 66
Offset: 1

Views

Author

Giorgos Kalogeropoulos, Mar 27 2025

Keywords

Comments

a(n) = 0 if and only if n is a Kaprekar number (A053816).

Crossrefs

Programs

  • Maple
    a:= n-> n*(n-1) mod (10^length(n)-1):
    seq(a(n), n=1..67);  # Alois P. Heinz, Mar 27 2025
  • Mathematica
    Table[Mod[n(n-1), 10^IntegerLength@n - 1], {n,67}]
  • Python
    def a(n): return n*(n-1)%(10**len(str(n))-1)
    print([a(n) for n in range(1, 68)]) # Michael S. Branicky, Mar 27 2025

Formula

a(n) = A002378(n-1) mod A002283(A055642(n)).
Showing 1-8 of 8 results.