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

A163205 The non-repetitive Kaprekar binary numbers in decimal.

Original entry on oeis.org

0, 9, 21, 45, 49, 93, 105, 189, 217, 225, 381, 441, 465, 765, 889, 945, 961, 1533, 1785, 1905, 1953, 3069, 3577, 3825, 3937, 3969, 6141, 7161, 7665, 7905, 8001, 12285, 14329, 15345, 15841, 16065, 16129, 24573, 28665, 30705, 31713, 32193, 32385
Offset: 1

Views

Author

Damir Olejar, Jul 23 2009

Keywords

Comments

Same as A160761, but with no repetitions. The numbers also exist in A143088, except that every first and last number is omitted from A143088's pyramid.
From Joseph Myers, Aug 29 2009: (Start)
Note that all base-2 cycles are fixed points.
Initial terms in base 2: 0, 1001, 10101, 101101, 110001, 1011101, 1101001, 10111101, 11011001, 11100001. (End)

Examples

			The number 9 is 1001 in binary. The maximum number using the same number of 0's and 1's is found and the minimum number having the same number of 0's and 1's is found to obtain the equation such as 1100 - 0011 = 1001. Repeating the same procedure gives us the same number and pattern of 0's and 1's. Therefore 9 is one of the Kaprekar numbers. If 9 did not occur before, it is counted as a number that belongs to a sequence and added to a database to skip repetitions. Numbers that end the procedure in 0 are excluded since they are not Kaprekar numbers. A number 9 can also be obtained with, let's say, 1100. Since number 9 already occurred for 1001, the number 9 occurring for 1100 is ignored to avoid repetition.
		

References

  • M. Charosh, Some Applications of Casting Out 999...'s, Journal of Recreational Mathematics 14, 1981-82, pp. 111-118.
  • D. R. Kaprekar, On Kaprekar numbers, J. Rec. Math., 13 (1980-1981), pp. 81-82.

Crossrefs

In other bases: A164997 (base 3), A165016 (base 4), A165036 (base 5), A165055 (base 6), A165075 (base 7), A165094 (base 8), A165114 (base 9), A099009 (base 10).

Programs

  • Java
    import java.util.*; class pattern { public static void main(String args[]) { int mem1 = 0; int mem2 =1; ArrayList memory = new ArrayList(); for (int i = 1; i
    				
  • Mathematica
    nmax = 10^5; f[n_] := Module[{id, sid, min, max}, id = IntegerDigits[n, 2]; min = FromDigits[sid = Sort[id], 2]; max = FromDigits[Reverse[sid], 2]; max - min]; Reap[Do[If[(fpn = FixedPoint[f, n]) > 0, Sow[fpn]], {n, 0, nmax}]][[2, 1]] // Union // Prepend[#, 0]& (* Jean-François Alcover, Apr 23 2017 *)

Formula

1. Sort all integers from the number in descending order.
2. Sort all integers from the number in ascending order.
3. Subtract ascending from descending order to obtain a new number.
4. Repeat the steps 1-3 with a new number until a repetitive sequence is obtained or until a zero is obtained.
5. Call the repetitive sequence's number a Kaprekar number, ignore zeros and repetitions from the set of the final results.

Extensions

Initial zero added for consistency with other bases by Joseph Myers, Aug 29 2009

A378935 Array read by antidiagonals: T(m,n) is the number of minimal edge cuts in the rook graph K_m X K_n.

Original entry on oeis.org

0, 1, 1, 3, 6, 3, 7, 22, 22, 7, 15, 84, 150, 84, 15, 31, 346, 1276, 1276, 346, 31, 63, 1476, 11538, 23214, 11538, 1476, 63, 127, 6322, 102772, 418912, 418912, 102772, 6322, 127, 255, 26844, 890130, 7290534, 14673870, 7290534, 890130, 26844, 255, 511, 112666, 7525876, 123174016, 496484776, 496484776, 123174016, 7525876, 112666, 511
Offset: 1

Views

Author

Andrew Howroyd, Dec 12 2024

Keywords

Examples

			Array begins:
======================================================
m\n |  1    2      3       4         5           6 ...
----+-------------------------------------------------
  1 |  0    1      3       7        15          31 ...
  2 |  1    6     22      84       346        1476 ...
  3 |  3   22    150    1276     11538      102772 ...
  4 |  7   84   1276   23214    418912     7290534 ...
  5 | 15  346  11538  418912  14673870   496484776 ...
  6 | 31 1476 102772 7290534 496484776 32893769886 ...
  ...
		

Crossrefs

Main diagonal is A378936.
Rows 1..2 are A000225(n-1), A378937.

Programs

  • PARI
    \\ Needs G from A360873.
    T(M,N=M) = {G(M,N) + matrix(M,N,m,n, (2^(m-1) - 1)*(2^(n-1) - 1) - 2^(m*n-1))}
    { my(A=T(7)); for(n=1, #A~, print(A[n,])) }

Formula

T(m,n) = A360873(m,n) + (2^(m-1) - 1)*(2^(n-1) - 1) - 2^(m*n-1).
T(m,n) = T(n,m).
Showing 1-2 of 2 results.