Robert Israel, <a href="/A362499/b362499_1.txt">Table of n, a(n) for n = 0..1000</a>
Robert Israel, <a href="/A362499/b362499_1.txt">Table of n, a(n) for n = 0..1000</a>
proposed
approved
editing
proposed
(Python)
from sympy import factorint
from sympy.utilities.iterables import multiset_permutations as mp
from itertools import count, islice, combinations_with_replacement as mc
def ndgen():
yield from ((f, )+r for d in count(1) for f in "123456789" for r in mc("0123456789", d-1))
def c(n): # is_semiprime
return sum(factorint(n).values()) == 2
def f(digs):
return sum(1 for p in mp(digs) if p[0]!="0" and c(t:=int("".join(p))))
def agen(): # generator of terms
adict, n = dict(), 0
for t in ndgen():
v = f(t)
if v not in adict: adict[v] = int("".join(t))
while n in adict: yield adict[n]; n += 1
print(list(islice(agen(), 46))) # Michael S. Branicky, Jun 12 2023
proposed
editing
editing
proposed
Robert Israel, <a href="/A362499/b362499_1.txt">Table of n, a(n) for n = 0..1000</a>
nonn,base,changed,look
allocated for Robert Israela(n) is the least positive integer that has exactly n anagrams that are semiprimes, or -1 if there is no such integer.
1, 4, 15, 123, 129, 134, 178, 1025, 1148, 1147, 1137, 1145, 1349, 1348, 1357, 10145, 3589, 10258, 10137, 10123, 11269, 10289, 10268, 10247, 10235, 10267, 10234, 10789, 10279, 11378, 10378, 12369, 10349, 10358, 12368, 10357, 12689, 12358, 10459, 12379, 12679, 13489, 12346, 12349, 16789, 12479
0,2
a(n) is the least k such that A131371(k) = n.
Leading zeros are not allowed.
a(3) = 123 because 123 has 3 anagrams that are semiprimes, namely 123 = 3 * 41, 213 = 3 * 71, and 321 = 3 * 107, and no smaller number works.
g:= proc(s, m) local t;
if s[1..m-1] = [0$(m-1)] then op(map(t -> [t, op(s)], [0, $(max(s) ..9)]))
else op(map(t -> [t, op(s)], [$(max(s) .. 9)]))
fi
end proc:
f:= proc(L, m) local P, t, i;
P:= select(t -> t[-1] <> 0 and numtheory:-bigomega(add(t[i]*10^(i-1), i=1..m))=2, combinat:-permute(L));
nops(P)
end proc:
V:= Array(0..100):
count:= 2: V[0]:= 1: V[1]:= 4:
L:= [seq(seq([b, a], b=[0, $a..9]), a=1..9)]:
for m from 2 while count < 101 do
for s in L while count < 101 do
v:= f(s, m);
if v <= 100 and V[v] = 0 then
V[v]:= add(s[i]*10^(i-1), i=1..m); count:= count+1;
fi
od;
L:= map(g, L, m)
od:
convert(V, list);
allocated
nonn,base
Robert Israel, Jun 11 2023
approved
editing
allocated for Robert Israel
recycled
allocated
editing
approved
a(n) is the maximum level of nesting of exponentiation required to write n in its prime exponent product form, with the exponents being written the same way, recursively.
1, 2, 2, 3, 2, 2, 2, 3, 3, 2, 2, 3, 2, 2, 2, 4, 2, 3, 2, 3, 2, 2, 2, 3, 3, 2, 3, 3, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2, 3, 3, 2, 2, 4, 3, 3, 2, 3, 2, 3, 2, 3, 2, 2, 2, 3, 2, 2, 3, 3, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 3, 3, 2, 2, 2, 4, 4, 2, 2, 3, 2, 2, 2, 3, 2, 3, 2, 3, 2, 2, 2, 3, 2, 3, 3, 3
1,2
a(n) = 1 + max(a(e_i)), where n = 2^e_2 * 3^e_3 * 5^e_5 * 7^e_7 * ... * i^e_i, with i being a prime.
a(A005117(n)) = 2. - Jodi Spitz, Apr 22 2023
a(n) = A185102(n) + 1. - Pontus von Brömssen, Apr 22 2023
Take the height of the tallest power tower excluding the topmost 0:
For n = 1, 1 = 2^0 * 3^0 * 5^0 * 7^0 * ... * p_i^0, tallest power tower is p^0, so a(1) = 1.
For n = 2, 2 = 2^p^0, which is the tallest power tower for n = 2, so a(2) = 2.
For n = 12, 12 = 2^2 * 3^1 = 2^2^p^0 * 3^p^0, the tallest power tower is 2^2^p^0, so a(12) = 3.
For n = 16, 16 = 2^4 = 2^2^2 = 2^2^2^p^0, the tallest power tower is 2^2^2^p^0, so a(16) = 4.
p is an arbitrary prime in all of the examples.
Cf. A185102.
nonn
recycled
Daniyar Sarbasov, Apr 22 2023
proposed
editing