A118306 If n = product{k>=1} p(k)^b(n,k), where p(k) is the k-th prime and where each b(n,k) is a nonnegative integer, then: If n occurs earlier in the sequence, then a(n) = product{k>=2} p(k-1)^b(n,k); If n does not occur earlier in the sequence, then a(n) = product{k>=1} p(k+1)^b(n,k).
1, 3, 2, 9, 7, 15, 5, 27, 4, 21, 13, 45, 11, 33, 6, 81, 19, 75, 17, 63, 10, 39, 29, 135, 49, 51, 8, 99, 23, 105, 37, 243, 14, 57, 77, 225, 31, 69, 22, 189, 43, 165, 41, 117, 12, 87, 53, 405, 25, 147, 26, 153, 47, 375, 91, 297, 34, 93, 61, 315, 59, 111, 20, 729, 119, 195, 71
Offset: 1
Links
Crossrefs
Programs
-
Maple
A064989 := proc(n) local a,ifs,p ; a := 1 ; ifs := ifactors(n)[2] ; for p in ifs do if op(1,p) > 2 then a := a* prevprime(op(1,p))^op(2,p) ; fi ; od; RETURN(a) ; end: A003961 := proc(n) local a,ifs,p ; a := 1 ; ifs := ifactors(n)[2] ; for p in ifs do a := a* nextprime(op(1,p))^op(2,p) ; od; RETURN(a) ; end: A118306 := proc(nmin) local a,anxt,i,n ; a := [1] ; while nops(a) < nmin do n := nops(a)+1 ; if n in a then anxt := A064989(n) ; else anxt := A003961(n) ; fi ; a := [op(a),anxt] ; od; a ; end: A118306(100) ; # R. J. Mathar, Sep 06 2007
-
PARI
A118306(n) = { if(1==n, 1, my(f = factor(n)); my(d = (-1)^primepi(f[1, 1])); for(i=1, #f~, f[i, 1] = prime(primepi(f[i, 1])-d)); factorback(f)); }; \\ Antti Karttunen, Nov 06 2016 for(n=1, 10001, write("b118306.txt", n, " ", A118306(n)));
-
Scheme
(define (A118306 n) (cond ((= 1 n) n) ((odd? (A055396 n)) (A003961 n)) (else (A064989 n)))) ;; Antti Karttunen, Nov 05 2016
Formula
From Antti Karttunen, Nov 05 2016: (Start)
a(1) = 1; and for n > 1, if n = a(k) for some k = 1 .. n-1, then a(n) = A064989(n), otherwise a(n) = A003961(n). [After the original definition and R. J. Mathar's Maple-code]
a(1) = 1, and for n > 1, if A055396(n) is odd, a(n) = A003961(n), otherwise a(n) = A064989(n). [The above reduces to this.]
a(n) = product{k>=1} prime(k-((-1)^A055396(n)))^e(k) when n = product{k>=1} prime(k)^e(k).
For n > 1, A055396(a(n)) = A055396(n) - (-1)^A055396(n). [Permutation sends the terms on any odd row of A246278 to the next even row just below, and vice versa.]
(End)
Extensions
More terms from R. J. Mathar, Sep 06 2007
A small omission in the definition corrected by Antti Karttunen, Nov 05 2016
Comments