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

A279688 Numbers k such that k and 2k are anagrams in some base.

Original entry on oeis.org

0, 8, 18, 21, 27, 32, 40, 48, 65, 66, 72, 78, 86, 96, 98, 99, 104, 108, 111, 114, 123, 133, 168, 176, 189, 190, 200, 208, 225, 240, 248, 258, 260, 264, 266, 270, 280, 288, 294, 296, 297, 312, 314, 318, 320, 330, 341, 350, 363, 380, 387, 396, 399, 408, 429, 432
Offset: 1

Views

Author

Peter Kagey, Dec 17 2016

Keywords

Examples

			a(2) = 8  because in base 5, 8  = 13_5  and 16 = 31_5.
a(3) = 18 because in base 4, 18 = 102_4 and 36 = 210_4.
		

Crossrefs

Cf. A023094.

Programs

  • Mathematica
    fQ[n_] := Block[{b = 2}, While[ 2b < n +3 && Sort[ IntegerDigits[n, b]] != Sort[ IntegerDigits[ 2n, b]], b++]; 2b < n +3]; fQ[0] = True; Select[Range[0, 435], fQ] (* Robert G. Wilson v, Dec 21 2016 *)
  • PARI
    isok(n) = if (n==0, 1, for (b=2, n, if (vecsort(digits(n,b)) == vecsort(digits(2*n,b)), return(1))); 0); \\ Michel Marcus, Dec 17 2016

A087502 Smallest positive integer which when written in base n is doubled when the last digit is put first.

Original entry on oeis.org

32, 18, 8, 10993850, 2129428800, 21, 5064320, 105263157894736842, 40, 64609423538, 5712, 65, 58774271029236501660840264682112, 67650, 96, 833, 586081355679130611935159482937228562988190880, 133
Offset: 3

Views

Author

Pontus von Brömssen, Sep 10 2003

Keywords

Comments

a(n) is the smallest integer of the form x*(n^d-1)/(2n-1) for integer x and d, where 1 < x < n and d > 1. x is the last digit and d is the number of digits of a(n) in base n. - Pontus von Brömssen, Jan 06 2019

Examples

			a(10) = 105263157894736842 because 2*105263157894736842 = 210526315789473684 and no smaller number has this property. (Leading zeros are not allowed, otherwise 2*052631578947368421 = 105263157894736842 would be a smaller solution.)
		

Crossrefs

See A158877 for these numbers written in base n. Cf. A023094, A034089, A081463, A087502.

Programs

  • Maple
    A087502 := proc(n) local d,a; d := 1; a := n; while a>=n do d := d+1; a := denom((2^d-1)/(2*n-1)); od; return(max(2,a)*(n^d-1)/(2*n-1)); end proc;

A158877 Definition of a(n): in base-n arithmetic a(n) is the smallest positive integer that is doubled when its least significant digit is moved to become the most significant digit.

Original entry on oeis.org

1012, 102, 13, 1031345242, 103524563142, 25, 10467842, 105263157894736842, 37, 10631694842
Offset: 3

Views

Author

Daniel Asimov (asimov(AT)msri.org), Mar 28 2009

Keywords

Comments

The problem has no solution in base 2, so sequence begins with the base-3 solution. The idea was suggested by a NY Times article (Sunday Magazine of Mar 29, 2009) -- in which Freeman Dyson is said to have solved the base-10 question almost instantaneously when it was posed to him -- and by the ensuing math-fun discussion.

Examples

			For n = 5, the smallest positive integer whose base-5 representation doubles when the rightmost digit is moved to become the leftmost digit is 8 = 13_5; 31_5 = 16.
For n = 8, the smallest positive integer whose base-8 representation doubles when the rightmost digit is moved to become the leftmost digit is 21 = 25_8; 52_8 = 42. - _Robert Tanniru_, Aug 09 2022
For n = 13, the number can't be represented in this list as it would be 27A5 in base 13.
		

Crossrefs

See A087502 (which is the main entry for this sequence) for these numbers written in base 10. Cf. A023094, A159774.

Extensions

a(5) corrected by William A. Hoffman III (whoff(AT)robill.com), Apr 19 2009
a(8) corrected by Robert Tanniru, Aug 09 2022
a(11)-a(12) from Robert Tanniru, Aug 11 2022, using A087502

A382946 a(n) is the least positive integer k having a proper divisor d such that the base n expansions of k and d, without leading zeros, have, up to order, the same digits, or a(n) = -1 if no such k exists.

Original entry on oeis.org

-1, 64, 36, 16, 700, 36, 42, 64, 3105, 45, 594, 105, 130, 168, 945, 120, 1666, 96, 266, 275, 2457, 231, 460, 351, 450, 273, 7938, 175, 7714, 280, 682, 1024, 308, 459, 7525, 741, 962, 665, 27300, 288, 17097, 560, 1290, 1265, 18540, 1035, 1974, 540, 952, 715
Offset: 2

Views

Author

Rémy Sigrist, Apr 09 2025

Keywords

Comments

Conjecture: a(n) > 0 for any n > 2.

Examples

			The first terms, alongside an appropriate divisor d, in bases 10 and n, are:
  n   a(n)  d     n in base n  d in base n
  --  ----  ----  -----------  -----------
   2    -1  N/A   N/A          N/A
   3    64    32  2,1,0,1      1,0,1,2
   4    36    18  2,1,0        1,0,2
   5    16     8  3,1          1,3
   6   700   350  3,1,2,4      1,3,4,2
   7    36    12  5,1          1,5
   8    42    21  5,2          2,5
   9    64    16  7,1          1,7
  10  3105  1035  3,1,0,5      1,0,3,5
  11    45    15  4,1          1,4
  12   594   198  4,1,6        1,4,6
  13   105    21  8,1          1,8
  14   130    65  9,4          4,9
  15   168    56  11,3         3,11
  16   945   315  3,11,1       1,3,11
		

Crossrefs

Programs

  • PARI
    a(n) = {
        if (n==2, return (-1));
        for (k = 1, oo,
            my (t = vecsort(digits(k, n)));
            fordiv (k, d,
                if (d < k && vecsort(digits(d, n))==t,
                    return (k);););); }
    
  • Python
    from sympy import divisors
    from sympy.ntheory import digits
    from itertools import count
    def a(n):
        if n == 2:
            return -1
        for k in count(2*n):
            divs, kdigs = divisors(k), sorted(digits(k, n)[1:])
            for d in sorted(divs[:-1], reverse=True):
                ddigs = sorted(digits(d, n)[1:])
                if ddigs == kdigs:
                    return k
                if len(ddigs) < len(kdigs):
                    break
    print([a(n) for n in range(2, 52)]) # Michael S. Branicky, Apr 13 2025

A279916 Least b such that A279688(n) and 2*A279688(n) are anagrams in base b.

Original entry on oeis.org

5, 4, 8, 4, 3, 5, 5, 14, 4, 4, 4, 3, 3, 3, 4, 3, 4, 4, 4, 4, 20, 8, 23, 8, 11, 5, 5, 26, 5, 3, 3, 3, 4, 3, 4, 29, 3, 3, 3, 4, 3, 3, 4, 3, 4, 32, 6, 4, 11, 4, 4, 4, 35, 4, 4, 11, 4, 4, 4, 4, 4, 7, 38, 4, 6, 4, 4, 4, 4, 8, 41, 11, 16, 8, 44, 3, 47, 3, 3, 3, 3, 3
Offset: 2

Views

Author

Peter Kagey, Dec 23 2016

Keywords

Examples

			A279688(2) = 8, and a(2) = 5 because 5 is the least base such that 8 and 16 are anagrams: 8 = 13_5 and 16 = 31_5.
		

Crossrefs

Programs

  • Mathematica
    DeleteCases[#, 0] &@ Table[Module[{b = 2}, While[2 b < n + 3 && Sort[IntegerDigits[n, b]] != Sort[IntegerDigits[2 n, b]], b++]; b Boole[2 b < n + 3]], {n, 780}] (* Michael De Vlieger, Dec 23 2016, after Robert G. Wilson v at A279688 *)
Showing 1-5 of 5 results.