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-7 of 7 results.

A058361 a(n) is the least k in A002977 with a gap of n. Also n + a(n) is the least k in A007448 which is repeated n times.

Original entry on oeis.org

3, 1, 4, 15, 22, 121, 735, 31, 46, 22143, 4468, 67, 31455, 391, 2308, 447, 94, 33151, 16383, 139, 202, 7551, 5224, 787, 1595391, 3685, 580, 30591, 418, 42495, 1791, 607, 1342, 3217407, 1095166, 283, 398847, 32767, 365311, 88575, 1174, 6925, 12304383
Offset: 1

Views

Author

Robert G. Wilson v, Dec 16 2000

Keywords

Crossrefs

Programs

  • Mathematica
    k = {1}; Do[ k = Union[ Join[ k, 2k + 1, 3k + 1 ] ]; l = Length[ k ]; i = 1; While[ i < l && k[ [ i ] ] < 10^9, i++ ]; k = Take[ k, {1, i} ], {n, 1, 30} ]; f[ n_Integer ] := (i = 1; While[ k[ [ i + 1 ] ] - k[ [ i ] ] != n, i++ ]; k[ [ i ] ]); Table[ f[ n ], {n, 1, 84} ]

A108853 Indices of prime Knuth numbers; that is, integers n such that the n-th Knuth number is prime. Indices of primes in A007448.

Original entry on oeis.org

1, 2, 4, 5, 6, 10, 11, 12, 15, 16, 17, 18, 28, 29, 30, 40, 41, 42, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 121, 122, 123, 124, 125, 126, 136, 137, 138, 159, 160, 161, 162, 190, 191, 192, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213
Offset: 1

Views

Author

Ryan Propper, Jul 11 2005

Keywords

Examples

			10 is a term because the 10th Knuth number, 13, is prime.
		

Crossrefs

Cf. A007448.

Programs

Extensions

Extended by Ray Chandler, Jul 24 2005

A016046 First occurrence of exactly n identical terms in A007448.

Original entry on oeis.org

1, 3, 7, 19, 27, 127, 742, 39, 55, 22153, 4479, 79, 31468, 405, 2323, 463, 111, 33169, 16402, 159, 223, 7573, 5247, 811, 1595416, 3711, 607, 30619, 447, 42525, 1822, 639, 1375, 3217441, 1095201, 319, 398884, 32805, 365350, 88615, 1215, 6967, 12304426
Offset: 1

Views

Author

Keywords

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Jan 06 2005

A003817 a(0) = 0, a(n) = a(n-1) OR n.

Original entry on oeis.org

0, 1, 3, 3, 7, 7, 7, 7, 15, 15, 15, 15, 15, 15, 15, 15, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63
Offset: 0

Views

Author

Keywords

Comments

Also, 0+1+2+...+n in lunar arithmetic in base 2 written in base 10. - N. J. A. Sloane, Oct 02 2010
For n>0: replace all 0's with 1's in binary representation of n. - Reinhard Zumkeller, Jul 14 2003

Crossrefs

This is Guy Steele's sequence GS(6, 6) (see A135416).
Cf. A167832, A167878. - Reinhard Zumkeller, Nov 14 2009
Cf. A179526; subsequence of A007448. - Reinhard Zumkeller, Jul 18 2010
Cf. A265705.

Programs

  • Haskell
    import Data.Bits ((.|.))
    a003817 n = if n == 0 then 0 else 2 * a053644 n - 1
    a003817_list = scanl (.|.) 0 [1..] :: [Integer]
    -- Reinhard Zumkeller, Dec 08 2012, Jan 15 2012
    
  • Maple
    A003817 := n -> n + Bits:-Nand(n, n):
    seq(A003817(n), n=0..61); # Peter Luschny, Sep 23 2019
  • Mathematica
    a[0] = 0; a[n_] := a[n] = BitOr[ a[n-1], n]; Table[a[n], {n, 0, 61}] (* Jean-François Alcover, Dec 19 2011 *)
    nxt[{n_,a_}]:={n+1,BitOr[a,n+1]}; Transpose[NestList[nxt,{0,0},70]] [[2]] (* Harvey P. Dale, May 06 2016 *)
    2^BitLength[Range[0,100]]-1 (* Paolo Xausa, Feb 08 2024 *)
  • PARI
    a(n)=1<<(log(2*n+1)\log(2))-1 \\ Charles R Greathouse IV, Dec 08 2011
    
  • Python
    def a(n): return 0 if n==0 else 1 + 2*a(int(n/2)) # Indranil Ghosh, Apr 28 2017
    
  • Python
    def A003817(n): return (1<Chai Wah Wu, Jul 17 2024

Formula

a(n) = a(n-1) + n*(1-floor(a(n-1)/n)). If 2^(k-1) <= n < 2^k, a(n) = 2^k - 1. - Benoit Cloitre, Aug 25 2002
a(n) = 1 + 2*a(floor(n/2)) for n > 0. - Benoit Cloitre, Apr 04 2003
G.f.: (1/(1-x)) * Sum_{k>=0} 2^k*x^2^k. - Ralf Stephan, Apr 18 2003
a(n) = 2*A053644(n)-1 = A092323(n) + A053644(n). - Reinhard Zumkeller, Feb 15 2004; corrected by Anthony Browne, Jun 26 2016
a(n) = OR{k OR (n-k): 0<=k<=n}. - Reinhard Zumkeller, Jul 15 2008
For n>0: a(n+1) = A035327(n) + n = A035327(n) XOR n. - Reinhard Zumkeller, Nov 14 2009
A092323(n+1) = floor(a(n)/2). - Reinhard Zumkeller, Jul 18 2010
a(n) = A265705(n,0) = A265705(n,n). - Reinhard Zumkeller, Dec 15 2015
a(n) = A062383(n) - 1.
G.f. A(x) satisfies: A(x) = 2*A(x^2)*(1 + x) + x/(1 - x). - Ilya Gutkovskiy, Aug 31 2019
a(n) >= A175039(n) - Austin Shapiro, Dec 29 2022

A002977 Klarner-Rado sequence: a(1) = 1; subsequent terms are defined by the rule that if m is present so are 2m+1 and 3m+1.

Original entry on oeis.org

1, 3, 4, 7, 9, 10, 13, 15, 19, 21, 22, 27, 28, 31, 39, 40, 43, 45, 46, 55, 57, 58, 63, 64, 67, 79, 81, 82, 85, 87, 91, 93, 94, 111, 115, 117, 118, 121, 127, 129, 130, 135, 136, 139, 159, 163, 165, 166, 171, 172, 175, 183, 187, 189, 190, 193, 202, 223, 231, 235, 237
Offset: 1

Views

Author

Keywords

Comments

Complement of A132142: A132138(a(n)) = 1; for all terms m there exists at least one x such that A132140(x)=m. - Reinhard Zumkeller, Aug 20 2007
a(n+1) = A007448(a(n)), which also gives the record values of A007448 and their positions. - Reinhard Zumkeller, Jul 14 2010
Named after the American mathematician David Anthony Klarner (1940-1999) and the German-British mathematician Richard Rado (1906-1989). - Amiram Eldar, Jun 24 2021

Examples

			a(10) = 21 = 2*(3*(2*1+1)+1)+1: A132139(A132140(10)) = A132139(43) = 21;
a(14) = 31 = 3*(3*(2*1+1)+1)+1 = 2*(2*(2*(2*1+1)+1)+1)+1: A132139(A132140(14)) = A132139(52) = 31 and A132139(A132140(16)) = A132139(121) = 31.
		

References

  • Michael L. Fredman and Donald E. Knuth, Recurrence relations based on minimization, Abstract 71T-B234, Notices Amer. Math. Soc., Vol. 18 (1971), p. 960.
  • Ronald L. Graham, Donald E. Knuth and Oren Patashnik, Concrete Mathematics. Addison-Wesley, Reading, MA, 1990, p. 78.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence)
  • Niklaus Wirth, Systematisches Programmieren, 1975, exercise 15.12.

Crossrefs

See A276786 for multi-set version.

Programs

  • Haskell
    import Data.Set
    a002977 n = a002977_list !! (n-1)
    a002977_list = f $ singleton 1 where
       f :: Set Integer -> [Integer]
       f s = m : (f $ insert (3*m+1) $ insert (2*m+1) s') where
            (m, s') = deleteFindMin s
    -- Reinhard Zumkeller, Feb 10 2011
    
  • Haskell
    See Niemeijer link.
    import Data.List.Ordered (union)
    a002977_list = 1 : union
       (map ((+1) . (*2)) a002977_list) (map ((+1) . (*3)) a002977_list)
    -- Reinhard Zumkeller, Nov 12 2014
    
  • Mathematica
    Union[ Flatten[ NestList[{2# + 1, 3# + 1} &, 1, 6]]] (* Robert G. Wilson v, May 11 2005 *)
  • PARI
    list(lim)=my(u=List(),v=List([1]),t,sz); while(#v, listput(u,v[1]); t=2*v[1]+1; if(t>lim, listpop(v,1); next); listput(v,t); t=3*v[1]+1; listpop(v,1); if(t<=lim, listput(v,t)); if(#v>sz, u=Set(u); v=List(setminus(Set(v),u)); u=List(u); sz=2*#v)); Set(u) \\ Charles R Greathouse IV, Aug 21 2017

Formula

It seems that lim_{n->infinity} log(A002977(n))/log(n) = C = 1.3... and probably A002977(n) is asymptotic to u*n^C with u=1.0... - Benoit Cloitre, Nov 06 2002
Limit_{n->infinity} log(A002977(n))/log(n) = C = 1.269220905243564855888589424556..., and lim_{n->infinity} A002977(n)/n^C = u = 1.335... - Yi Yang, Jul 23 2011, Aug 21 2017

Extensions

More terms from Ray Chandler, Sep 06 2003

A179526 (3^k - 1)/2 appears 3^(k-1) times, k>0.

Original entry on oeis.org

1, 4, 4, 4, 13, 13, 13, 13, 13, 13, 13, 13, 13, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121
Offset: 0

Views

Author

Reinhard Zumkeller, Jul 18 2010

Keywords

Crossrefs

Programs

  • Mathematica
    Table[PadRight[{},3^(k-1),(3^k-1)/2],{k,5}]//Flatten (* Harvey P. Dale, May 30 2021 *)

Formula

a(n+1) = 3*a(floor(n/3)) + 1; a(0) = 1.

Extensions

Erroneous comment deleted by Reinhard Zumkeller, Jul 23 2010

A304431 a(n+1) = 1 + min( 2*a(floor(n/2)), 3*a(floor(n/3)) ), with a(0) = 0.

Original entry on oeis.org

0, 1, 1, 1, 3, 3, 3, 3, 3, 4, 4, 4, 4, 7, 7, 7, 7, 7, 7, 9, 9, 9, 9, 9, 9, 9, 9, 10, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 21, 21, 22, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27
Offset: 0

Views

Author

Michael Somos, May 12 2018

Keywords

Comments

Same recursion as Knuth numbers A007448 but different initial value.

Crossrefs

Cf. A007448.

Programs

  • PARI
    {a(n) = if( n<1, 0, n--; 1 + min( a(n\2)*2, a(n\3)*3 ))};
Showing 1-7 of 7 results.