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-10 of 14 results. Next

A080468 a(n) = A080578(n)-2n.

Original entry on oeis.org

0, 1, 0, 1, 2, 1, 0, 1, 2, 1, 2, 3, 2, 1, 0, 1, 2, 1, 2, 3, 2, 1, 2, 3, 2, 3, 4, 3, 2, 1, 0, 1, 2, 1, 2, 3, 2, 1, 2, 3, 2, 3, 4, 3, 2, 1, 2, 3, 2, 3, 4, 3, 2, 3, 4, 3, 4, 5, 4, 3, 2, 1, 0, 1, 2, 1, 2, 3, 2, 1, 2, 3, 2, 3, 4, 3, 2, 1, 2, 3, 2, 3, 4, 3, 2, 3, 4, 3, 4, 5, 4, 3, 2, 1, 2, 3, 2, 3, 4, 3, 2, 3, 4, 3, 4
Offset: 2

Views

Author

Benoit Cloitre, Oct 12 2003

Keywords

Comments

Terms between 2^n and 2^(n+1) as n goes to infinity tend to the sequence : 0,1,2,1,2,3,2,1,2,3,2,3,4,3,2,1,2,3,2,3,4,3,2,3,4,3,4,5,4,3,2,1,....

Crossrefs

Programs

Formula

a(2^n) = 0; Sum_{k=2^n..2^(n+1)} a(k) = n*2^(n-1) = A001787(n).

A087805 Partial sums of b(k) where {b(k)}{k>=0} = lim{n->oo} {A080578(k)-2k : k=2^n,2^n+1,2^n+2,...}.

Original entry on oeis.org

0, 1, 3, 4, 6, 9, 11, 12, 14, 17, 19, 22, 26, 29, 31, 32, 34, 37, 39, 42, 46, 49, 51, 54, 58, 61, 65, 70, 74, 77, 79, 80, 82, 85, 87, 90, 94, 97, 99, 102, 106, 109, 113, 118, 122, 125, 127, 130, 134, 137, 141, 146, 150, 153, 157, 162, 166, 171, 177, 182, 186, 189, 191
Offset: 0

Views

Author

Benoit Cloitre, Oct 12 2003

Keywords

Crossrefs

Formula

a(n) seems to be asymptotic to c*n*log(n). Is c = log(2)?

A055938 Integers not generated by b(n) = b(floor(n/2)) + n (complement of A005187).

Original entry on oeis.org

2, 5, 6, 9, 12, 13, 14, 17, 20, 21, 24, 27, 28, 29, 30, 33, 36, 37, 40, 43, 44, 45, 48, 51, 52, 55, 58, 59, 60, 61, 62, 65, 68, 69, 72, 75, 76, 77, 80, 83, 84, 87, 90, 91, 92, 93, 96, 99, 100, 103, 106, 107, 108, 111, 114, 115, 118, 121, 122, 123, 124, 125, 126, 129
Offset: 1

Views

Author

Alford Arnold, Jul 21 2000

Keywords

Comments

Note that the lengths of the consecutive runs in a(n) form sequence A001511.
Integers that are not a sum of distinct integers of the form 2^k-1. - Vladeta Jovovic, Jan 24 2003
Also n! never ends in this many 0's in base 2 - Carl R. White, Jan 21 2008
A079559(a(n)) = 0. - Reinhard Zumkeller, Mar 18 2009
These numbers are dead-end points when trying to apply the iterated process depicted in A071542 in reverse, i.e. these are positive integers i such that there does not exist k with A000120(i+k)=k. See also comments at A179016. - Antti Karttunen, Oct 26 2012
Conjecture: a(n)=b(n) defined as b(1)=2, for n>1, b(n+1)=b(n)+1 if n is already in the sequence, b(n+1)=b(n)+3 otherwise. If so, then see Cloitre comment in A080578. - Ralf Stephan, Dec 27 2013
Numbers n for which A257265(m) = 0. - Reinhard Zumkeller, May 06 2015. Typo corrected by Antti Karttunen, Aug 08 2015
Numbers which have a 2 in their skew-binary representation (cf. A169683). - Allan C. Wechsler, Feb 28 2025

Examples

			Since A005187 begins 0 1 3 4 7 8 10 11 15 16 18 19 22 23 25 26 31... this sequence begins 2 5 6 9 12 13 14 17 20 21
		

Crossrefs

Complement of A005187. Setwise difference of A213713 and A213717.
Row 1 of arrays A257264, A256997 and also of A255557 (when prepended with 1). Equally: column 1 of A256995 and A255555.
Cf. also arrays A254105, A254107 and permutations A233276, A233278.
Left inverses: A234017, A256992.
Gives positions of zeros in A213714, A213723, A213724, A213731, A257265, positions of ones in A213725-A213727 and A256989, positions of nonzeros in A254110.
Cf. also A010061 (integers that are not a sum of distinct integers of the form 2^k+1).
Analogous sequence for factorial base number system: A219658, for Fibonacci number system: A219638, for base-3: A096346. Cf. also A136767-A136774.

Programs

  • Haskell
    a055938 n = a055938_list !! (n-1)
    a055938_list = concat $
       zipWith (\u v -> [u+1..v-1]) a005187_list $ tail a005187_list
    -- Reinhard Zumkeller, Nov 07 2011
    
  • Mathematica
    a[0] = 0; a[1] = 1; a[n_Integer] := a[Floor[n/2]] + n; b = {}; Do[ b = Append[b, a[n]], {n, 0, 105}]; c =Table[n, {n, 0, 200}]; Complement[c, b]
    (* Second program: *)
    t = Table[IntegerExponent[(2n)!, 2], {n, 0, 100}]; Complement[Range[t // Last], t] (* Jean-François Alcover, Nov 15 2016 *)
  • PARI
    L=listcreate();for(n=1,1000,for(k=2*n-hammingweight(n)+1,2*n+1-hammingweight(n+1),listput(L,k)));Vec(L) \\ Ralf Stephan, Dec 27 2013
    
  • Python
    def a053644(n): return 0 if n==0 else 2**(len(bin(n)[2:]) - 1)
    def a043545(n):
        x=bin(n)[2:]
        return int(max(x)) - int(min(x))
    def a079559(n): return 1 if n==0 else a043545(n + 1)*a079559(n + 1 - a053644(n + 1))
    print([n for n in range(1, 201) if a079559(n)==0]) # Indranil Ghosh, Jun 11 2017, after the comment by Reinhard Zumkeller
  • Scheme
    ;; utilizing COMPLEMENT-macro from Antti Karttunen's IntSeq-library)
    (define A055938 (COMPLEMENT 1 A005187))
    ;; Antti Karttunen, Aug 08 2015
    

Formula

a(n) = A080578(n+1) - 2 = A080468(n+1) + 2*n (conjectured). - Ralf Stephan, Dec 27 2013
From Antti Karttunen, Aug 08 2015: (Start)
Other identities. For all n >= 1:
A234017(a(n)) = n.
A256992(a(n)) = n.
A257126(n) = a(n) - A005187(n).
(End)

Extensions

More terms from Robert G. Wilson v, Jul 24 2000

A046699 a(1) = a(2) = 1, a(n) = a(n - a(n-1)) + a(n-1 - a(n-2)) if n > 2.

Original entry on oeis.org

1, 1, 2, 2, 3, 4, 4, 4, 5, 6, 6, 7, 8, 8, 8, 8, 9, 10, 10, 11, 12, 12, 12, 13, 14, 14, 15, 16, 16, 16, 16, 16, 17, 18, 18, 19, 20, 20, 20, 21, 22, 22, 23, 24, 24, 24, 24, 25, 26, 26, 27, 28, 28, 28, 29, 30, 30, 31, 32, 32, 32, 32, 32, 32, 33, 34, 34, 35, 36, 36, 36, 37
Offset: 1

Views

Author

Keywords

Comments

Ignoring first term, this is the meta-Fibonacci sequence for s=0. - Frank Ruskey and Chris Deugau (deugaucj(AT)uvic.ca)
Except for the first term, n occurs A001511(n) times. - Franklin T. Adams-Watters, Oct 22 2006

References

  • Sequence was proposed by Reg Allenby.
  • B. W. Conolly, "Meta-Fibonacci sequences," in S. Vajda, editor, Fibonacci and Lucas Numbers and the Golden Section. Halstead Press, NY, 1989, pp. 127-138. See Eq. (2).
  • Michael Doob, The Canadian Mathematical Olympiad & L'Olympiade Mathématique du Canada 1969-1993, Canadian Mathematical Society & Société Mathématique du Canada, Problem 5, 1990, pp. 212-213, 1993.
  • S. Vajda, Fibonacci and Lucas Numbers and the Golden Section, Wiley, 1989, see p. 129.
  • S. Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 129.

Crossrefs

Callaghan et al. (2005)'s sequences T_{0,k}(n) for k=1 through 7 are A000012, A046699, A046702, A240835, A241154, A241155, A240830.

Programs

  • Haskell
    a046699 n = a046699_list !! (n-1)
    a046699_list = 1 : 1 : zipWith (+) zs (tail zs) where
       zs = map a046699 $ zipWith (-) [2..] a046699_list
    -- Reinhard Zumkeller, Jan 02 2012
    
  • Magma
    [ n le 2 select 1 else Self(n - Self(n-1)) + Self(n-1 -Self(n-2)):n in [1..80]]; // Marius A. Burtea, Oct 17 2019
  • Maple
    a := proc(n) option remember; if n <= 1 then return 1 end if; if n <= 2 then return 2 end if; return add(a(n - i + 1 - a(n - i)), i = 1 .. 2) end proc # Frank Ruskey and Chris Deugau (deugaucj(AT)uvic.ca)
    a := proc(n) option remember; if n <= 2 then 1 else a(n - a(n-1)) + a(n-1 - a(n-2)); fi; end; # N. J. A. Sloane, Apr 16 2014
  • Mathematica
    a[n_] := (k = 1; While[ !Divisible[(2*++k)!, 2^(n-1)]]; k); a[1] = a[2] = 1; Table[a[n], {n, 1, 72}] (* Jean-François Alcover, Oct 06 2011, after Benoit Cloitre *)
    CoefficientList[ Series[1 + x/(1 - x)*Product[1 + x^(2^n - 1), {n, 6}], {x, 0, 80}], x] (* or *)
    a[1] = a[2] = 1; a[n_] := a[n] = a[n - a[n - 1]] + a[n - 1 - a[n - 2]]; Array[a, 80] (* Robert G. Wilson v, Sep 08 2014 *)
  • Maxima
    a[1]:1$
    a[2]:1$
    a[n]:=a[n-a[n-1]]+a[n-1-a[n-2]]$
    makelist(a[n],n,2,60); /* Martin Ettl, Oct 29 2012 */
    
  • PARI
    a(n)=if(n<0,1,s=1;while((2*s)!%2^(n-1)>0,s++);s) \\ Benoit Cloitre, Jan 19 2007
    
  • Python
    from sympy import factorial
    def a(n):
        if n<3: return 1
        s=1
        while factorial(2*s)%(2**(n - 1))>0: s+=1
        return s
    print([a(n) for n in range(1, 101)]) # Indranil Ghosh, Jun 11 2017, after Benoit Cloitre
    

Formula

First differences seem to be A079559. - Vladeta Jovovic, Nov 30 2003. This is correct and not too hard to prove, giving the generating function x + x^2(1+x)(1+x^3)(1+x^7)(1+x^15).../(1-x). - Paul Boddington, Jul 30 2004
G.f.: x + x^2/(1-x) * Product_{n=1}^{infinity} (1 + x^(2^n-1)). - Frank Ruskey and Chris Deugau (deugaucj(AT)uvic.ca)
For n>=1, a(n)=w(n-1) where w(n) is the least k such that 2^n divides (2k)!. - Benoit Cloitre, Jan 19 2007
Conjecture: a(n+1) = a(n) + A215530(a(n) + n) for all n > 0. - Velin Yanev, Oct 17 2019
From Bernard Schott, Dec 03 2021: (Start)
a(n) <= a(n+1) <= a(n) +1.
For n > 1, if a(n) is odd, then a(n+1) = a(n) + 1.
a(2^n+1) = 2^(n-1) + 1 for n > 0.
Results coming from the 5th problem proposed during the 22nd Canadian Mathematical Olympiad in 1990 (link IMO Compendium and Doob reference). (End)

A080900 a(1)=1; for n>1, a(n)=a(n-1)-2 if n is already in the sequence, a(n)=a(n-1)+5 otherwise.

Original entry on oeis.org

1, 6, 11, 16, 21, 19, 24, 29, 34, 39, 37, 42, 47, 52, 57, 55, 60, 65, 63, 68, 66, 71, 76, 74, 79, 84, 89, 94, 92, 97, 102, 107, 112, 110, 115, 120, 118, 123, 121, 126, 131, 129, 134, 139, 144, 149, 147, 152, 157, 162, 167, 165, 170, 175, 173, 178, 176
Offset: 1

Views

Author

N. J. A. Sloane and Benoit Cloitre, Apr 01 2003

Keywords

Crossrefs

Cf. A080901 (starting value = 2), A080905 (run lengths of first differences).

Programs

  • Mathematica
    Fold[Append[#1, #1[[-1]] + If[MemberQ[#1, #2], -2, 5]] &, {1}, Range[2, 57]] (* Ivan Neretin, Mar 03 2016 *)
  • PARI
    up_to = 1001;
    A080900list(up_to_n) = { my(xs=Map(), v=vector(up_to_n)); mapput(xs,1,1); v[1] = 1; for(n=2,up_to_n, v[n] = v[n-1]+if(mapisdefined(xs,n), -2, +5); mapput(xs,v[n],n)); (v); };
    v080900 = A080900list(up_to);
    A080900(n) = v080900[n]; \\ Antti Karttunen, Jan 22 2020

Formula

Perhaps this is asymptotic to c_0*n*(1 + c_1/log n + ...), with c_0 near 2 ?

A080901 a(1)=2; for n>1, a(n)=a(n-1)-2 if n is already in the sequence, a(n)=a(n-1)+5 otherwise.

Original entry on oeis.org

2, 0, 5, 10, 8, 13, 18, 16, 21, 19, 24, 29, 27, 32, 37, 35, 40, 38, 36, 41, 39, 44, 49, 47, 52, 57, 55, 60, 58, 63, 68, 66, 71, 76, 74, 72, 70, 68, 66, 64, 62, 67, 72, 70, 75, 80, 78, 83, 81, 86, 91, 89, 94, 99, 97, 102, 100, 98, 103, 101, 106, 104, 102, 100
Offset: 1

Views

Author

N. J. A. Sloane and Benoit Cloitre, Apr 01 2003

Keywords

Crossrefs

Programs

  • Mathematica
    Fold[Append[#1, #1[[-1]] + If[MemberQ[#1, #2], -2, 5]] &, {2}, Range[2, 64]] (* Ivan Neretin, Mar 03 2016 *)

Formula

a(n)-n (n >= 1) (A081745) is periodic with period 168.

A045412 a(1)=3; for n > 1, a(n) = a(n-1) + 1 if n is already in the sequence, a(n) = a(n-1) + 3 otherwise.

Original entry on oeis.org

3, 6, 7, 10, 13, 14, 15, 18, 21, 22, 25, 28, 29, 30, 31, 34, 37, 38, 41, 44, 45, 46, 49, 52, 53, 56, 59, 60, 61, 62, 63, 66, 69, 70, 73, 76, 77, 78, 81, 84, 85, 88, 91, 92, 93, 94, 97, 100, 101, 104, 107, 108, 109, 112, 115, 116, 119, 122, 123, 124, 125, 126
Offset: 1

Views

Author

N. J. A. Sloane and Benoit Cloitre, Apr 01 2003

Keywords

Comments

It appears these are the indices of the terms in A182105 which are greater than 1. - Carl Joshua Quines, Apr 07 2017
In the Fokkink-Joshi paper, this sequence is the Cloitre (0,3,1,3)-hiccup sequence. - Michael De Vlieger, Jul 30 2025

Crossrefs

Cf. A080578.

Programs

  • Mathematica
    l={3}; a=3; For[n=2, n<=100, If[MemberQ[l, n], a=a+1, a=a+3]; AppendTo[l, a]; n++]; l (* Indranil Ghosh, Apr 07 2017 *)
  • Python
    l=[3]
    a=3
    for n in range(2, 101):
        if n not in l: a+=3
        else: a+=1
        l.append(a)
    print(l) # Indranil Ghosh, Apr 07 2017

A081746 a(1)=1; for n>1, a(n)=a(n-1)-3 if n is already in the sequence, a(n)=a(n-1)+5 otherwise.

Original entry on oeis.org

1, 6, 11, 16, 21, 18, 23, 28, 33, 38, 35, 40, 45, 50, 55, 52, 57, 54, 59, 64, 61, 66, 63, 68, 73, 78, 83, 80, 85, 90, 95, 100, 97, 102, 99, 104, 109, 106, 111, 108, 113, 118, 123, 128, 125, 130, 135, 140, 145, 142, 147, 144, 149, 146, 143, 148, 145, 150
Offset: 1

Views

Author

Benoit Cloitre, Apr 05 2003

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := a[n] = If[n == 1, 1, If[MemberQ[Array[a, n-1], n], a[n-1] - 3, a[n-1] + 5]]; Array[a, 58] (* Jean-François Alcover, Oct 05 2018 *)

Formula

a(n) - n is periodic with period 648.

A061891 a(0) = 1; for n>0, a(n) = a(n-1) if n is already in the sequence, a(n) = a(n-1) + 3 otherwise.

Original entry on oeis.org

1, 1, 4, 7, 7, 10, 13, 13, 16, 19, 19, 22, 25, 25, 28, 31, 31, 34, 37, 37, 40, 43, 43, 46, 49, 49, 52, 55, 55, 58, 61, 61, 64, 67, 67, 70, 73, 73, 76, 79, 79, 82, 85, 85, 88, 91, 91, 94, 97, 97, 100, 103, 103, 106, 109, 109, 112, 115, 115, 118, 121, 121, 124
Offset: 0

Views

Author

N. J. A. Sloane and Benoit Cloitre, Apr 01 2003

Keywords

Crossrefs

Cf. A080578.

Programs

Formula

a(n) = 2*n-1 if n == 1 (mod 3), 2*n if n == 2 (mod 3), 2*n + 1 if n == 0 (mod 3).
Differences are periodic with period 3.
From Colin Barker, Jun 20 2013: (Start)
a(n) = a(n-1) + a(n-3) - a(n-4).
G.f.: (2*x^3 + 3*x^2 + 1) / ((x - 1)^2*(x^2 + x +1)). (End)
a(n) = 2*n + 1 - A080425(n) = 2*n - 1 + A010872(n+1). [Wesley Ivan Hurt, Jul 07 2013]

A080904 a(1)=1; for n>1, a(n)=a(n-1)-4 if n is already in the sequence, a(n)=a(n-1)+5 otherwise.

Original entry on oeis.org

1, 6, 11, 16, 21, 17, 22, 27, 32, 37, 33, 38, 43, 48, 53, 49, 45, 50, 55, 60, 56, 52, 57, 62, 67, 72, 68, 73, 78, 83, 88, 84, 80, 85, 90, 95, 91, 87, 92, 97, 102, 107, 103, 108, 104, 109, 114, 110, 106, 102, 107, 103, 99, 104, 100, 96, 92, 97, 102, 98, 103, 99
Offset: 1

Views

Author

Benoit Cloitre, Apr 01 2003

Keywords

Comments

a(n)-n is eventually periodic with period 18. - Ivan Neretin, Mar 03 2016

Crossrefs

Programs

  • Mathematica
    Fold[Append[#1, #1[[-1]] + If[MemberQ[#1, #2], -4, 5]] &, {1}, Range[2, 62]] (* Ivan Neretin, Mar 03 2016 *)
Showing 1-10 of 14 results. Next