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.

A373177 Integers k such that 2k + 1 and 4k + 3 are anagrams of k.

This page as a plain text file.
%I A373177 #21 May 28 2024 18:28:07
%S A373177 15632,126530,130265,150632,152630,156329,162530,163025,1265030,
%T A373177 1265300,1265309,1300265,1302650,1302659,1500632,1502630,1506329,
%U A373177 1526300,1526309,1563299,1566332,1625030,1625300,1625309,1630025,1630250,1630259,1656332,12650030
%N A373177 Integers k such that 2k + 1 and 4k + 3 are anagrams of k.
%C A373177 The terms of this sequence begin with decimal digits 1 or 2, otherwise 4*k + 3 has more digits than k and cannot be an anagram. The first term whose first digit is 2 is a(3931) = 2055114278.
%C A373177 This sequence has infinitely many terms, since 1500*10^m + 632 is a term for all positive integers m.
%C A373177 All terms == 8 (mod 9). - _Hugo Pfoertner_, May 27 2024
%e A373177 15632 is a term, since 2*15632 + 1 = 31265 and 4*15632 + 3 = 62531 are both permutations of the digits of 15632.
%p A373177 filter:= proc(n) local L;
%p A373177   L:= sort(convert(n,base,10));
%p A373177   sort(convert(2*n+1,base,10))=L
%p A373177   and sort(convert(4*n+3,base,10))=L
%p A373177 end proc:
%p A373177 R:= NULL: count:= 0:
%p A373177 for d from 1 while count < 100 do
%p A373177  for x from 10^(d-1) + 7 by 9 to (10^d-3)/4 while count < 100 do
%p A373177    if filter(x) then R:= R,x; count:= count+1 fi
%p A373177 od od:
%p A373177 R; # _Robert Israel_, May 27 2024
%t A373177 sid[n_] := Sort[IntegerDigits[n]]; Select[Range[13000000], sid[#] == sid[2*# + 1] == sid[4*# + 3] &] (* _Amiram Eldar_, May 27 2024 *)
%o A373177 (Python)
%o A373177 from itertools import count, islice
%o A373177 def agen(): # generator of terms
%o A373177     for e in count(1):
%o A373177         for k in range(10**(e-1), 10**e//4):
%o A373177             if sorted(str(k)) == sorted(str(2*k+1)) == sorted(str(4*k+3)):
%o A373177                 yield k
%o A373177 print(list(islice(agen(), 30))) # _Michael S. Branicky_, May 26 2024
%o A373177 (PARI) isok(k) = my(d=vecsort(digits(k))); (d == vecsort(digits(2*k+1))) && (d == vecsort(digits(4*k+3))); \\ _Michel Marcus_, May 28 2024
%Y A373177 Cf. A323711, A371623.
%K A373177 nonn,base
%O A373177 1,1
%A A373177 _Gonzalo Martínez_, May 26 2024