OFFSET
0,2
COMMENTS
Prime product form of primorial base expansion of n.
Sequence is a permutation of A048103. It maps the smallest prime not dividing n to the smallest prime dividing n, that is, A020639(a(n)) = A053669(n) holds for all n >= 1.
The sequence satisfies the exponential function identity, a(x + y) = a(x) * a(y), whenever A329041(x,y) = 1, that is, when adding x and y together will not generate any carries in the primorial base. Examples of such pairs of x and y are A328841(n) & A328842(n), and also A328770(n) (when added with itself). - Antti Karttunen, Oct 31 2019
From Antti Karttunen, Feb 18 2022: (Start)
The conjecture given in A327969 asks whether applying this function together with the arithmetic derivative (A003415) in some combination or another can eventually transform every positive integer into zero.
Another related open question asks whether there are any other numbers than n=6 such that when starting from that n and by iterating with A003415, one eventually reaches a(n). See comments in A351088.
This sequence is used in A351255 to list the terms of A099308 in a different order, by the increasing exponents of the successive primes in their prime factorization. (End)
From Bill McEachen, Oct 15 2022: (Start)
From inspection, the least significant decimal digits of a(n) terms form continuous chains of 30 as follows. For n == i (mod 30), i=0..5, there are 6 ordered elements of these 8 {1,2,3,6,9,8,7,4}. Then for n == i (mod 30), i=6..29, there are 12 repeated pairs = {5,0}.
Moreover, when the individual elements of any of the possible groups of 6 are transformed via (7*digit) (mod 10), the result matches one of the other 7 groupings (not all 7 may be seen). As example, {1,2,3,6,9,8} transforms to {7,4,1,2,3,6}. (End)
The least significant digit of a(n) in base 4 is given by A353486, and in base 6 by A358840. - Antti Karttunen, Oct 25 2022, Feb 17 2024
LINKS
Antti Karttunen, Table of n, a(n) for n = 0..2310
Antti Karttunen, Program in LODA-assembly
Antti Karttunen, Program in LODA-assembly [Cached copy]
FORMULA
Here the text in brackets shows how the right hand side sequence is a function of the primorial base expansion of n:
Various number theoretical functions applied:
Other identities:
a(n) mod n = A328386(n).
a(2n+1) = 2 * a(2n). - Antti Karttunen, Feb 17 2022
EXAMPLE
MATHEMATICA
b = MixedRadix[Reverse@ Prime@ Range@ 12]; Table[Function[k, Times @@ Power @@@ # &@ Transpose@ {Prime@ Range@ Length@ k, Reverse@ k}]@ IntegerDigits[n, b], {n, 0, 51}] (* Michael De Vlieger, Aug 23 2016, Version 10.2 *)
f[n_] := Block[{a = {{0, n}}}, Do[AppendTo[a, {First@ #, Last@ #} &@ QuotientRemainder[a[[-1, -1]], Times @@ Prime@ Range[# - i]]], {i, 0, #}] &@ NestWhile[# + 1 &, 0, Times @@ Prime@ Range[# + 1] <= n &]; Rest[a][[All, 1]]]; Table[Times @@ Flatten@ MapIndexed[Prime[#2]^#1 &, Reverse@ f@ n], {n, 0, 73}] (* Michael De Vlieger, Aug 30 2016, Pre-Version 10 *)
a[n0_] := Module[{m = 1, i = 1, n = n0, p}, While[n > 0, p = Prime[i]; m *= p^Mod[n, p]; n = Quotient[n, p]; i++]; m];
Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Dec 01 2021, after Antti Karttunen's Sage code *)
PROG
(APL, Dyalog Dialect) A276086 ← { P←47 43 41 37 31 29 23 19 17 13 11 7 5 3 2 ⋄ ×/P*¨P⊤⍵ } ⍝ Antti Karttunen, Feb 17 2024
(PARI) A276086(n) = { my(i=0, m=1, pr=1, nextpr); while((n>0), i=i+1; nextpr = prime(i)*pr; if((n%nextpr), m*=(prime(i)^((n%nextpr)/pr)); n-=(n%nextpr)); pr=nextpr); m; }; \\ Antti Karttunen, May 12 2017
(PARI) A276086(n) = { my(m=1, p=2); while(n, m *= (p^(n%p)); n = n\p; p = nextprime(1+p)); (m); }; \\ (Better than above one, avoids unnecessary construction of primorials). - Antti Karttunen, Oct 14 2019
(Scheme) (define (A276086 n) (let loop ((n n) (t 1) (i 1)) (if (zero? n) t (let* ((p (A000040 i)) (d (modulo n p))) (loop (/ (- n d) p) (* t (expt p d)) (+ 1 i))))))
(Scheme) (definec (A276086 n) (if (zero? n) 1 (* (expt (A053669 n) (A276088 n)) (A276086 (A276093 n))))) ;; Needs macro definec from http://oeis.org/wiki/Memoization#Scheme
(Scheme) (definec (A276086 n) (if (zero? n) 1 (* (A053669 n) (A276086 (- n (A002110 (A276084 n))))))) ;; Needs macro definec from http://oeis.org/wiki/Memoization#Scheme
(Python)
from sympy import prime
def a(n):
i=0
m=pr=1
while n>0:
i+=1
N=prime(i)*pr
if n%N!=0:
m*=(prime(i)**((n%N)/pr))
n-=n%N
pr=N
return m # Indranil Ghosh, May 12 2017, after Antti Karttunen's PARI code
(Sage)
def A276086(n):
m=1
i=1
while n>0:
p = sloane.A000040(i)
m *= (p**(n%p))
n = floor(n/p)
i += 1
return (m)
# Antti Karttunen, Oct 14 2019, after Indranil Ghosh's Python code above, and my own leaner PARI code from Oct 14 2019. This avoids unnecessary construction of primorials.
(Python)
from sympy import nextprime
def a(n):
m, p = 1, 2
while n > 0:
n, r = divmod(n, p)
m *= p**r
p = nextprime(p)
return m
print([a(n) for n in range(74)]) # Peter Luschny, Apr 20 2024
CROSSREFS
Cf. A000040, A001221, A001222, A002110, A020639, A049345, A053669, A055396, A057588, A071178, A143293, A257993, A267263, A276084, A276088, A276092, A276093, A276147, A276150, A276151, A276153, A276156, A283477, A324198 (= gcd(n, a(n))), A328584 (= lcm(n, a(n))), A324646, A324289, A328386, A328403, A328475, A328571, A328572, A328578, A328612, A328613, A328620, A328624, A328627, A328763, A328766, A328828, A328835, A328841, A328842, A328843, A328844, A329041, A324580 [= n*a(n)], A324895 (largest proper divisor of a(n)), A351252, A353486 (reduced modulo 4), A358840 (modulo 6), A353489, A353516.
Cf. A048103 (terms sorted into ascending order), A100716 (natural numbers not present in this sequence).
Cf. A328316 (iterates started from zero).
Cf. A327858, A327859, A327860, A327963, A328097, A328098, A328099, A328110, A328112, A328382 for various combinations with arithmetic derivative (A003415).
KEYWORD
AUTHOR
Antti Karttunen, Aug 21 2016
EXTENSIONS
Name edited and new link-formulas added by Antti Karttunen, Oct 29 2019
Name changed again by Antti Karttunen, Feb 05 2022
STATUS
approved