OFFSET
1,2
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
MAPLE
# Apply p->2p, 3p->2p to a sequence t1
SMOOTH:=proc(t1) local M, t2, n; t2:=[]: M:=nops(t1):
for n from 1 to M do
if isprime(t1[n]) then t2:=[op(t2), 2*t1[n]];
elif (t1[n] mod 3 = 0 ) and isprime(t1[n]/3) then t2:=[op(t2), 2*t1[n]/3];
else t2:=[op(t2), t1[n]]; fi; od: t2; end;
SMOOTH([seq(n, n=1..200)]);
MATHEMATICA
Range[70] /. {n_ /; PrimeQ[n] -> 2n, n_ /; PrimeQ[n/3] -> 2n/3} (* Jean-François Alcover, Aug 04 2018 *)
Table[Which[PrimeQ[n], 2n, PrimeQ[n/3], 2 n/3, True, n], {n, 120}] (* Harvey P. Dale, Jun 08 2019 *)
PROG
(Haskell)
a256415 n | a010051 n == 1 = 2 * n
| r == 0 && a010051 n' == 1 = 2 * n'
| otherwise = n
where (n', r) = divMod n 3
-- Reinhard Zumkeller, Apr 05 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Apr 05 2015
STATUS
approved