login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A333658
a(n) is the greatest number m not yet in the sequence such that the primorial base expansions of n and of m have the same digits (up to order but with multiplicity).
4
0, 1, 2, 3, 4, 5, 6, 8, 7, 9, 14, 15, 12, 13, 10, 11, 16, 17, 18, 20, 19, 21, 22, 23, 24, 26, 25, 27, 28, 29, 30, 36, 32, 38, 66, 68, 31, 37, 33, 39, 67, 69, 62, 63, 44, 45, 74, 75, 96, 98, 97, 99, 104, 105, 126, 128, 127, 129, 134, 135, 60, 61, 42, 43, 72, 73
OFFSET
0,3
COMMENTS
Leading 0's are ignored.
This sequence is a permutation of the nonnegative integers, which preserves the number of digits (A235224) and the sum of digits (A276150) in primorial base.
FORMULA
a(A002110(n)) = A002110(n) for any n >= 0.
EXAMPLE
For n = 42:
- the primorial base representation of 42 is "1200",
- there are five numbers m with the same multiset of digits:
m prim(m)
-- -------
34 "1020"
42 "1200"
61 "2001"
62 "2010"
66 "2100"
- so a(34) = 66,
a(42) = 62,
a(61) = 61,
a(62) = 42,
a(66) = 34.
PROG
(PARI) See Links section.
CROSSREFS
See A333659 and A337598 for similar sequences.
Sequence in context: A358143 A078840 A358124 * A337598 A333221 A334438
KEYWORD
nonn,look,base
AUTHOR
Rémy Sigrist, Sep 02 2020
STATUS
approved