login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A023086 Numbers k such that k and 2*k are anagrams. 17

%I #43 May 22 2021 15:31:50

%S 0,125874,128574,142587,142857,258714,258741,285714,285741,412587,

%T 412857,425871,428571,1025874,1028574,1042587,1042857,1052874,1054287,

%U 1072854,1074285,1078524,1078542,1085274,1085427,1087254,1087425,1087524,1087542

%N Numbers k such that k and 2*k are anagrams.

%C All terms are divisible by 9. - _Eric M. Schmidt_, Jul 12 2014

%C If x and y are in the sequence, then so is 10^m*x + y if y < 10^m. - _Robert Israel_, Mar 20 2017

%C From _Petros Hadjicostas_, Jul 29 2020: (Start)

%C This is Schuh's (1968) "doubles puzzle" (the double of k is 2*k). On five pages of his book, he finds the twelve 6-digit numbers that belong to this sequence (a(2) to a(13)) and the 288 7-digit numbers of the sequence (a(14) to a(301)).

%C All numbers in this sequence are permutations of numbers that are combinations of numbers from A336670, which is related to another puzzle of Schuh (1968). Before he solved this puzzle, he had to solve the puzzle described in A336670.

%C For example, a(2) = 125874 through a(13) = 428571 are all permutations of the number 512874, which is a combination of the numbers 512 and 874 that appear in A336670. (End)

%D Fred Schuh, The Master Book of Mathematical Recreations, Dover, New York, 1968, pp. 31-35.

%H David W. Wilson, <a href="/A023086/b023086.txt">Table of n, a(n) for n = 1..10001</a>

%H Mark Dominus, <a href="http://blog.plover.com/math/dd.html">When do n and 2n have the same digits?</a>

%p Res:= 0:

%p for d from 1 to 7 do

%p for n from 10^(d-1)+8 to 5*10^(d-1)-1 by 9 do

%p if sort(convert(n,base,10)) = sort(convert(2*n,base,10)) then

%p Res:= Res, n

%p fi

%p od od:

%p Res; # _Robert Israel_, Mar 20 2017

%t si[n_] := Sort@ IntegerDigits@ n; Flatten@ {0, Table[ Select[ Range[ 10^e+8, 5*10^e-1, 9], si[#] == si[2 #] &], {e, 6}]} (* _Giovanni Resta_, Mar 20 2017 *)

%o (Python)

%o def ok(n): return sorted(str(n)) == sorted(str(2*n))

%o print(list(filter(ok, range(1087543)))) # _Michael S. Branicky_, May 21 2021

%o (Python) # use with ok above for larger terms

%o def auptod(maxd):

%o return [0] + list(filter(ok, (n for d in range(2, maxd+1) for n in range(10**(d-1)-1, 5*10**(d-1), 9))))

%o print(auptod(7)) # _Michael S. Branicky_, May 22 2021

%Y Cf. A023087, A023088, A023089, A023090, A023091, A023092, A023093, A336670.

%K nonn,base

%O 1,2

%A _David W. Wilson_

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 29 09:59 EDT 2024. Contains 371268 sequences. (Running on oeis4.)