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.

A005658 If n appears so do 2n, 3n+2, 6n+3.

Original entry on oeis.org

1, 2, 4, 5, 8, 9, 10, 14, 15, 16, 17, 18, 20, 26, 27, 28, 29, 30, 32, 33, 34, 36, 40, 44, 47, 50, 51, 52, 53, 54, 56, 57, 58, 60, 62, 63, 64, 66, 68, 72, 80, 83, 86, 87, 88, 89, 92, 93, 94, 98, 99, 100, 101, 102, 104, 105, 106, 108, 110, 111, 112, 114, 116, 120, 122, 123
Offset: 1

Views

Author

Keywords

Comments

David Klarner and coauthors studied several sequences of this type. Some of the references here apply generally to this class of sequences.

References

  • Guy, R. K., Klarner-Rado Sequences. Section E36 in Unsolved Problems in Number Theory, 2nd ed. New York: Springer-Verlag, p. 237, 1994.
  • J. C. Lagarias, ed., The Ultimate Challenge: The 3x+1 Problem, Amer. Math. Soc., 2010. See pp. 6, 280.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Haskell
    import Data.Set (Set, fromList, insert, deleteFindMin)
    a005658 n = a005658_list !! (n-1)
    a005658_list = klarner $ fromList [1,2] where
       klarner :: Set Integer -> [Integer]
       klarner s = m : (klarner $
                        insert (2*m) $ insert (3*m+2) $ insert (6*m+3) s')
          where (m,s') = deleteFindMin s
    -- Reinhard Zumkeller, Mar 14 2011
    
  • Maple
    ina:= proc(n) evalb(n=1) end:
    a:= proc(n) option remember; local k, t;
          if n=1 then 1
        else for k from a(n-1)+1 while not
               (irem(k, 2, 't')=0 and ina(t) or
                irem(k, 3, 't')=2 and ina(t) or
                irem(k, 6, 't')=3 and ina(t) )
             do od: ina(k):= true; k
          fi
        end:
    seq(a(n), n=1..80);  # Alois P. Heinz, Mar 16 2011
  • Mathematica
    s={1};Do[a=s[[n]];s=Union[s,{2a,3a+2,6a+3}],{n,1000}];s (* Zak Seidov, Mar 15 2011 *)
    nxt[n_]:=Flatten[{#,2#,3#+2,6#+3}&/@n]; Take[Union[Nest[nxt,{1},5]],100] (* Harvey P. Dale, Feb 06 2015 *)
  • PARI
    is(n)=if(n<3,return(n>0)); my(k=n%6); if(k==3, return(is(n\6))); if(k==1, return(0)); if(k==5, return(is(n\3))); if(k!=2, return(is(n/2))); is(n\3) || is(n/2) \\ Charles R Greathouse IV, Sep 15 2015

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Oct 16 2000