OFFSET

2,1

COMMENTS

For an alternate program that only checks a single base at a time, use the code from "#the actual function (alternate)" instead of "#the actual function".

The computation of a(n) is exceedingly inefficient, requiring the checking of all natural values less than a(n). A more efficient way to compute a(n) is very desirable. - Ely Golden, Dec 25 2016

There is a lower bound on a(n), if not 0, of n^2 + n + 1. As well, a(n) must have 3 or more nonzero digits in base n (if n is odd, this lower bound is n^3 + n^2 + n + 1, and a(n) must have 4 or more nonzero digits in base n). This does not significantly improve the computation of a(n), however. - Ely Golden, Dec 30 2016

The pattern in the magnitude of a(n) is unclear. For some values of n, a(n) is much larger than for other values. For example, a(65) is 2460678262, whereas a(64) is only 4369 and a(66) is 4577. It seems as though even values of n typically have smaller values of a(n). - Ely Golden, Dec 30 2016

LINKS

Ely Golden, Table of n, a(n) for n = 2..72 (terms a(67), a(69), and a(71) computed by Chai Wah Wu)

Ely Golden, Table of n, a(n) for n = 2..11584 (a-file, contains every value of a(n) <= 2^27)

Ely Golden, Proofs regarding the lower bound of A278981(n)

EXAMPLE

a(2) = 15, as 15 is the first composite number whose base-2 nonzero digits (1111) are the same as the base-2 nonzero digits of its prime factors (11_2 and 101_2).

MATHEMATICA

g[n_] := g[n] = Flatten[ Table[#[[1]], {#[[2]]}] & /@ FactorInteger[n]];

f[b_] := Block[{c = b^2}, While[ PrimeQ@ c || DeleteCases[ Sort[ IntegerDigits[c, b]], 0] != DeleteCases[ Sort[ Flatten[ IntegerDigits[g[c], b]]], 0], c++]; c]; Array[f, 39, 2] (* Robert G. Wilson v, Dec 30 2016 *)

PROG

(SageMath)

def nonZeroDigits(x, n):

if(x<=0|n<2):

return []

li=[]

while(x>0):

d=divmod(x, n)

if(d[1]!=0):

li.append(d[1])

x=d[0]

li.sort()

return li;

def nonZeroFactorDigits(x, n):

if(x<=0|n<2):

return []

li=[]

f=list(factor(x))

#ensures inequality of nonZeroFactorDigits(x, n) and nonZeroDigits(x, n) if x is prime

if((len(f)==1)&(f[0][1]==1)):

return [];

for c in range(len(f)):

for d in range(f[c][1]):

ld=nonZeroDigits(f[c][0], n)

li+=ld

li.sort()

return li;

#the actual function

def a(n):

c=2

while(nonZeroFactorDigits(c, n)!=nonZeroDigits(c, n)):

c+=1;

return c;

index=2

while(index<=100):

print(str(index)+" "+str(a(index)))

index+=1

print("complete")

#the actual function (alternate)

def a(n):

c=2

while(nonZeroFactorDigits(c, n)!=nonZeroDigits(c, n)):

c+=1;

if(c%1000000==1):

print("checked up to "+str(c-1))

return c;

x=3 # <some base you want to check>

print(str(x)+" "+str(a(x)))

print("complete")

CROSSREFS

KEYWORD

nonn,base

AUTHOR

Ely Golden, Dec 02 2016

STATUS

approved