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.

A323711 Numbers k such that k, 2*k, and 3*k are anagrams of each other.

Original entry on oeis.org

142857, 285714, 1402857, 1428570, 1428597, 1429857, 2857014, 2857140, 2859714, 2985714, 14002857, 14028570, 14028597, 14029857, 14285700, 14285970, 14285997, 14298570, 14298597, 14299857, 15623784, 15843762, 17438256, 17562438, 18243756, 21584376, 23784156, 24375618, 24381756
Offset: 1

Views

Author

Darrah Chavey, Jan 24 2019

Keywords

Comments

We assume entries have no leading zeros, so that n = 53617824 is not in the sequence, even though 2*n = 107235648 and 3*n = 160853472 are anagrams of 053617824.
From Chai Wah Wu, Feb 01 2019: (Start)
The first digit of terms is either 1, 2 or 3. Numbers of the form 140..028570..0 and 29..98570..0140..0 are terms where the number of 9's and 0's can be zero.
More generally, let a number n be written in decimal as xxxzzz where x and z are arbitrary digits and xxx, zzz are not empty strings. Let m be the number that is written as zzz in decimal and k be the least power of 10 that is strictly greater than m.
If 3*m < k, then n is a term if and only if xxx0..0zzz0..0 is a term. Note that this condition is satisfied if the first digit of m is 0, 1 or 2.
If 2*k <= 3*m, then n is a term if and only if xxx9..9zzz0..0 is a term. Note that this condition is satisfied if the first digit of m is 7, 8, or 9.
Not all terms with digits 0 and 9 are formed this way, see for instance the terms 137965842 and 157836042.
The first term where the first digit is 3 is a(1507) = 3051267489.
(End)
From David A. Corneth, Feb 02 2019: (Start)
Terms are multiples of 9.
Proof: as 3*k and k have the same digits, k is divisible by 3. If k isn't divisible by 9 then it has a different digital sum from 3*k. Therefore, k is divisible by 9. (End)

Examples

			The first entry, 142857, is well known for having n, 2*n, 3*n, 4*n, 5*n and 6*n all being anagrams. The next two numbers for which that happens are 1428570 and 1429857.
		

Crossrefs

Subsequence of A023086, numbers where n and 2*n are anagrams.

Programs

  • Java
    char[] digits1, digits2, digits3;
    int val1, val2, val3;
    for (int value=10; value<25000000; value++) {
         digits1 = Integer.toString(value).toCharArray();
         digits2 = Integer.toString(2*value).toCharArray();
         digits3 = Integer.toString(3*value).toCharArray();
         if (digits1.length == digits3.length) {
              Arrays.sort(digits1);
              Arrays.sort(digits2);
              Arrays.sort(digits3);
              val1 = Integer.parseInt(new String(digits1));
              val2 = Integer.parseInt(new String(digits2));
              val3 = Integer.parseInt(new String(digits3));
              if ((val1 == val2) && (val1 == val3)) {
                   System.out.print(value + ",");
              }
         }
    }
    
  • Python
    A323711_list = [n for n in range(9,10**7,9) if sorted(str(n)) == sorted(str(2*n)) == sorted(str(3*n))] # Chai Wah Wu, Feb 02 2019