cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A256415 Positive integers with primes p replaced by 2p and also 3p replaced by 2p.

This page as a plain text file.
%I A256415 #22 Aug 06 2019 02:37:14
%S A256415 1,4,6,4,10,4,14,8,6,10,22,12,26,14,10,16,34,18,38,20,14,22,46,24,25,
%T A256415 26,27,28,58,30,62,32,22,34,35,36,74,38,26,40,82,42,86,44,45,46,94,48,
%U A256415 49,50,34,52,106,54,55,56,38,58,118,60,122,62,63,64,65,66,134,68,46,70
%N A256415 Positive integers with primes p replaced by 2p and also 3p replaced by 2p.
%C A256415 The smoothed version of A064413 (A256417) is a rearrangement of these terms.
%H A256415 Reinhard Zumkeller, <a href="/A256415/b256415.txt">Table of n, a(n) for n = 1..10000</a>
%p A256415 # Apply p->2p, 3p->2p to a sequence t1
%p A256415 SMOOTH:=proc(t1) local M,t2,n; t2:=[]: M:=nops(t1):
%p A256415 for n from 1 to M do
%p A256415 if isprime(t1[n]) then t2:=[op(t2),2*t1[n]];
%p A256415 elif (t1[n] mod 3 = 0 ) and isprime(t1[n]/3) then t2:=[op(t2),2*t1[n]/3];
%p A256415 else t2:=[op(t2),t1[n]]; fi; od: t2; end;
%p A256415 SMOOTH([seq(n,n=1..200)]);
%t A256415 Range[70] /. {n_ /; PrimeQ[n] -> 2n, n_ /; PrimeQ[n/3] -> 2n/3} (* _Jean-François Alcover_, Aug 04 2018 *)
%t A256415 Table[Which[PrimeQ[n],2n,PrimeQ[n/3],2 n/3,True,n],{n,120}] (* _Harvey P. Dale_, Jun 08 2019 *)
%o A256415 (Haskell)
%o A256415 a256415 n | a010051 n == 1 = 2 * n
%o A256415           | r == 0 && a010051 n' == 1 = 2 * n'
%o A256415           | otherwise = n
%o A256415           where (n', r) = divMod n 3
%o A256415 -- _Reinhard Zumkeller_, Apr 05 2015
%Y A256415 Cf. A010051, A064413, A256416 (the sorted sequence), A256417.
%K A256415 nonn
%O A256415 1,2
%A A256415 _N. J. A. Sloane_, Apr 05 2015