OFFSET
0,3
COMMENTS
LINKS
Peter Luschny, Table of n, a(n) for n = 0..1000
EXAMPLE
a(20) = (7/(5*7))^2*((3*5)/3)^4 = 25.
a(22) = ((13*17*19)/(11*13*17*19))*((7*11)/7)^2 = 11.
MAPLE
MATHEMATICA
a[n_] := Module[{l, m, z}, If[PrimeQ[n] , Return[n] ]; z = 1; l = Max[0, n - 1]; m = n; While[True, l = Quotient[l, 2]; m = Quotient[m, 2]; If[l == 0 , Break[]]; If[l < m , If[ PrimeQ[l+1], Return[(l+1)^z]]]; z = z+z]; 1]; Table[a[k], {k, 0, 71}] (* Jean-François Alcover, Jan 15 2014, after Maple *)
PROG
(J)
genSeq=: 3 :0
p=. x: i.&.(_1&p:) y1=.y+1
i=.(#~y1>])&.> <:@((i.@>.&.(2&^.)y1)*])&.> p
y{.(; p(^2x^0, i.@<:@#)&.>i) (; i) } y1$1
)
(Sage)
def A219964(n):
if is_prime(n): return n
z = 1; l = max(0, n-1); m = n
while true:
l = l // 2
m = m // 2
if l == 0: break
if l < m:
if is_prime(l+1): return (l+1)^z
z = z + z
return 1
[A219964(n) for n in (0..71)]
CROSSREFS
KEYWORD
nonn
AUTHOR
Peter Luschny and Arie Groeneveld, Mar 30 2013
STATUS
approved