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.

A357481 a(n) is the least integer b such that the digit representation of n in base b is equal to the digit representation in base b of the initial terms of the sets of divisors of n in increasing order, or -1 if no such b exists.

This page as a plain text file.
%I A357481 #23 Oct 06 2022 04:30:54
%S A357481 2,-1,-1,-1,-1,2,-1,6,6,8,-1,10,-1,12,12,14,-1,16,-1,18,18,20,-1,22,
%T A357481 20,24,24,26,-1,28,-1,30,30,32,30,34,-1,36,36,38,-1,40,-1,42,42,44,-1,
%U A357481 3,42,3,48,2,-1,52,50,54,54,56,-1,58,-1,60,2,62,60,7,-1,66,66,68,-1,70,-1,72,7
%N A357481 a(n) is the least integer b such that the digit representation of n in base b is equal to the digit representation in base b of the initial terms of the sets of divisors of n in increasing order, or -1 if no such b exists.
%C A357481 It appears that a(n) != -1 iff n in A056653.
%H A357481 Michel Marcus, <a href="/A357481/b357481.txt">Table of n, a(n) for n = 1..10000</a>
%H A357481 Peter Munn, <a href="/plot2a?name1=A000027&amp;name2=A357481&amp;tform1=asinh&amp;tform2=asinh&amp;shift=0&amp;radiop1=xy&amp;drawpoints=true">Scatterplot with asinh-scale axes</a>. (Axis labeled "A000027(n)" is n.)
%e A357481 In base 10, 12 is a term of A175252, and there is no other lesser base for which 12 works, so a(12) = 10.
%o A357481 (PARI) isok(k, b) = my(s=[]); fordiv(k, d, s=concat(s, digits(d, b)); if (fromdigits(s, b)==k, return(1)); if (fromdigits(s, b)> k, return(0)));
%o A357481 a(n) = if (n==1, 2, for (b=2, n-1, if (isok(n, b), return(b))); return(-1););
%o A357481 (Python)
%o A357481 from sympy import divisors
%o A357481 from sympy.ntheory import digits
%o A357481 def ok(n, b):
%o A357481     target, s = digits(n, b)[1:], []
%o A357481     if target[0] != 1: return False
%o A357481     for d in divisors(n):
%o A357481         s += digits(d, b)[1:]
%o A357481         if len(s) >= len(target): return s == target
%o A357481 def a(n):
%o A357481     if n == 1: return 2
%o A357481     for b in range(2, n):
%o A357481         if ok(n, b): return b
%o A357481     return -1
%o A357481 print([a(n) for n in range(1, 76)]) # _Michael S. Branicky_, Oct 05 2022
%Y A357481 Cf. A056653, A175252, A357428, A357429.
%K A357481 sign,base
%O A357481 1,1
%A A357481 _Michel Marcus_, Sep 30 2022