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.

Showing 1-2 of 2 results.

A256417 The EKG sequence (A064413) smoothed by replacing each prime p with 2p and each thrice-prime 3p also with 2p.

Original entry on oeis.org

1, 4, 4, 4, 6, 6, 12, 8, 10, 10, 10, 18, 14, 14, 14, 24, 16, 20, 22, 22, 22, 27, 30, 25, 35, 28, 26, 26, 26, 36, 32, 34, 34, 34, 42, 38, 38, 38, 45, 40, 44, 46, 46, 46, 48, 50, 52, 54, 56, 49, 63, 60, 55, 65, 70, 58, 58, 58, 66, 62, 62
Offset: 1

Views

Author

N. J. A. Sloane, Apr 05 2015

Keywords

Comments

This smoothing of A064413 is discussed in Lagarias et al. (2002).
a(n) = A256415(A064413(n)). - Reinhard Zumkeller, Apr 06 2015

Crossrefs

Programs

  • Haskell
    a256417 = a256415 . a064413  -- Reinhard Zumkeller, Apr 06 2015
  • Mathematica
    ekg[s_] := Block[{m = s[[-1]], k = 3}, While[MemberQ[s, k] || GCD[m, k] == 1, k++]; Append[s, k]];
    Nest[ekg, {1, 2}, 100] /. {n_ /; PrimeQ[n] -> 2n, n_ /; PrimeQ[n/3] -> 2n/3 } (* Jean-François Alcover, Aug 04 2018, after Robert G. Wilson v *)

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

Original entry on oeis.org

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, 26, 27, 28, 58, 30, 62, 32, 22, 34, 35, 36, 74, 38, 26, 40, 82, 42, 86, 44, 45, 46, 94, 48, 49, 50, 34, 52, 106, 54, 55, 56, 38, 58, 118, 60, 122, 62, 63, 64, 65, 66, 134, 68, 46, 70
Offset: 1

Views

Author

N. J. A. Sloane, Apr 05 2015

Keywords

Comments

The smoothed version of A064413 (A256417) is a rearrangement of these terms.

Crossrefs

Cf. A010051, A064413, A256416 (the sorted sequence), A256417.

Programs

  • 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
  • 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 *)
Showing 1-2 of 2 results.